@iyulab/chat-components 0.16.1 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.17.1] - 2026-10-05
4
+
5
+ ### Changed
6
+
7
+ - **KaTeX 0.19** (was 0.18). Math renders as before. KaTeX now reports a character it has no metrics
8
+ for through its `strict` option (code `symbolNotInFont`): with the default `strict: "warn"` it is a
9
+ console warning, with `strict: "error"` it is a render error — set `strict` in the markdown math
10
+ options if you rely on either. A `strict` callback that returns nothing now warns; return `false`
11
+ or `"ignore"` to stay quiet.
12
+
13
+ ## [0.17.0] - 2026-10-05
14
+
15
+ ### Added
16
+
17
+ - **Press targets follow `--u-target-size`** (the host's minimum target size from `@iyulab/components`).
18
+ When it is set, the reference block header, reference card navigation, table sort buttons, the map
19
+ caption link and the image/file preview close buttons are at least that size. Unset, nothing changes.
20
+ Inline citation markers keep their size — they sit in a line of text.
21
+
3
22
  ## [0.16.1] - 2026-10-03
4
23
 
5
24
  ### Changed
@@ -165,8 +165,9 @@ var styles = css`
165
165
 
166
166
  .preview-close {
167
167
  flex-shrink: 0;
168
- width: 36px;
169
- height: 36px;
168
+ /* 호스트 하한(--u-target-size)이 더 크면 그 값. */
169
+ width: max(36px, var(--u-target-size, 0px));
170
+ height: max(36px, var(--u-target-size, 0px));
170
171
  border: none;
171
172
  border-radius: 12px;
172
173
  background: transparent;
@@ -15,6 +15,9 @@ var styles = css`
15
15
  align-items: center;
16
16
  justify-content: space-between;
17
17
  gap: 0.5em;
18
+ /* 호스트 하한(--u-target-size, 미설정 = 0). */
19
+ box-sizing: border-box;
20
+ min-height: var(--u-target-size, 0px);
18
21
  color: var(--u-txt-color-strong);
19
22
  user-select: none;
20
23
  cursor: pointer;
@@ -99,6 +99,7 @@ var styles = css`
99
99
  align-items: center;
100
100
  inline-size: 100%;
101
101
  padding: 8px 12px;
102
+ min-block-size: var(--u-target-size, 0px);
102
103
  font: inherit;
103
104
  color: inherit;
104
105
  cursor: pointer;
@@ -36,8 +36,8 @@ var styles = css`
36
36
  /* WCAG 2.2 SC 2.5.8 — 실측 16x16 이라 포인터 타깃이 모자랐다. 배경도 테두리도 없는
37
37
  아이콘 버튼이라 상자를 키워도 **보이는 것은 그대로**다: 아이콘 치수는 위 font-size 가
38
38
  정하고 여기서 늘어나는 것은 잡히는 영역뿐이다. */
39
- min-inline-size: 24px;
40
- min-block-size: 24px;
39
+ min-inline-size: max(24px, var(--u-target-size, 0px));
40
+ min-block-size: max(24px, var(--u-target-size, 0px));
41
41
  }
42
42
  .nav-button:hover u-icon {
43
43
  opacity: 0.6;
@@ -103,8 +103,9 @@ var styles = css`
103
103
  right: 16px;
104
104
  top: 50%;
105
105
  transform: translateY(-50%);
106
- width: 36px;
107
- height: 36px;
106
+ /* 호스트 하한(--u-target-size)이 더 크면 그 값. */
107
+ width: max(36px, var(--u-target-size, 0px));
108
+ height: max(36px, var(--u-target-size, 0px));
108
109
  border: none;
109
110
  border-radius: 12px;
110
111
  background: transparent;
@@ -37,6 +37,10 @@ var styles = css`
37
37
  flex-direction: column;
38
38
  gap: 0.25em;
39
39
  padding: 0.25em 0.5em;
40
+ /* 호스트 하한(--u-target-size, 미설정 = 0) — 상자는 border-box(기반 스타일)라 여백을 포함한다. */
41
+ min-height: var(--u-target-size, 0px);
42
+ min-width: var(--u-target-size, 0px);
43
+ justify-content: center;
40
44
  color: #fff;
41
45
  background: rgba(0, 0, 0, 0.6);
42
46
  border-radius: 6px;
@@ -246,43 +246,6 @@ var Settings = class {
246
246
  }
247
247
  }
