@aleph-alpha/chat-kit 6.3.0 → 6.4.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.
Files changed (73) hide show
  1. package/dist/{CkHistory.vue_vue_type_script_setup_true_lang-gV-lp0ZB.js → CkHistory.vue_vue_type_script_setup_true_lang-BvRIp3m6.js} +79 -16
  2. package/dist/adapters/responses-api.js +1 -1
  3. package/dist/chat-kit.css +81 -11
  4. package/dist/{code-palette-DAJUTnR-.js → code-palette-BWrZDi47.js} +156 -119
  5. package/dist/components/base/CkCodeEditor/CkCodeEditor.stories.d.ts +8 -1
  6. package/dist/components/base/CkCodeEditor/CkCodeEditor.stories.d.ts.map +1 -1
  7. package/dist/components/base/CkCodeEditor/CkCodeEditor.vue.d.ts +2 -0
  8. package/dist/components/base/CkCodeEditor/CkCodeEditor.vue.d.ts.map +1 -1
  9. package/dist/components/base/CkCodeEditor/badgeDecoration.d.ts +47 -0
  10. package/dist/components/base/CkCodeEditor/badgeDecoration.d.ts.map +1 -0
  11. package/dist/components/base/CkCodeEditor/createCodeMirror.d.ts +19 -1
  12. package/dist/components/base/CkCodeEditor/createCodeMirror.d.ts.map +1 -1
  13. package/dist/components/base/CkCodeEditor/types.d.ts +32 -0
  14. package/dist/components/base/CkCodeEditor/types.d.ts.map +1 -1
  15. package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.d.ts +7 -0
  16. package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.d.ts.map +1 -1
  17. package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue.d.ts +9 -0
  18. package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue.d.ts.map +1 -1
  19. package/dist/components/base/CkMarkdownRenderer/types.d.ts +13 -0
  20. package/dist/components/base/CkMarkdownRenderer/types.d.ts.map +1 -1
  21. package/dist/components/index.js +1 -1
  22. package/dist/composables/index.js +1 -1
  23. package/dist/createCodeMirror-BO-TWTzn.js +187 -0
  24. package/dist/{createCrepeEditor-Ci5FHHIV.js → createCrepeEditor-BGSlwmKn.js} +4 -4
  25. package/dist/handlers/index.js +2 -2
  26. package/dist/helpers/codemirror/theme.d.ts.map +1 -1
  27. package/dist/helpers/unified/remarkBreaks.d.ts +15 -0
  28. package/dist/helpers/unified/remarkBreaks.d.ts.map +1 -0
  29. package/dist/{index-w2yzH7vs.js → index--Yonjzfi.js} +3 -3
  30. package/dist/{index-CN8d3yl1.js → index-2YPxXIaf.js} +1 -1
  31. package/dist/{index-BoUJGvvQ.js → index-B4uqe-fL.js} +2 -2
  32. package/dist/{index-gYt3E3Cp.js → index-Bfo4U-Al.js} +2 -2
  33. package/dist/{index-BtY1uxn6.js → index-Bw39pbRL.js} +3 -3
  34. package/dist/{index-Dl24CCB3.js → index-CGEgwupi.js} +4 -4
  35. package/dist/{index-MfXW4ZyN.js → index-CZmdzLaU.js} +3 -3
  36. package/dist/{index-DgCcFC3N.js → index-CeaT_FBl.js} +3 -3
  37. package/dist/{index-BhvbqYsK.js → index-CefLTKmi.js} +2 -2
  38. package/dist/{index-CLdXUpL8.js → index-CfVHzirA.js} +5 -5
  39. package/dist/{index-BUCqcTPA.js → index-CrBanggA.js} +2 -2
  40. package/dist/{index-DufAP1JF.js → index-Cx5ThXzs.js} +3 -3
  41. package/dist/{index-CZFx44C7.js → index-D0DQjdsq.js} +2 -2
  42. package/dist/{index-DqGDenO9.js → index-DH9e_hqJ.js} +2 -2
  43. package/dist/{index-BvG6l44n.js → index-DTomeh-p.js} +3 -3
  44. package/dist/{index-ZHg2R9iD.js → index-DZGfsazg.js} +3 -3
  45. package/dist/{index-BLVAx_f8.js → index-DlLnTKv3.js} +2 -2
  46. package/dist/{index-Cxs6kPho.js → index-DqUiBDRo.js} +3 -3
  47. package/dist/{index-DhwsowEf.js → index-GDUM7K5V.js} +2 -2
  48. package/dist/{index-CB6xZVsf.js → index-Hro6EPZS.js} +2 -2
  49. package/dist/{index-D6ftdiLa.js → index-KgumaL1c.js} +1 -1
  50. package/dist/{index-CIF93PZF.js → index-TemHfU1M.js} +3 -3
  51. package/dist/{index-CYk7AB8M.js → index-g_Bs6dNr.js} +4 -4
  52. package/dist/{index-B2tew8uf.js → index-oO_X5wU0.js} +3 -3
  53. package/dist/{index-DxTzaHLr.js → index-ptbBQ53d.js} +4 -4
  54. package/dist/index.js +5 -5
  55. package/dist/{markdownToPlainText-BOtlQ_BY.js → markdownToPlainText-DN_G-I6g.js} +1 -1
  56. package/dist/{useChatKitLabels-CatQSpfL.js → useChatKitLabels-DxW0N5U-.js} +1 -1
  57. package/dist/{useMessageHandler-nnsort0-.js → useMessageHandler-Bkzrdgfj.js} +1 -1
  58. package/package.json +3 -3
  59. package/src/components/base/CkCodeEditor/CkCodeEditor.spec.ts +161 -1
  60. package/src/components/base/CkCodeEditor/CkCodeEditor.stories.ts +97 -1
  61. package/src/components/base/CkCodeEditor/CkCodeEditor.vue +135 -12
  62. package/src/components/base/CkCodeEditor/badgeDecoration.ts +173 -0
  63. package/src/components/base/CkCodeEditor/createCodeMirror.ts +54 -8
  64. package/src/components/base/CkCodeEditor/types.ts +38 -0
  65. package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.spec.ts +40 -0
  66. package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.ts +31 -0
  67. package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue +3 -0
  68. package/src/components/base/CkMarkdownRenderer/types.ts +13 -0
  69. package/src/components/base/CkMilkdownEditor/milkdown-theme.css +6 -3
  70. package/src/helpers/codemirror/code-palette.css +23 -3
  71. package/src/helpers/codemirror/theme.ts +44 -8
  72. package/src/helpers/unified/remarkBreaks.ts +32 -0
  73. package/dist/createCodeMirror-BkV6FEPn.js +0 -101