248
248
  /**
249
- * Report nonstrict (non-LaTeX-compatible) input.
250
- * Can safely not be called if `this.strict` is false in JavaScript.
251
- */
252
- reportNonstrict(errorCode, errorMsg, token) {
253
- var strict = this.strict;
254
- if (typeof strict === "function") strict = strict(errorCode, errorMsg, token);
255
- if (!strict || strict === "ignore") return;
256
- else if (strict === true || strict === "error") throw new ParseError("LaTeX-incompatible input and strict mode is set to 'error': " + (errorMsg + " [" + errorCode + "]"), token);
257
- else if (strict === "warn") typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]"));
258
- else typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]"));
259
- }
260
- /**
261
- * Check whether to apply strict (LaTeX-adhering) behavior for unusual
262
- * input (like `\\`). Unlike `nonstrict`, will not throw an error;
263
- * instead, "error" translates to a return value of `true`, while "ignore"
264
- * translates to a return value of `false`. May still print a warning:
265
- * "warn" prints a warning and returns `false`.
266
- * This is for the second category of `errorCode`s listed in the README.
267
- */
268
- useStrictBehavior(errorCode, errorMsg, token) {
269
- var strict = this.strict;
270
- if (typeof strict === "function") try {
271
- strict = strict(errorCode, errorMsg, token);
272
- } catch (error) {
273
- strict = "error";
274
- }
275
- if (!strict || strict === "ignore") return false;
276
- else if (strict === true || strict === "error") return true;
277
- else if (strict === "warn") {
278
- typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]"));
279
- return false;
280
- } else {
281
- typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]"));
282
- return false;
283
- }
284
- }
285
- /**
286
249
  * Check whether to test potentially dangerous input, and return
287
250
  * `true` (trusted) or `false` (untrusted). The sole argument `context`
288
251
  * should be an object with `command` field specifying the relevant LaTeX
@@ -16588,6 +16551,34 @@ var wideCharacterFont = (wideChar) => {
16588
16551
  else if (120486 < codePoint && codePoint < 120782) return noFont;
16589
16552
  else throw new ParseError("Unsupported character: " + wideChar);
16590
16553
  };
16554
+ function handleStrict(params) {
16555
+ var strict = params.strict, errorCode = params.errorCode, errorMsg = params.errorMsg, token = params.token, report = params.report;
16556
+ var behavior = strict;
16557
+ if (typeof strict === "function") {
16558
+ if (report) behavior = strict(errorCode, errorMsg, token);
16559
+ else try {
16560
+ behavior = strict(errorCode, errorMsg, token);
16561
+ } catch (error) {
16562
+ behavior = "error";
16563
+ }
16564
+ }
16565
+ switch (behavior) {
16566
+ case true:
16567
+ case "error": if (report) throw new ParseError("LaTeX-incompatible input and strict mode is set to 'error': " + (errorMsg + " [" + errorCode + "]"), token);
16568
+ else return true;
16569
+ case false:
16570
+ case "ignore":
16571
+ if (!report) return false;
16572
+ break;
16573
+ default:
16574
+ typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]"));
16575
+ if (!report) return false;
16576
+ }
16577
+ }
16578
+ /**
16579
+ * This module contains general functions that can be used for building
16580
+ * different kinds of domTree nodes in a consistent manner.
16581
+ */
16591
16582
  /**
16592
16583
  * Looks up the given symbol in fontMetrics, after applying any symbol
16593
16584
  * replacements defined in symbol.js
@@ -16610,7 +16601,6 @@ var lookupSymbol = function lookupSymbol(value, fontName, mode) {
16610
16601
  * TODO: make argument order closer to makeSpan
16611
16602
  * TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which
16612
16603
  * should if present come first in `classes`.
16613
- * TODO(#953): Make `options` mandatory and always pass it in.
16614
16604
  */
16615
16605
  var makeSymbol = function makeSymbol(value, fontName, mode, options, classes) {
16616
16606
  var lookup = lookupSymbol(value, fontName, mode);
@@ -16622,15 +16612,18 @@ var makeSymbol = function makeSymbol(value, fontName, mode, options, classes) {
16622
16612
  if (mode === "text" || options && options.font === "mathit") italic = 0;
16623
16613
  symbolNode = new SymbolNode(value, metrics.height, metrics.depth, italic, metrics.skew, metrics.width, classes);
16624
16614
  } else {
16625
- typeof console !== "undefined" && console.warn("No character metrics " + ("for '" + value + "' in style '" + fontName + "' and mode '" + mode + "'"));
16615
+ handleStrict({
16616
+ strict: options.strict,
16617
+ errorCode: "symbolNotInFont",
16618
+ errorMsg: "No character metrics for '" + value + "' in style '" + fontName + "' and mode '" + mode + "'",
16619
+ report: true
16620
+ });
16626
16621
  symbolNode = new SymbolNode(value, 0, 0, 0, 0, 0, classes);
16627
16622
  }
16628
- if (options) {
16629
- symbolNode.maxFontSize = options.sizeMultiplier;
16630
- if (options.style.isTight()) symbolNode.classes.push("mtight");
16631
- var color = options.getColor();
16632
- if (color) symbolNode.style.color = color;
16633
- }
16623
+ symbolNode.maxFontSize = options.sizeMultiplier;
16624
+ if (options.style.isTight()) symbolNode.classes.push("mtight");
16625
+ var color = options.getColor();
16626
+ if (color) symbolNode.style.color = color;
16634
16627
  return symbolNode;
16635
16628
  };
16636
16629
  /**
@@ -17809,6 +17802,7 @@ var Options = class Options {
17809
17802
  this.maxSize = void 0;
17810
17803
  this.minRuleThickness = void 0;
17811
17804
  this._fontMetrics = void 0;
17805
+ this.strict = void 0;
17812
17806
  this.style = data.style;
17813
17807
  this.color = data.color;
17814
17808
  this.size = data.size || Options.BASESIZE;
@@ -17821,6 +17815,7 @@ var Options = class Options {
17821
17815
  this.sizeMultiplier = sizeMultipliers[this.size - 1];
17822
17816
  this.maxSize = data.maxSize;
17823
17817
  this.minRuleThickness = data.minRuleThickness;
17818
+ this.strict = data.strict;
17824
17819
  this._fontMetrics = void 0;
17825
17820
  }
17826
17821
  /**
@@ -17839,7 +17834,8 @@ var Options = class Options {
17839
17834
  fontWeight: this.fontWeight,
17840
17835
  fontShape: this.fontShape,
17841
17836
  maxSize: this.maxSize,
17842
- minRuleThickness: this.minRuleThickness
17837
+ minRuleThickness: this.minRuleThickness,
17838
+ strict: this.strict
17843
17839
  };
17844
17840
  Object.assign(data, extension);
17845
17841
  return new Options(data);
@@ -17999,13 +17995,12 @@ var Options = class Options {
17999
17995
  * The base size index.
18000
17996
  */
18001
17997
  Options.BASESIZE = 6;