@@ -19273,7 +19273,7 @@ function legacy(parser) {
19273
19273
  return new LanguageSupport(StreamLanguage.define(parser));
19274
19274
  }
19275
19275
  function sql(dialectName) {
19276
- return import("./index-ZHg2R9iD.js").then((m) => m.sql({ dialect: m[dialectName] }));
19276
+ return import("./index-DZGfsazg.js").then((m) => m.sql({ dialect: m[dialectName] }));
19277
19277
  }
19278
19278
  const languages = [
19279
19279
  // New-style language modes
@@ -19281,7 +19281,7 @@ const languages = [
19281
19281
  name: "C",
19282
19282
  extensions: ["c", "h", "ino"],
19283
19283
  load() {
19284
- return import("./index-BoUJGvvQ.js").then((m) => m.cpp());
19284
+ return import("./index-B4uqe-fL.js").then((m) => m.cpp());
19285
19285
  }
19286
19286
  }),
19287
19287
  /* @__PURE__ */ LanguageDescription.of({
@@ -19289,7 +19289,7 @@ const languages = [
19289
19289
  alias: ["cpp"],
19290
19290
  extensions: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"],
19291
19291
  load() {
19292
- return import("./index-BoUJGvvQ.js").then((m) => m.cpp());
19292
+ return import("./index-B4uqe-fL.js").then((m) => m.cpp());
19293
19293
  }
19294
19294
  }),
19295
19295
  /* @__PURE__ */ LanguageDescription.of({
@@ -19304,14 +19304,14 @@ const languages = [
19304
19304
  name: "CSS",
19305
19305
  extensions: ["css"],
19306
19306
  load() {
19307
- return import("./index-BhvbqYsK.js").then((m) => m.css());
19307
+ return import("./index-CefLTKmi.js").then((m) => m.css());
19308
19308
  }
19309
19309
  }),
19310
19310
  /* @__PURE__ */ LanguageDescription.of({
19311
19311
  name: "Go",
19312
19312
  extensions: ["go"],
19313
19313
  load() {
19314
- return import("./index-BtY1uxn6.js").then((m) => m.go());
19314
+ return import("./index-Bw39pbRL.js").then((m) => m.go());
19315
19315
  }
19316
19316
  }),
19317
19317
  /* @__PURE__ */ LanguageDescription.of({
@@ -19319,14 +19319,14 @@ const languages = [
19319
19319
  alias: ["xhtml"],
19320
19320
  extensions: ["html", "htm", "handlebars", "hbs"],
19321
19321
  load() {
19322
- return import("./index-DxTzaHLr.js").then((m) => m.html());
19322
+ return import("./index-ptbBQ53d.js").then((m) => m.html());
19323
19323
  }
19324
19324
  }),
19325
19325
  /* @__PURE__ */ LanguageDescription.of({
19326
19326
  name: "Java",
19327
19327
  extensions: ["java"],
19328
19328
  load() {
19329
- return import("./index-gYt3E3Cp.js").then((m) => m.java());
19329
+ return import("./index-Bfo4U-Al.js").then((m) => m.java());
19330
19330
  }
19331
19331
  }),
19332
19332
  /* @__PURE__ */ LanguageDescription.of({
@@ -19334,14 +19334,14 @@ const languages = [
19334
19334
  alias: ["ecmascript", "js", "node"],
19335
19335
  extensions: ["js", "mjs", "cjs"],
19336
19336
  load() {
19337
- return import("./index-DufAP1JF.js").then((m) => m.javascript());
19337
+ return import("./index-Cx5ThXzs.js").then((m) => m.javascript());
19338
19338
  }
19339
19339
  }),
19340
19340
  /* @__PURE__ */ LanguageDescription.of({
19341
19341
  name: "Jinja",
19342
19342
  extensions: ["j2", "jinja", "jinja2"],
19343
19343
  load() {
19344
- return import("./index-w2yzH7vs.js").then((m) => m.jinja());
19344
+ return import("./index--Yonjzfi.js").then((m) => m.jinja());
19345
19345
  }
19346
19346
  }),
19347
19347
  /* @__PURE__ */ LanguageDescription.of({
@@ -19349,28 +19349,28 @@ const languages = [
19349
19349
  alias: ["json5"],
19350
19350
  extensions: ["json", "map"],
19351
19351
  load() {
19352
- return import("./index-CB6xZVsf.js").then((m) => m.json());
19352
+ return import("./index-Hro6EPZS.js").then((m) => m.json());
19353
19353
  }
19354
19354
  }),
19355
19355
  /* @__PURE__ */ LanguageDescription.of({
19356
19356
  name: "JSX",
19357
19357
  extensions: ["jsx"],
19358
19358
  load() {
19359
- return import("./index-DufAP1JF.js").then((m) => m.javascript({ jsx: true }));
19359
+ return import("./index-Cx5ThXzs.js").then((m) => m.javascript({ jsx: true }));
19360
19360
  }
19361
19361
  }),
19362
19362
  /* @__PURE__ */ LanguageDescription.of({
19363
19363
  name: "LESS",
19364
19364
  extensions: ["less"],
19365
19365
  load() {
19366
- return import("./index-CIF93PZF.js").then((m) => m.less());
19366
+ return import("./index-TemHfU1M.js").then((m) => m.less());
19367
19367
  }
19368
19368
  }),
19369
19369
  /* @__PURE__ */ LanguageDescription.of({
19370
19370
  name: "Liquid",
19371
19371
  extensions: ["liquid"],
19372
19372
  load() {
19373
- return import("./index-B2tew8uf.js").then((m) => m.liquid());
19373
+ return import("./index-oO_X5wU0.js").then((m) => m.liquid());
19374
19374
  }
19375
19375
  }),
19376
19376
  /* @__PURE__ */ LanguageDescription.of({
@@ -19383,7 +19383,7 @@ const languages = [
19383
19383
  name: "Markdown",
19384
19384
  extensions: ["md", "markdown", "mkd"],
19385
19385
  load() {
19386
- return import("./index-BvG6l44n.js").then((m) => m.markdown());
19386
+ return import("./index-DTomeh-p.js").then((m) => m.markdown());
19387
19387
  }
19388
19388
  }),
19389
19389
  /* @__PURE__ */ LanguageDescription.of({
@@ -19402,7 +19402,7 @@ const languages = [
19402
19402
  name: "PHP",
19403
19403
  extensions: ["php", "php3", "php4", "php5", "php7", "phtml"],
19404
19404
  load() {
19405
- return import("./index-DgCcFC3N.js").then((m) => m.php());
19405
+ return import("./index-CeaT_FBl.js").then((m) => m.php());
19406
19406
  }
19407
19407
  }),
19408
19408
  /* @__PURE__ */ LanguageDescription.of({
@@ -19423,28 +19423,28 @@ const languages = [
19423
19423
  extensions: ["BUILD", "bzl", "py", "pyw"],
19424
19424
  filename: /^(BUCK|BUILD)$/,
19425
19425
  load() {
19426
- return import("./index-MfXW4ZyN.js").then((m) => m.python());
19426
+ return import("./index-CZmdzLaU.js").then((m) => m.python());
19427
19427
  }
19428
19428
  }),
19429
19429
  /* @__PURE__ */ LanguageDescription.of({
19430
19430
  name: "Rust",
19431
19431
  extensions: ["rs"],
19432
19432
  load() {
19433
- return import("./index-DhwsowEf.js").then((m) => m.rust());
19433
+ return import("./index-GDUM7K5V.js").then((m) => m.rust());
19434
19434
  }
19435
19435
  }),
19436
19436
  /* @__PURE__ */ LanguageDescription.of({
19437
19437
  name: "Sass",
19438
19438
  extensions: ["sass"],
19439
19439
  load() {
19440
- return import("./index-Cxs6kPho.js").then((m) => m.sass({ indented: true }));
19440
+ return import("./index-DqUiBDRo.js").then((m) => m.sass({ indented: true }));
19441
19441
  }
19442
19442
  }),
19443
19443
  /* @__PURE__ */ LanguageDescription.of({
19444
19444
  name: "SCSS",
19445
19445
  extensions: ["scss"],
19446
19446
  load() {
19447
- return import("./index-Cxs6kPho.js").then((m) => m.sass());
19447
+ return import("./index-DqUiBDRo.js").then((m) => m.sass());
19448
19448
  }
19449
19449
  }),
19450
19450
  /* @__PURE__ */ LanguageDescription.of({
@@ -19464,7 +19464,7 @@ const languages = [
19464
19464
  name: "TSX",
19465
19465
  extensions: ["tsx"],
19466
19466
  load() {
19467
- return import("./index-DufAP1JF.js").then((m) => m.javascript({ jsx: true, typescript: true }));
19467
+ return import("./index-Cx5ThXzs.js").then((m) => m.javascript({ jsx: true, typescript: true }));
19468
19468
  }
19469
19469
  }),
19470
19470
  /* @__PURE__ */ LanguageDescription.of({
@@ -19472,14 +19472,14 @@ const languages = [
19472
19472
  alias: ["ts"],
19473
19473
  extensions: ["ts", "mts", "cts"],
19474
19474
  load() {
19475
- return import("./index-DufAP1JF.js").then((m) => m.javascript({ typescript: true }));
19475
+ return import("./index-Cx5ThXzs.js").then((m) => m.javascript({ typescript: true }));
19476
19476
  }
19477
19477
  }),
19478
19478
  /* @__PURE__ */ LanguageDescription.of({
19479
19479
  name: "WebAssembly",
19480
19480
  extensions: ["wat", "wast"],
19481
19481
  load() {
19482
- return import("./index-BLVAx_f8.js").then((m) => m.wast());
19482
+ return import("./index-DlLnTKv3.js").then((m) => m.wast());
19483
19483
  }
19484
19484
  }),
19485
19485
  /* @__PURE__ */ LanguageDescription.of({
@@ -19487,7 +19487,7 @@ const languages = [
19487
19487
  alias: ["rss", "wsdl", "xsd"],
19488
19488
  extensions: ["xml", "xsl", "xsd", "svg"],
19489
19489
  load() {
19490
- return import("./index-BUCqcTPA.js").then((m) => m.xml());
19490
+ return import("./index-CrBanggA.js").then((m) => m.xml());
19491
19491
  }
19492
19492
  }),
19493
19493
  /* @__PURE__ */ LanguageDescription.of({
@@ -19495,7 +19495,7 @@ const languages = [
19495
19495
  alias: ["yml"],
19496
19496
  extensions: ["yaml", "yml"],
19497
19497
  load() {
19498
- return import("./index-DqGDenO9.js").then((m) => m.yaml());
19498
+ return import("./index-DH9e_hqJ.js").then((m) => m.yaml());
19499
19499
  }
19500
19500
  }),
19501
19501
  // Legacy modes ported from CodeMirror 5
@@ -20284,13 +20284,13 @@ const languages = [
20284
20284
  name: "Vue",
20285
20285
  extensions: ["vue"],
20286
20286
  load() {
20287
- return import("./index-Dl24CCB3.js").then((m) => m.vue());
20287
+ return import("./index-CGEgwupi.js").then((m) => m.vue());
20288
20288
  }
20289
20289
  }),
20290
20290
  /* @__PURE__ */ LanguageDescription.of({
20291
20291
  name: "Angular Template",
20292
20292
  load() {
20293
- return import("./index-CYk7AB8M.js").then((m) => m.angular());
20293
+ return import("./index-g_Bs6dNr.js").then((m) => m.angular());
20294
20294
  }
20295
20295
  })
20296
20296
  ];
@@ -21398,12 +21398,22 @@ const ckHighlightStyle = HighlightStyle.define([
21398
21398
  tags.definitionKeyword,
21399
21399
  tags.moduleKeyword,
21400
21400
  tags.operatorKeyword,
21401
- tags.operator
21401
+ tags.operator,
21402
+ // CSS units (`px`, `rem`) are `keyword.other.unit` to a TextMate grammar.
21403
+ tags.unit
21402
21404
  ],
21403
21405
  color: cssVar("keyword")
21404
21406
  },
21405
21407
  {
21406
- tag: [tags.string, tags.special(tags.string), tags.regexp, tags.escape, tags.character],
21408
+ tag: [
21409
+ tags.string,
21410
+ tags.special(tags.string),
21411
+ tags.regexp,
21412
+ tags.escape,
21413
+ tags.character,
21414
+ // `class="card"` — the quoted value is a string, not a constant.
21415
+ tags.attributeValue
21416
+ ],
21407
21417
  color: cssVar("string")
21408
21418
  },
21409
21419
  {
@@ -21419,7 +21429,8 @@ const ckHighlightStyle = HighlightStyle.define([
21419
21429
  tags.definition(tags.typeName),
21420
21430
  tags.className,
21421
21431
  tags.namespace,
21422
- tags.self
21432
+ // `entity.other.attribute-name`, which GitHub colours like any entity.
21433
+ tags.attributeName
21423
21434
  ],
21424
21435
  color: cssVar("function")
21425
21436
  },
@@ -21436,19 +21447,35 @@ const ckHighlightStyle = HighlightStyle.define([
21436
21447
  tags.typeName,
21437
21448
  tags.standard(tags.typeName),
21438
21449
  tags.propertyName,
21439
- tags.attributeName,
21440
- tags.attributeValue
21450
+ // `this` / `self` are `variable.language`, which GitHub paints blue.
21451
+ tags.self,
21452
+ // CSS colour literals (`#ff0066`), `constant.other.color-*`.
21453
+ tags.color,
21454
+ // Bare identifiers a grammar cannot classify further — SQL column and
21455
+ // table names, for one. Every more specific name tag has its own rule
21456
+ // above, so this only catches what would otherwise be unstyled.
21457
+ tags.name
21441
21458
  ],
21442
21459
  color: cssVar("constant")
21443
21460
  },
21444
21461
  // A declared property name, which UiCodeBlock renders in the text token.
21445
21462
  { tag: tags.definition(tags.propertyName), color: cssVar("property") },
21446
- { tag: [tags.tagName, tags.angleBracket], color: cssVar("tag") },
21463
+ { tag: tags.tagName, color: cssVar("tag") },
21464
+ // Markdown blockquotes are `markup.quote`, the same green as a tag name.
21465
+ { tag: tags.quote, color: cssVar("tag") },
21447
21466
  {
21448
- tag: [tags.variableName, tags.punctuation, tags.bracket, tags.separator],
21467
+ tag: [
21468
+ tags.variableName,
21469
+ tags.punctuation,
21470
+ tags.bracket,
21471
+ tags.separator,
21472
+ // `<`, `>` and `</` are plain text in the GitHub themes; only the tag
21473
+ // name inside them is green.
21474
+ tags.angleBracket
21475
+ ],
21449
21476
  color: cssVar("foreground")
21450
21477
  },
21451
- { tag: tags.heading, fontWeight: "bold" },
21478
+ { tag: tags.heading, color: cssVar("constant"), fontWeight: "bold" },
21452
21479
  { tag: tags.strong, fontWeight: "bold" },
21453
21480
  { tag: tags.emphasis, fontStyle: "italic" },
21454
21481
  { tag: tags.link, textDecoration: "underline" },
@@ -21478,7 +21505,16 @@ const ckCodeMirrorTheme = [
21478
21505
  ".cm-gutters": {
21479
21506
  backgroundColor: "transparent",
21480
21507
  borderRight: "none",
21481
- color: cssVar("comment")
21508
+ color: cssVar("line-number")
21509
+ },
21510
+ // `UiCodeBlock` draws its numbers as a 2rem right-aligned column inside the
21511
+ // block's 1rem padding, with a 1rem gap before the code. CodeMirror puts
21512
+ // the gutter outside `.cm-content`, so the same geometry is expressed as
21513
+ // padding on the number cell.
21514
+ ".cm-lineNumbers .cm-gutterElement": {
21515
+ minWidth: "4rem",
21516
+ padding: "0 1rem",
21517
+ textAlign: "right"
21482
21518
  },
21483
21519
  ".cm-activeLineGutter": {
21484
21520
  backgroundColor: "transparent"
@@ -21503,96 +21539,97 @@ const ckCodeMirrorTheme = [
21503
21539
  syntaxHighlighting(ckHighlightStyle)
21504
21540
  ];
21505
21541
  export {
21506
- NodeSet as $,
21507
- foldInside as A,
21508
- Text as B,
21509
- Compartment as C,
21510
- codePointAt as D,
21542
+ highlightActiveLine as $,
21543
+ Annotation as A,
21544
+ DefaultBufferLength as B,
21545
+ CharCategory as C,
21546
+ Decoration as D,
21511
21547
  EditorView as E,
21512
- Annotation as F,
21513
- Decoration as G,
21514
- StateField as H,
21515
- codePointSize as I,
21516
- showTooltip as J,
21517
- logException as K,
21548
+ Facet as F,
21549
+ NodeProp as G,
21550
+ Tree as H,
21551
+ IterMode as I,
21552
+ MatchDecorator as J,
21553
+ EditorState as K,
21518
21554
  LRLanguage as L,
21519
- getTooltip as M,
21520
- Facet as N,
21521
- combineConfig as O,
21555
+ MapMode as M,
21556
+ NodeSet as N,
21557
+ Compartment as O,
21522
21558
  Prec as P,
21523
- fromCodePoint as Q,
21559
+ lineNumbers as Q,
21524
21560
  RangeSet as R,
21525
21561
  StateEffect as S,
21526
21562
  Transaction as T,
21527
- MapMode as U,
21563
+ languages as U,
21528
21564
  ViewPlugin as V,
21529
21565
  WidgetType as W,
21530
- RangeValue as X,
21531
- Direction as Y,
21532
- CharCategory as Z,
21533
- Parser as _,
21534
- EditorState as a,
21535
- NodeType as a0,
21536
- DefaultBufferLength as a1,
21537
- NodeProp as a2,
21538
- Tree as a3,
21539
- IterMode as a4,
21540
- flatIndent as a5,
21541
- NodeWeakMap as a6,
21542
- Tag as a7,
21543
- countColumn as a8,
21544
- Language as a9,
21545
- crosshairCursor as aA,
21546
- foldKeymap as aB,
21547
- foldService as aa,
21548
- defineLanguageFacet as ab,
21549
- languageDataProp as ac,
21550
- LanguageDescription as ad,
21551
- ParseContext as ae,
21552
- bracketMatchingHandle as af,
21553
- sublanguageProp as ag,
21554
- syntaxHighlighting as ah,
21555
- HighlightStyle as ai,
21556
- keyName as aj,
21557
- base as ak,
21558
- getPanel as al,
21559
- getDialog as am,
21560
- showDialog as an,
21561
- showPanel as ao,
21562
- RangeSetBuilder as ap,
21563
- crelt as aq,
21564
- runScopeHandlers as ar,
21565
- findClusterBreak as as,
21566
- activateHover as at,
21567
- hoverTooltip as au,
21568
- highlightActiveLineGutter as av,
21569
- foldGutter as aw,
21570
- dropCursor as ax,
21571
- defaultHighlightStyle as ay,
21572
- rectangularSelection as az,
21573
- languages as b,
21574
- ckCodeMirrorTheme as c,
21575
- drawSelection as d,
21576
- highlightSpecialChars as e,
21577
- highlightActiveLine as f,
21578
- bracketMatching as g,
21579
- history as h,
21580
- indentOnInput as i,
21581
- indentUnit as j,
21582
- keymap as k,
21583
- lineNumbers as l,
21584
- defaultKeymap as m,
21585
- historyKeymap as n,
21586
- indentWithTab as o,
21587
- placeholder as p,
21588
- LanguageSupport as q,
21589
- indentNodeProp as r,
21590
- continuedIndent as s,
21591
- foldNodeProp as t,
21592
- styleTags as u,
21593
- tags as v,
21594
- syntaxTree as w,
21595
- EditorSelection as x,
21596
- parseMixed as y,
21597
- delimitedIndent as z
21566
+ ckCodeMirrorTheme as X,
21567
+ history as Y,
21568
+ drawSelection as Z,
21569
+ highlightSpecialChars as _,
21570
+ LanguageSupport as a,
21571
+ bracketMatching as a0,
21572
+ indentOnInput as a1,
21573
+ defaultKeymap as a2,
21574
+ historyKeymap as a3,
21575
+ indentWithTab as a4,
21576
+ placeholder as a5,
21577
+ flatIndent as a6,
21578
+ NodeWeakMap as a7,
21579
+ Tag as a8,
21580
+ countColumn as a9,
21581
+ rectangularSelection as aA,
21582
+ crosshairCursor as aB,
21583
+ foldKeymap as aC,
21584
+ Language as aa,
21585
+ foldService as ab,
21586
+ defineLanguageFacet as ac,
21587
+ languageDataProp as ad,
21588
+ LanguageDescription as ae,
21589
+ ParseContext as af,
21590
+ bracketMatchingHandle as ag,
21591
+ sublanguageProp as ah,
21592
+ syntaxHighlighting as ai,
21593
+ HighlightStyle as aj,
21594
+ keyName as ak,
21595
+ base as al,
21596
+ getPanel as am,
21597
+ getDialog as an,
21598
+ showDialog as ao,
21599
+ showPanel as ap,
21600
+ RangeSetBuilder as aq,
21601
+ crelt as ar,
21602
+ runScopeHandlers as as,
21603
+ findClusterBreak as at,
21604
+ activateHover as au,
21605
+ hoverTooltip as av,
21606
+ highlightActiveLineGutter as aw,
21607
+ foldGutter as ax,
21608
+ dropCursor as ay,
21609
+ defaultHighlightStyle as az,
21610
+ syntaxTree as b,
21611
+ continuedIndent as c,
21612
+ EditorSelection as d,
21613
+ delimitedIndent as e,
21614
+ foldNodeProp as f,
21615
+ foldInside as g,
21616
+ Text as h,
21617
+ indentNodeProp as i,
21618
+ codePointAt as j,
21619
+ indentUnit as k,
21620
+ StateField as l,
21621
+ keymap as m,
21622
+ codePointSize as n,
21623
+ showTooltip as o,
21624
+ parseMixed as p,
21625
+ logException as q,
21626
+ getTooltip as r,
21627
+ styleTags as s,
21628
+ tags as t,
21629
+ combineConfig as u,
21630
+ fromCodePoint as v,
21631
+ RangeValue as w,
21632
+ Direction as x,
21633
+ Parser as y,
21634
+ NodeType as z
21598
21635
  };
@@ -31,9 +31,16 @@ export declare const Readonly: Story;
31
31
  export declare const WithoutHeader: Story;
32
32
  /**
33
33
  * `maxHeight` caps the scrollable area and `lineWrapping` folds long lines
34
- * instead of scrolling sideways.
34
+ * instead of scrolling sideways. Scroll it: the code fades at whichever edge
35
+ * has more of the document beyond it, and neither edge fades once you reach it.
35
36
  */
36
37
  export declare const ScrollingAndWrapping: Story;
38
+ /**
39
+ * `badge` draws matched references as inline pills, the way a mention renders in
40
+ * prose. The document still holds the raw `@collection:…` text, so `getCode()`
41
+ * and copy give the real reference; a pill deletes as one unit.
42
+ */
43
+ export declare const WithBadges: Story;
37
44
  /**
38
45
  * Parity check: the editor on the left, the same snippet rendered through
39
46
  * `CkMarkdownRenderer` and `UiCodeBlock` on the right. Border, radius, header,
@@ -1 +1 @@
1
- {"version":3,"file":"CkCodeEditor.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCodeEditor/CkCodeEditor.stories.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAG9C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAiCnC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAiInC;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,KAW1B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,KAevB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAOtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAO3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAsBlC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAwBhC,CAAC"}
1
+ {"version":3,"file":"CkCodeEditor.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCodeEditor/CkCodeEditor.stories.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,YAAY,MAAM,oBAAoB,CAAC;AA6B9C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAgDnC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAgKnC;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,KAW1B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,KAevB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAOtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAO3B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAsBlC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,KAgBxB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAwBhC,CAAC"}
@@ -33,6 +33,8 @@ declare const __VLS_export: import("vue").DefineComponent<CkCodeEditorProps, {
33
33
  showCopyButton: boolean;
34
34
  lineWrapping: boolean;
35
35
  maxHeight: string;
36
+ scrollFade: boolean;
37
+ badge: import("./badgeDecoration").CkCodeEditorBadgeRule;
36
38
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
37
39
  declare const _default: typeof __VLS_export;
38
40
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"CkCodeEditor.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCodeEditor/CkCodeEditor.vue"],"names":[],"mappings":"AA4PA,OAAO,KAAK,EAAqB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AA2JpE,iBAAS,KAAK,IAAI,IAAI,CAErB;AAED,iBAAS,OAAO,IAAI,MAAM,CAEzB;AAsJD,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAKhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"CkCodeEditor.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCodeEditor/CkCodeEditor.vue"],"names":[],"mappings":"AAwXA,OAAO,KAAK,EAAqB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAgOpE,iBAAS,KAAK,IAAI,IAAI,CAErB;AAED,iBAAS,OAAO,IAAI,MAAM,CAEzB;AAmLD,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAKhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,47 @@
1
+ import type { Extension, Range } from '@codemirror/state';
2
+ import { Decoration } from '@codemirror/view';
3
+ /** What a matched reference should look like once it is drawn as a pill. */
4
+ export interface CkCodeEditorBadgeContent {
5
+ /** Text inside the pill. */
6
+ label: string;
7
+ /**
8
+ * Optional inline SVG markup for a leading icon, sized to 12px. This is
9
+ * developer-supplied configuration rather than document content, and it is
10
+ * sanitised before it reaches the DOM.
11
+ */
12
+ icon?: string;
13
+ /** Native tooltip, useful for showing the underlying reference. */
14
+ title?: string;
15
+ /**
16
+ * Classes replacing the default pill styling, which is the secondary badge
17
+ * the ChatKit design file specifies.
18
+ */
19
+ class?: string;
20
+ }
21
+ /** Rule turning matched text in the document into inline pills. */
22
+ export interface CkCodeEditorBadgeRule {
23
+ /**
24
+ * Pattern matched within each line. A non-global pattern is promoted to a
25
+ * global one, and matching never crosses a line break.
26
+ */
27
+ pattern: RegExp;
28
+ /**
29
+ * Maps a match to its pill, or returns `null` to leave that occurrence as
30
+ * ordinary text. The match array carries any capture groups.
31
+ */
32
+ render: (match: RegExpExecArray) => CkCodeEditorBadgeContent | null;
33
+ }
34
+ /**
35
+ * Draw matched references as inline pills, the way a mention or a chip renders
36
+ * inside prose.
37
+ *
38
+ * The document keeps the original text: the decoration only replaces what is
39
+ * *drawn*, so reading the value, copying and pasting all still yield the raw
40
+ * reference. The matched range is also registered as atomic, so the caret
41
+ * treats a pill as a single unit and backspace removes the whole reference
42
+ * rather than one character of it.
43
+ */
44
+ export declare function badgeExtension(rule: CkCodeEditorBadgeRule): Extension;
45
+ /** Exported for tests: the ranges a rule would decorate in a plain string. */
46
+ export declare function matchBadgeRanges(rule: CkCodeEditorBadgeRule, text: string): Range<Decoration>[];
47
+ //# sourceMappingURL=badgeDecoration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badgeDecoration.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCodeEditor/badgeDecoration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,UAAU,EAOX,MAAM,kBAAkB,CAAC;AAG1B,4EAA4E;AAC5E,MAAM,WAAW,wBAAwB;IACvC,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,mEAAmE;AACnE,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,wBAAwB,GAAG,IAAI,CAAC;CACrE;AAgED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,qBAAqB,GAAG,SAAS,CA+BrE;AAED,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,qBAAqB,EAC3B,IAAI,EAAE,MAAM,GACX,KAAK,CAAC,UAAU,CAAC,EAAE,CAkBrB"}
@@ -1,5 +1,6 @@
1
1
  import { type LanguageSupport } from '@codemirror/language';
2
2
  import { EditorView } from '@codemirror/view';
3
+ import { type CkCodeEditorBadgeRule } from './badgeDecoration';
3
4
  import '../../../helpers/codemirror/code-palette.css';
4
5
  export interface CreateCodeMirrorOptions {
5
6
  /** Element the view is mounted into. */
@@ -11,10 +12,16 @@ export interface CreateCodeMirrorOptions {
11
12
  readonly: boolean;
12
13
  showLineNumbers: boolean;
13
14
  lineWrapping: boolean;
15
+ /** Draws matched references as inline pills; see `badgeDecoration.ts`. */
16
+ badge?: CkCodeEditorBadgeRule;
14
17
  /** Called synchronously whenever the document changes. */
15
18
  onChange: (value: string) => void;
19
+ /**
20
+ * Called when the editing area takes focus. There is deliberately no `onBlur`
21
+ * counterpart: losing focus to the header's copy button is not leaving the
22
+ * editor, and only the component around this view can tell the difference.
23
+ */
16
24
  onFocus: () => void;
17
- onBlur: () => void;
18
25
  }
19
26
  /** Imperative surface `CkCodeEditor` drives; keeps CodeMirror out of the SFC. */
20
27
  export interface CodeMirrorHandle {
@@ -26,6 +33,7 @@ export interface CodeMirrorHandle {
26
33
  setReadonly: (readonly: boolean) => void;
27
34
  setShowLineNumbers: (show: boolean) => void;
28
35
  setLineWrapping: (wrap: boolean) => void;
36
+ setBadge: (rule: CkCodeEditorBadgeRule | undefined) => void;
29
37
  focus: () => void;
30
38
  destroy: () => void;
31
39
  }
@@ -36,6 +44,16 @@ export interface CodeMirrorHandle {
36
44
  * unhighlighted code instead of throwing.
37
45
  */
38
46
  export declare function resolveLanguage(language: string): Promise<LanguageSupport | null>;
47
+ /**
48
+ * Pick the line ending a document already uses.
49
+ *
50
+ * CodeMirror splits on `\n`, `\r\n` and `\r` alike, but `doc.toString()` always
51
+ * joins with `\n`. Left alone, opening a file with Windows line endings and
52
+ * typing one character would silently rewrite every line ending in it. Telling
53
+ * the editor which separator this document uses keeps it intact, both when
54
+ * reading the value back and when the user presses Enter.
55
+ */
56
+ export declare function detectLineSeparator(doc: string): string;
39
57
  /**
40
58
  * Build a CodeMirror view themed like `UiCodeBlock`. Loaded lazily by
41
59
  * `CkCodeEditor` so CodeMirror stays out of the package's main chunk.
@@ -1 +1 @@
1
- {"version":3,"file":"createCodeMirror.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCodeEditor/createCodeMirror.ts"],"names":[],"mappings":"AAMA,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,UAAU,EAOX,MAAM,kBAAkB,CAAC;AAE1B,OAAO,8CAA8C,CAAC;AAEtD,MAAM,WAAW,uBAAuB;IACtC,wCAAwC;IACxC,MAAM,EAAE,WAAW,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,0DAA0D;IAC1D,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,iFAAiF;AACjF,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,MAAM,MAAM,CAAC;IACtB,0EAA0E;IAC1E,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,kBAAkB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,eAAe,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAKD;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAkBjC;AAuCD;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,gBAAgB,CAAC,CAyD3B"}
1
+ {"version":3,"file":"createCodeMirror.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCodeEditor/createCodeMirror.ts"],"names":[],"mappings":"AAMA,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,UAAU,EAOX,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAkB,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,8CAA8C,CAAC;AAEtD,MAAM,WAAW,uBAAuB;IACtC,wCAAwC;IACxC,MAAM,EAAE,WAAW,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,qBAAqB,CAAC;IAC9B,0DAA0D;IAC1D,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;;OAIG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,iFAAiF;AACjF,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,MAAM,MAAM,CAAC;IACtB,0EAA0E;IAC1E,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,kBAAkB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,eAAe,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,QAAQ,EAAE,CAAC,IAAI,EAAE,qBAAqB,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAKD;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAkBjC;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKvD;AAyCD;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,gBAAgB,CAAC,CA6E3B"}