18002
- var optionsFromSettings = function optionsFromSettings(settings) {
18003
- return new Options({
18004
- style: settings.displayMode ? Style$1.DISPLAY : Style$1.TEXT,
18005
- maxSize: settings.maxSize,
18006
- minRuleThickness: settings.minRuleThickness
18007
- });
18008
- };
17998
+ var optionsFromSettings = (settings) => new Options({
17999
+ style: settings.displayMode ? Style$1.DISPLAY : Style$1.TEXT,
18000
+ maxSize: settings.maxSize,
18001
+ minRuleThickness: settings.minRuleThickness,
18002
+ strict: settings.strict
18003
+ });
18009
18004
  var displayWrap = function displayWrap(node, settings) {
18010
18005
  if (settings.displayMode) {
18011
18006
  var classes = ["katex-display"];
@@ -18023,7 +18018,7 @@ var buildTree = function buildTree(tree, expression, settings) {
18023
18018
  else katexNode = makeSpan(["katex"], [buildMathML(tree, expression, options, settings.displayMode, false), buildHTML(tree, options)]);
18024
18019
  return displayWrap(katexNode, settings);
18025
18020
  };
18026
- var buildHTMLTree = function buildHTMLTree(tree, expression, settings) {
18021
+ var buildHTMLTree = function buildHTMLTree(tree, settings) {
18027
18022
  return displayWrap(makeSpan(["katex"], [buildHTML(tree, optionsFromSettings(settings))]), settings);
18028
18023
  };
18029
18024
  /**
@@ -18759,7 +18754,12 @@ defineFunction({
18759
18754
  var base = args[0];
18760
18755
  var mode = context.parser.mode;
18761
18756
  if (mode === "math") {
18762
- context.parser.settings.reportNonstrict("mathVsTextAccents", "LaTeX's accent " + context.funcName + " works only in text mode");
18757
+ handleStrict({
18758
+ strict: context.parser.settings.strict,
18759
+ errorCode: "mathVsTextAccents",
18760
+ errorMsg: "LaTeX's accent " + context.funcName + " works only in text mode",
18761
+ report: true
18762
+ });
18763
18763
  mode = "text";
18764
18764
  }
18765
18765
  return {
@@ -19371,10 +19371,15 @@ defineFunction({
19371
19371
  numArgs: 0,
19372
19372
  numOptionalArgs: 0,
19373
19373
  allowedInText: true,
19374
- handler(_ref, args, optArgs) {
19374
+ handler(_ref) {
19375
19375
  var parser = _ref.parser;
19376
19376
  var size = parser.gullet.future().text === "[" ? parser.parseSizeGroup(true) : null;
19377
- var newLine = !parser.settings.displayMode || !parser.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline does nothing in display mode");
19377
+ var newLine = !parser.settings.displayMode || !handleStrict({
19378
+ strict: parser.settings.strict,
19379
+ errorCode: "newLineInDisplayMode",
19380
+ errorMsg: "In LaTeX, \\\\ or \\newline does nothing in display mode",
19381
+ report: false
19382
+ });
19378
19383
  return {
19379
19384
  type: "cr",
19380
19385
  mode: parser.mode,
@@ -19625,13 +19630,13 @@ var makeLargeDelim = function makeLargeDelim(delim, size, center, options, mode,
19625
19630
  * Make a span from a font glyph with the given offset and in the given font.
19626
19631
  * This is used in makeStackedDelim to make the stacking pieces for the delimiter.
19627
19632
  */
19628
- var makeGlyphSpan = function makeGlyphSpan(symbol, font, mode) {
19633
+ var makeGlyphSpan = function makeGlyphSpan(symbol, font, mode, options) {
19629
19634
  var sizeClass;
19630
19635
  if (font === "Size1-Regular") sizeClass = "delim-size1";
19631
19636
  else sizeClass = "delim-size4";
19632
19637
  return {
19633
19638
  type: "elem",
19634
- elem: makeSpan(["delimsizinginner", sizeClass], [makeSpan([], [makeSymbol(symbol, font, mode)])])
19639
+ elem: makeSpan(["delimsizinginner", sizeClass], [makeSpan([], [makeSymbol(symbol, font, mode, options)])])
19635
19640
  };
19636
19641
  };
19637
19642
  var makeInner = function makeInner(ch, height, options) {
@@ -19826,7 +19831,7 @@ var makeStackedDelim = function makeStackedDelim(delim, heightTotal, center, opt
19826
19831
  elem: wrapper
19827
19832
  });
19828
19833
  } else {
19829
- stack.push(makeGlyphSpan(bottom, font, mode));
19834
+ stack.push(makeGlyphSpan(bottom, font, mode, options));
19830
19835
  stack.push(lap);
19831
19836
  if (middle === null) {
19832
19837
  var innerHeight = realHeightTotal - topHeightTotal - bottomHeightTotal + 2 * lapInEms;
@@ -19835,12 +19840,12 @@ var makeStackedDelim = function makeStackedDelim(delim, heightTotal, center, opt
19835
19840
  var _innerHeight = (realHeightTotal - topHeightTotal - bottomHeightTotal - middleHeightTotal) / 2 + 2 * lapInEms;
19836
19841
  stack.push(makeInner(repeat, _innerHeight, options));
19837
19842
  stack.push(lap);
19838
- stack.push(makeGlyphSpan(middle, font, mode));
19843
+ stack.push(makeGlyphSpan(middle, font, mode, options));
19839
19844
  stack.push(lap);
19840
19845
  stack.push(makeInner(repeat, _innerHeight, options));
19841
19846
  }
19842
19847
  stack.push(lap);
19843
- stack.push(makeGlyphSpan(top, font, mode));
19848
+ stack.push(makeGlyphSpan(top, font, mode, options));
19844
19849
  }
19845
19850
  var newOptions = options.havingBaseStyle(Style$1.TEXT);
19846
19851
  return styleWrap(makeSpan(["delimsizing", "mult"], [makeVList({
@@ -20649,7 +20654,12 @@ defineFunction({
20649
20654
  allowedInText: true,
20650
20655
  handler(_ref5, args) {
20651
20656
  var parser = _ref5.parser, funcName = _ref5.funcName;
20652
- if (parser.mode === "math") parser.settings.reportNonstrict("mathVsSout", "LaTeX's \\sout works only in text mode");
20657
+ if (parser.mode === "math") handleStrict({
20658
+ strict: parser.settings.strict,
20659
+ errorCode: "mathVsSout",
20660
+ errorMsg: "LaTeX's \\sout works only in text mode",
20661
+ report: true
20662
+ });
20653
20663
  var body = args[0];
20654
20664
  return {
20655
20665
  type: "enclose",
@@ -20841,7 +20851,12 @@ function parseArray(parser, _ref, style) {
20841
20851
  if (next === "&") {
20842
20852
  if (maxNumCols && row.length === maxNumCols) {
20843
20853
  if (singleRow || colSeparationType) throw new ParseError("Too many tab characters: &", parser.nextToken);
20844
- else parser.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument.");
20854
+ else handleStrict({
20855
+ strict: parser.settings.strict,
20856
+ errorCode: "textEnv",
20857
+ errorMsg: "Too few columns specified in the {array} column argument.",
20858
+ report: true
20859
+ });
20845
20860
  }
20846
20861
  parser.consume();
20847
20862
  } else if (next === "\\end") {
@@ -22198,7 +22213,12 @@ defineFunction({
22198
22213
  _ref.token;
22199
22214
  var value = assertNodeType(args[0], "raw").string;
22200
22215
  var body = args[1];
22201
- if (parser.settings.strict) parser.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode");
22216
+ if (parser.settings.strict) handleStrict({
22217
+ strict: parser.settings.strict,
22218
+ errorCode: "htmlExtension",
22219
+ errorMsg: "HTML extension is disabled on strict mode",
22220
+ report: true
22221
+ });
22202
22222
  var trustContext;
22203
22223
  var attributes = {};
22204
22224
  switch (funcName) {
@@ -22428,9 +22448,24 @@ defineFunction({
22428
22448
  var mathFunction = funcName[1] === "m";
22429
22449
  var muUnit = size.value.unit === "mu";
22430
22450
  if (mathFunction) {
22431
- if (!muUnit) parser.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " supports only mu units, " + ("not " + size.value.unit + " units"));
22432
- if (parser.mode !== "math") parser.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " works only in math mode");
22433
- } else if (muUnit) parser.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " doesn't support mu units");
22451
+ if (!muUnit) handleStrict({
22452
+ strict: parser.settings.strict,
22453
+ errorCode: "mathVsTextUnits",
22454
+ errorMsg: "LaTeX's " + funcName + " supports only mu units, " + ("not " + size.value.unit + " units"),
22455
+ report: true
22456
+ });
22457
+ if (parser.mode !== "math") handleStrict({
22458
+ strict: parser.settings.strict,
22459
+ errorCode: "mathVsTextUnits",
22460
+ errorMsg: "LaTeX's " + funcName + " works only in math mode",
22461
+ report: true
22462
+ });
22463
+ } else if (muUnit) handleStrict({
22464
+ strict: parser.settings.strict,
22465
+ errorCode: "mathVsTextUnits",
22466
+ errorMsg: "LaTeX's " + funcName + " doesn't support mu units",
22467
+ report: true
22468
+ });
22434
22469
  }
22435
22470
  return {
22436
22471
  type: "kern",
@@ -23961,7 +23996,12 @@ var Lexer = class {
23961
23996
  var nlIndex = input.indexOf("\n", this.tokenRegex.lastIndex);
23962
23997
  if (nlIndex === -1) {
23963
23998
  this.tokenRegex.lastIndex = input.length;
23964
- this.settings.reportNonstrict("commentAtEnd", "% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)");
23999
+ handleStrict({
24000
+ strict: this.settings.strict,
24001
+ errorCode: "commentAtEnd",
24002
+ errorMsg: "% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)",
24003
+ report: true
24004
+ });
23965
24005
  } else this.tokenRegex.lastIndex = nlIndex + 1;
23966
24006
  return this.lex();
23967
24007
  }
@@ -26123,7 +26163,13 @@ var Parser = class Parser {
26123
26163
  };
26124
26164
  }
26125
26165
  if (Object.prototype.hasOwnProperty.call(unicodeSymbols, text[0]) && !symbols[this.mode][text[0]]) {
26126
- if (this.settings.strict && this.mode === "math") this.settings.reportNonstrict("unicodeTextInMathMode", "Accented Unicode text character \"" + text[0] + "\" used in math mode", nucleus);
26166
+ if (this.settings.strict && this.mode === "math") handleStrict({
26167
+ strict: this.settings.strict,
26168
+ errorCode: "unicodeTextInMathMode",
26169
+ errorMsg: "Accented Unicode text character \"" + text[0] + "\" used in math mode",
26170
+ report: true,
26171
+ token: nucleus
26172
+ });
26127
26173
  text = unicodeSymbols[text[0]] + text.slice(1);
26128
26174
  }
26129
26175
  var match = combiningDiacriticalMarksEndRegex.exec(text);
@@ -26134,7 +26180,13 @@ var Parser = class Parser {
26134
26180
  }
26135
26181
  var symbol;
26136
26182
  if (symbols[this.mode][text]) {
26137
- if (this.settings.strict && this.mode === "math" && extraLatin.includes(text)) this.settings.reportNonstrict("unicodeTextInMathMode", "Latin-1/Unicode text character \"" + text[0] + "\" used in math mode", nucleus);
26183
+ if (this.settings.strict && this.mode === "math" && extraLatin.includes(text)) handleStrict({
26184
+ strict: this.settings.strict,
26185
+ errorCode: "unicodeTextInMathMode",
26186
+ errorMsg: "Latin-1/Unicode text character \"" + text[0] + "\" used in math mode",
26187
+ report: true,
26188
+ token: nucleus
26189
+ });
26138
26190
  var group = symbols[this.mode][text].group;
26139
26191
  var loc = SourceLocation.range(nucleus);
26140
26192
  var s;
@@ -26154,8 +26206,20 @@ var Parser = class Parser {
26154
26206
  symbol = s;
26155
26207
  } else if (text.charCodeAt(0) >= 128) {
26156
26208
  if (this.settings.strict) {
26157
- if (!supportedCodepoint(text.charCodeAt(0))) this.settings.reportNonstrict("unknownSymbol", "Unrecognized Unicode character \"" + text[0] + "\"" + (" (" + text.charCodeAt(0) + ")"), nucleus);
26158
- else if (this.mode === "math") this.settings.reportNonstrict("unicodeTextInMathMode", "Unicode text character \"" + text[0] + "\" used in math mode", nucleus);
26209
+ if (!supportedCodepoint(text.charCodeAt(0))) handleStrict({
26210
+ strict: this.settings.strict,
26211
+ errorCode: "unknownSymbol",
26212
+ errorMsg: "Unrecognized Unicode character \"" + text[0] + "\"" + (" (" + text.charCodeAt(0) + ")"),
26213
+ report: true,
26214
+ token: nucleus
26215
+ });
26216
+ else if (this.mode === "math") handleStrict({
26217
+ strict: this.settings.strict,
26218
+ errorCode: "unicodeTextInMathMode",
26219
+ errorMsg: "Unicode text character \"" + text[0] + "\" used in math mode",
26220
+ report: true,
26221
+ token: nucleus
26222
+ });
26159
26223
  }
26160
26224
  symbol = {
26161
26225
  type: "textord",
@@ -26271,12 +26335,12 @@ var renderToDomTree = function renderToDomTree(expression, options) {
26271
26335
  var renderToHTMLTree = function renderToHTMLTree(expression, options) {
26272
26336
  var settings = new Settings(options);
26273
26337
  try {
26274
- return buildHTMLTree(parseTree(expression, settings), expression, settings);
26338
+ return buildHTMLTree(parseTree(expression, settings), settings);
26275
26339
  } catch (error) {
26276
26340
  return renderError(error, expression, settings);
26277
26341
  }
26278
26342
  };
26279
- var version = "0.18.10";
26343
+ var version = "0.19.0";
26280
26344
  var __domTree = {
26281
26345
  Span,
26282
26346
  Anchor,
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  import { UCodeBlock as UCodeBlockElement } from '@iyulab/chat-components/dist/components/blocks/UCodeBlock.js';
3
3
 
4
+ type UCodeBlockOwnProps = Omit<UCodeBlockElement, keyof HTMLElement>;
5
+
4
6
  export declare const UCodeBlock: React.ForwardRefExoticComponent<
5
- Omit<Partial<UCodeBlockElement>, keyof React.HTMLAttributes<UCodeBlockElement>>
6
- & Omit<React.HTMLAttributes<UCodeBlockElement>, never>
7
+ Partial<Omit<UCodeBlockElement, Exclude<keyof React.HTMLAttributes<UCodeBlockElement>, keyof UCodeBlockOwnProps>>>
8
+ & Omit<React.HTMLAttributes<UCodeBlockElement>, keyof UCodeBlockOwnProps | never>
7
9
  & React.RefAttributes<UCodeBlockElement>
8
10
  & {
9
11
  }
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  import { UElementBlock as UElementBlockElement } from '@iyulab/chat-components/dist/components/blocks/UElementBlock.js';
3
3
 
4
+ type UElementBlockOwnProps = Omit<UElementBlockElement, keyof HTMLElement>;
5
+
4
6
  export declare const UElementBlock: React.ForwardRefExoticComponent<
5
- Omit<Partial<UElementBlockElement>, keyof React.HTMLAttributes<UElementBlockElement>>
6
- & Omit<React.HTMLAttributes<UElementBlockElement>, never>
7
+ Partial<Omit<UElementBlockElement, Exclude<keyof React.HTMLAttributes<UElementBlockElement>, keyof UElementBlockOwnProps>>>
8
+ & Omit<React.HTMLAttributes<UElementBlockElement>, keyof UElementBlockOwnProps | never>
7
9
  & React.RefAttributes<UElementBlockElement>
8
10
  & {
9
11
  }
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  import { UFileBlock as UFileBlockElement } from '@iyulab/chat-components/dist/components/blocks/UFileBlock.js';
3
3
 
4
+ type UFileBlockOwnProps = Omit<UFileBlockElement, keyof HTMLElement>;
5
+
4
6
  export declare const UFileBlock: React.ForwardRefExoticComponent<
5
- Omit<Partial<UFileBlockElement>, keyof React.HTMLAttributes<UFileBlockElement>>
6
- & Omit<React.HTMLAttributes<UFileBlockElement>, 'onRemove'>
7
+ Partial<Omit<UFileBlockElement, Exclude<keyof React.HTMLAttributes<UFileBlockElement>, keyof UFileBlockOwnProps>>>
8
+ & Omit<React.HTMLAttributes<UFileBlockElement>, keyof UFileBlockOwnProps | 'onRemove'>
7
9
  & React.RefAttributes<UFileBlockElement>
8
10
  & {
9
11
  onRemove?: (event: CustomEvent<RemoveEventDetail>) => void;
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  import { UImagesBlock as UImagesBlockElement } from '@iyulab/chat-components/dist/components-extra/UImagesBlock.js';
3
3
 
4
+ type UImagesBlockOwnProps = Omit<UImagesBlockElement, keyof HTMLElement>;
5
+
4
6
  export declare const UImagesBlock: React.ForwardRefExoticComponent<
5
- Omit<Partial<UImagesBlockElement>, keyof React.HTMLAttributes<UImagesBlockElement>>
6
- & Omit<React.HTMLAttributes<UImagesBlockElement>, never>
7
+ Partial<Omit<UImagesBlockElement, Exclude<keyof React.HTMLAttributes<UImagesBlockElement>, keyof UImagesBlockOwnProps>>>
8
+ & Omit<React.HTMLAttributes<UImagesBlockElement>, keyof UImagesBlockOwnProps | never>
7
9
  & React.RefAttributes<UImagesBlockElement>
8
10
  & {
9
11
  }
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  import { UMapBlock as UMapBlockElement } from '@iyulab/chat-components/dist/components-extra/UMapBlock.js';
3
3
 
4
+ type UMapBlockOwnProps = Omit<UMapBlockElement, keyof HTMLElement>;
5
+
4
6
  export declare const UMapBlock: React.ForwardRefExoticComponent<
5
- Omit<Partial<UMapBlockElement>, keyof React.HTMLAttributes<UMapBlockElement>>
6
- & Omit<React.HTMLAttributes<UMapBlockElement>, never>
7
+ Partial<Omit<UMapBlockElement, Exclude<keyof React.HTMLAttributes<UMapBlockElement>, keyof UMapBlockOwnProps>>>
8
+ & Omit<React.HTMLAttributes<UMapBlockElement>, keyof UMapBlockOwnProps | never>
7
9
  & React.RefAttributes<UMapBlockElement>
8
10
  & {
9
11
  }
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  import { UMarkedBlock as UMarkedBlockElement } from '@iyulab/chat-components/dist/components/blocks/UMarkedBlock.js';
3
3
 
4
+ type UMarkedBlockOwnProps = Omit<UMarkedBlockElement, keyof HTMLElement>;
5
+
4
6
  export declare const UMarkedBlock: React.ForwardRefExoticComponent<
5
- Omit<Partial<UMarkedBlockElement>, keyof React.HTMLAttributes<UMarkedBlockElement>>
6
- & Omit<React.HTMLAttributes<UMarkedBlockElement>, never>
7
+ Partial<Omit<UMarkedBlockElement, Exclude<keyof React.HTMLAttributes<UMarkedBlockElement>, keyof UMarkedBlockOwnProps>>>
8
+ & Omit<React.HTMLAttributes<UMarkedBlockElement>, keyof UMarkedBlockOwnProps | never>
7
9
  & React.RefAttributes<UMarkedBlockElement>
8
10
  & {
9
11
  }
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  import { UMessage as UMessageElement } from '@iyulab/chat-components/dist/components/message/UMessage.js';
3
3
 
4
+ type UMessageOwnProps = Omit<UMessageElement, keyof HTMLElement>;
5
+
4
6
  export declare const UMessage: React.ForwardRefExoticComponent<
5
- Omit<Partial<UMessageElement>, keyof React.HTMLAttributes<UMessageElement>>
6
- & Omit<React.HTMLAttributes<UMessageElement>, never>
7
+ Partial<Omit<UMessageElement, Exclude<keyof React.HTMLAttributes<UMessageElement>, keyof UMessageOwnProps>>>
8
+ & Omit<React.HTMLAttributes<UMessageElement>, keyof UMessageOwnProps | never>
7
9
  & React.RefAttributes<UMessageElement>
8
10
  & {
9
11
  }
@@ -3,9 +3,11 @@ import { UPrompt as UPromptElement } from '@iyulab/chat-components/dist/componen
3
3
  import { type StopEventDetail } from '@iyulab/chat-components/dist/events/StopEvent.js';
4
4
  import { type SendEventDetail } from '@iyulab/chat-components/dist/events/SendEvent.js';
5
5
 
6
+ type UPromptOwnProps = Omit<UPromptElement, keyof HTMLElement>;
7
+
6
8
  export declare const UPrompt: React.ForwardRefExoticComponent<
7
- Omit<Partial<UPromptElement>, keyof React.HTMLAttributes<UPromptElement>>
8
- & Omit<React.HTMLAttributes<UPromptElement>, 'onStop' | 'onSend'>
9
+ Partial<Omit<UPromptElement, Exclude<keyof React.HTMLAttributes<UPromptElement>, keyof UPromptOwnProps>>>
10
+ & Omit<React.HTMLAttributes<UPromptElement>, keyof UPromptOwnProps | 'onStop' | 'onSend'>
9
11
  & React.RefAttributes<UPromptElement>
10
12
  & {
11
13
  onStop?: (event: CustomEvent<StopEventDetail>) => void;
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  import { URefBlock as URefBlockElement } from '@iyulab/chat-components/dist/components/blocks/URefBlock.js';
3
3
 
4
+ type URefBlockOwnProps = Omit<URefBlockElement, keyof HTMLElement>;
5
+
4
6
  export declare const URefBlock: React.ForwardRefExoticComponent<
5
- Omit<Partial<URefBlockElement>, keyof React.HTMLAttributes<URefBlockElement>>
6
- & Omit<React.HTMLAttributes<URefBlockElement>, never>
7
+ Partial<Omit<URefBlockElement, Exclude<keyof React.HTMLAttributes<URefBlockElement>, keyof URefBlockOwnProps>>>
8
+ & Omit<React.HTMLAttributes<URefBlockElement>, keyof URefBlockOwnProps | never>
7
9
  & React.RefAttributes<URefBlockElement>
8
10
  & {
9
11
  }
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  import { URefCard as URefCardElement } from '@iyulab/chat-components/dist/components/references/URefCard.js';
3
3
 
4
+ type URefCardOwnProps = Omit<URefCardElement, keyof HTMLElement>;
5
+
4
6
  export declare const URefCard: React.ForwardRefExoticComponent<
5
- Omit<Partial<URefCardElement>, keyof React.HTMLAttributes<URefCardElement>>
6
- & Omit<React.HTMLAttributes<URefCardElement>, never>
7
+ Partial<Omit<URefCardElement, Exclude<keyof React.HTMLAttributes<URefCardElement>, keyof URefCardOwnProps>>>
8
+ & Omit<React.HTMLAttributes<URefCardElement>, keyof URefCardOwnProps | never>
7
9
  & React.RefAttributes<URefCardElement>
8
10
  & {
9
11
  }
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  import { URefCardGroup as URefCardGroupElement } from '@iyulab/chat-components/dist/components/references/URefCardGroup.js';
3
3
 
4
+ type URefCardGroupOwnProps = Omit<URefCardGroupElement, keyof HTMLElement>;
5
+
4
6
  export declare const URefCardGroup: React.ForwardRefExoticComponent<
5
- Omit<Partial<URefCardGroupElement>, keyof React.HTMLAttributes<URefCardGroupElement>>
6
- & Omit<React.HTMLAttributes<URefCardGroupElement>, never>
7
+ Partial<Omit<URefCardGroupElement, Exclude<keyof React.HTMLAttributes<URefCardGroupElement>, keyof URefCardGroupOwnProps>>>
8
+ & Omit<React.HTMLAttributes<URefCardGroupElement>, keyof URefCardGroupOwnProps | never>
7
9
  & React.RefAttributes<URefCardGroupElement>
8
10
  & {
9
11
  }
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  import { URefTag as URefTagElement } from '@iyulab/chat-components/dist/components/references/URefTag.js';
3
3
 
4
+ type URefTagOwnProps = Omit<URefTagElement, keyof HTMLElement>;
5
+
4
6
  export declare const URefTag: React.ForwardRefExoticComponent<
5
- Omit<Partial<URefTagElement>, keyof React.HTMLAttributes<URefTagElement>>
6
- & Omit<React.HTMLAttributes<URefTagElement>, never>
7
+ Partial<Omit<URefTagElement, Exclude<keyof React.HTMLAttributes<URefTagElement>, keyof URefTagOwnProps>>>
8
+ & Omit<React.HTMLAttributes<URefTagElement>, keyof URefTagOwnProps | never>
7
9
  & React.RefAttributes<URefTagElement>
8
10
  & {
9
11
  }
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  import { UTableBlock as UTableBlockElement } from '@iyulab/chat-components/dist/components/blocks/UTableBlock.js';
3
3
 
4
+ type UTableBlockOwnProps = Omit<UTableBlockElement, keyof HTMLElement>;
5
+
4
6
  export declare const UTableBlock: React.ForwardRefExoticComponent<
5
- Omit<Partial<UTableBlockElement>, keyof React.HTMLAttributes<UTableBlockElement>>
6
- & Omit<React.HTMLAttributes<UTableBlockElement>, never>
7
+ Partial<Omit<UTableBlockElement, Exclude<keyof React.HTMLAttributes<UTableBlockElement>, keyof UTableBlockOwnProps>>>
8
+ & Omit<React.HTMLAttributes<UTableBlockElement>, keyof UTableBlockOwnProps | never>
7
9
  & React.RefAttributes<UTableBlockElement>
8
10
  & {
9
11
  }
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  import { UTextBlock as UTextBlockElement } from '@iyulab/chat-components/dist/components/blocks/UTextBlock.js';
3
3
 
4
+ type UTextBlockOwnProps = Omit<UTextBlockElement, keyof HTMLElement>;
5
+
4
6
  export declare const UTextBlock: React.ForwardRefExoticComponent<
5
- Omit<Partial<UTextBlockElement>, keyof React.HTMLAttributes<UTextBlockElement>>
6
- & Omit<React.HTMLAttributes<UTextBlockElement>, 'onInput'>
7
+ Partial<Omit<UTextBlockElement, Exclude<keyof React.HTMLAttributes<UTextBlockElement>, keyof UTextBlockOwnProps>>>
8
+ & Omit<React.HTMLAttributes<UTextBlockElement>, keyof UTextBlockOwnProps | 'onInput'>
7
9
  & React.RefAttributes<UTextBlockElement>
8
10
  & {
9
11
  onInput?: (event: CustomEvent) => void;
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  import { UVideoBlock as UVideoBlockElement } from '@iyulab/chat-components/dist/components-extra/UVideoBlock.js';
3
3
 
4
+ type UVideoBlockOwnProps = Omit<UVideoBlockElement, keyof HTMLElement>;
5
+
4
6
  export declare const UVideoBlock: React.ForwardRefExoticComponent<
5
- Omit<Partial<UVideoBlockElement>, keyof React.HTMLAttributes<UVideoBlockElement>>
6
- & Omit<React.HTMLAttributes<UVideoBlockElement>, never>
7
+ Partial<Omit<UVideoBlockElement, Exclude<keyof React.HTMLAttributes<UVideoBlockElement>, keyof UVideoBlockOwnProps>>>
8
+ & Omit<React.HTMLAttributes<UVideoBlockElement>, keyof UVideoBlockOwnProps | never>
7
9
  & React.RefAttributes<UVideoBlockElement>
8
10
  & {
9
11
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iyulab/chat-components",
3
3
  "description": "llm chat components for building chat interfaces",
4
- "version": "0.16.1",
4
+ "version": "0.17.1",
5
5
  "author": "iyulab",
6
6
  "license": "MIT",
7
7
  "keywords": [
@@ -56,6 +56,7 @@
56
56
  "preversion": "node -e \"if(require('fs').existsSync('../../scripts/preversion-check.mjs'))require('child_process').execFileSync('node',['../../scripts/preversion-check.mjs'],{stdio:'inherit'})\"",
57
57
  "start": "vite",
58
58
  "build": "npm run typecheck && eslint && vite build",
59
+ "pretest": "node -e \"if(require('fs').existsSync('../../scripts/sibling-dist-check.js'))require('child_process').execFileSync('node',['../../scripts/sibling-dist-check.js'],{stdio:'inherit'})\"",
59
60
  "test": "vitest run",
60
61
  "test:watch": "vitest",
61
62
  "lint": "eslint src/",
@@ -64,7 +65,7 @@
64
65
  },
65
66
  "dependencies": {
66
67
  "highlight.js": "^11.11.1",
67
- "katex": "^0.18.7",
68
+ "katex": "^0.19.0",
68
69
  "lit": "^3.3.3",
69
70
  "marked": "^18.0.6"
70
71
  },
@@ -4,7 +4,6 @@ description: LLM chat UI component library. Covers all u-* custom elements for b
4
4
  license: MIT
5
5
  metadata:
6
6
  author: iyulab
7
- version: "0.7.0"
8
7
  ---
9
8
 
10
9
  # @iyulab/chat-components