@aleph-alpha/chat-kit 6.4.0 → 6.4.2
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/dist/{CkHistory.vue_vue_type_script_setup_true_lang-B0WUzTHa.js → CkHistory.vue_vue_type_script_setup_true_lang-wu1Zrvgc.js} +76 -14
- package/dist/adapters/responses-api.js +1 -1
- package/dist/chat-kit.css +101 -18
- package/dist/{code-palette-DH_G7mZ5.js → code-palette-BWrZDi47.js} +71 -35
- package/dist/components/base/CkCodeEditor/CkCodeEditor.stories.d.ts +2 -1
- package/dist/components/base/CkCodeEditor/CkCodeEditor.stories.d.ts.map +1 -1
- package/dist/components/base/CkCodeEditor/CkCodeEditor.vue.d.ts +3 -0
- package/dist/components/base/CkCodeEditor/CkCodeEditor.vue.d.ts.map +1 -1
- package/dist/components/base/CkCodeEditor/badgeDecoration.d.ts +2 -2
- package/dist/components/base/CkCodeEditor/createCodeMirror.d.ts +15 -1
- package/dist/components/base/CkCodeEditor/createCodeMirror.d.ts.map +1 -1
- package/dist/components/base/CkCodeEditor/types.d.ts +37 -6
- package/dist/components/base/CkCodeEditor/types.d.ts.map +1 -1
- package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.d.ts +7 -0
- package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.d.ts.map +1 -1
- package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue.d.ts +9 -0
- package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue.d.ts.map +1 -1
- package/dist/components/base/CkMarkdownRenderer/types.d.ts +13 -0
- package/dist/components/base/CkMarkdownRenderer/types.d.ts.map +1 -1
- package/dist/components/base/index.d.ts +1 -1
- package/dist/components/base/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/composables/index.js +1 -1
- package/dist/{createCodeMirror-5iswYetS.js → createCodeMirror-BO-TWTzn.js} +27 -9
- package/dist/{createCrepeEditor-C-AQ1w_e.js → createCrepeEditor-BGSlwmKn.js} +4 -4
- package/dist/handlers/index.js +2 -2
- package/dist/helpers/codemirror/theme.d.ts.map +1 -1
- package/dist/helpers/unified/remarkBreaks.d.ts +15 -0
- package/dist/helpers/unified/remarkBreaks.d.ts.map +1 -0
- package/dist/{index-DLjsqQHx.js → index--Yonjzfi.js} +3 -3
- package/dist/{index-Mh3WUU-6.js → index-2YPxXIaf.js} +1 -1
- package/dist/{index-CWp_t8Wl.js → index-B4uqe-fL.js} +2 -2
- package/dist/{index-hEJ_Bavx.js → index-Bfo4U-Al.js} +2 -2
- package/dist/{index-g2X42srv.js → index-Bw39pbRL.js} +3 -3
- package/dist/{index-CIF4qQzR.js → index-CGEgwupi.js} +4 -4
- package/dist/{index-Dbi75pKH.js → index-CZmdzLaU.js} +3 -3
- package/dist/{index-CR2kGrpY.js → index-CeaT_FBl.js} +3 -3
- package/dist/{index-DfLCrnVq.js → index-CefLTKmi.js} +2 -2
- package/dist/{index-CLdXUpL8.js → index-CfVHzirA.js} +5 -5
- package/dist/{index-D0IZW-Up.js → index-CrBanggA.js} +2 -2
- package/dist/{index-BlIc9r0r.js → index-Cx5ThXzs.js} +3 -3
- package/dist/{index-CZFx44C7.js → index-D0DQjdsq.js} +2 -2
- package/dist/{index-DPgw0Cf_.js → index-DH9e_hqJ.js} +2 -2
- package/dist/{index-hbS5PDHj.js → index-DTomeh-p.js} +3 -3
- package/dist/{index-GpSpJ3ti.js → index-DZGfsazg.js} +3 -3
- package/dist/{index-QAs789O5.js → index-DlLnTKv3.js} +2 -2
- package/dist/{index-ABUMl7H3.js → index-DqUiBDRo.js} +3 -3
- package/dist/{index-CFGO7LRz.js → index-GDUM7K5V.js} +2 -2
- package/dist/{index-Db5-PJG-.js → index-Hro6EPZS.js} +2 -2
- package/dist/{index-CG8e3146.js → index-KgumaL1c.js} +1 -1
- package/dist/{index-XZeturb3.js → index-TemHfU1M.js} +3 -3
- package/dist/{index-DKwEe_Tu.js → index-g_Bs6dNr.js} +4 -4
- package/dist/{index-S4ylc8JK.js → index-oO_X5wU0.js} +3 -3
- package/dist/{index-BqWO6mvz.js → index-ptbBQ53d.js} +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/{markdownToPlainText-BOtlQ_BY.js → markdownToPlainText-DN_G-I6g.js} +1 -1
- package/dist/{useChatKitLabels-CatQSpfL.js → useChatKitLabels-DxW0N5U-.js} +1 -1
- package/dist/{useMessageHandler-nnsort0-.js → useMessageHandler-Bkzrdgfj.js} +1 -1
- package/package.json +1 -1
- package/src/components/base/CkCodeEditor/CkCodeEditor.spec.ts +128 -1
- package/src/components/base/CkCodeEditor/CkCodeEditor.stories.ts +13 -1
- package/src/components/base/CkCodeEditor/CkCodeEditor.vue +156 -19
- package/src/components/base/CkCodeEditor/badgeDecoration.ts +2 -2
- package/src/components/base/CkCodeEditor/createCodeMirror.ts +45 -8
- package/src/components/base/CkCodeEditor/types.ts +42 -6
- package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.spec.ts +40 -0
- package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.ts +31 -0
- package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue +3 -0
- package/src/components/base/CkMarkdownRenderer/types.ts +13 -0
- package/src/components/base/CkMilkdownEditor/milkdown-theme.css +6 -3
- package/src/components/base/index.ts +1 -0
- package/src/components/index.ts +1 -0
- package/src/helpers/codemirror/code-palette.css +23 -3
- package/src/helpers/codemirror/theme.ts +44 -8
- package/src/helpers/unified/remarkBreaks.ts +32 -0
- package/src/index.ts +1 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as generateId } from "./markdownToPlainText-
|
|
1
|
+
import { g as generateId } from "./markdownToPlainText-DN_G-I6g.js";
|
|
2
2
|
import { ref, shallowRef, computed, readonly, toRaw, toValue, watch } from "vue";
|
|
3
|
-
import { u as useMessageHandler } from "./useMessageHandler-
|
|
3
|
+
import { u as useMessageHandler } from "./useMessageHandler-Bkzrdgfj.js";
|
|
4
4
|
import "./katex.min-md74IFlY.js";
|
|
5
5
|
function secondsToDate(seconds) {
|
|
6
6
|
return new Date(seconds * 1e3);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LRParser, E as ExternalTokenizer, C as ContextTracker } from "./index-
|
|
2
|
-
import { s as styleTags, t as tags, a as LanguageSupport, p as parseMixed, L as LRLanguage, i as indentNodeProp, e as delimitedIndent, f as foldNodeProp, g as foldInside } from "./code-palette-
|
|
1
|
+
import { L as LRParser, E as ExternalTokenizer, C as ContextTracker } from "./index-2YPxXIaf.js";
|
|
2
|
+
import { s as styleTags, t as tags, a as LanguageSupport, p as parseMixed, L as LRLanguage, i as indentNodeProp, e as delimitedIndent, f as foldNodeProp, g as foldInside } from "./code-palette-BWrZDi47.js";
|
|
3
3
|
const blockEnd = 63, eof = 64, DirectiveEnd = 1, DocEnd = 2, sequenceStartMark = 3, sequenceContinueMark = 4, explicitMapStartMark = 5, explicitMapContinueMark = 6, flowMapMark = 7, mapStartMark = 65, mapContinueMark = 66, Literal = 8, QuotedLiteral = 9, Anchor = 10, Alias = 11, Tag = 12, BlockLiteralContent = 13, BracketL = 19, FlowSequence = 20, Colon = 29, BraceL = 33, FlowMapping = 34, BlockLiteralHeader = 47;
|
|
4
4
|
const type_Top = 0, type_Seq = 1, type_Map = 2, type_Flow = 3, type_Lit = 4;
|
|
5
5
|
class Context {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { y as Parser, z as NodeType, G as NodeProp, a8 as Tag, N as NodeSet, s as styleTags, H as Tree, p as parseMixed, t as tags, b as syntaxTree, d as EditorSelection, a9 as countColumn, a as LanguageSupport, P as Prec, m as keymap, E as EditorView, aa as Language, k as indentUnit, ab as foldService, ac as defineLanguageFacet, K as EditorState, f as foldNodeProp, i as indentNodeProp, ad as languageDataProp, ae as LanguageDescription, af as ParseContext } from "./code-palette-
|
|
2
|
-
import { C as CompletionContext } from "./index-
|
|
3
|
-
import { html, htmlCompletionSource } from "./index-
|
|
1
|
+
import { y as Parser, z as NodeType, G as NodeProp, a8 as Tag, N as NodeSet, s as styleTags, H as Tree, p as parseMixed, t as tags, b as syntaxTree, d as EditorSelection, a9 as countColumn, a as LanguageSupport, P as Prec, m as keymap, E as EditorView, aa as Language, k as indentUnit, ab as foldService, ac as defineLanguageFacet, K as EditorState, f as foldNodeProp, i as indentNodeProp, ad as languageDataProp, ae as LanguageDescription, af as ParseContext } from "./code-palette-BWrZDi47.js";
|
|
2
|
+
import { C as CompletionContext } from "./index-KgumaL1c.js";
|
|
3
|
+
import { html, htmlCompletionSource } from "./index-ptbBQ53d.js";
|
|
4
4
|
class CompositeBlock {
|
|
5
5
|
static create(type, value, from, parentHash, end) {
|
|
6
6
|
let hash = parentHash + (parentHash << 8) + type + (value << 4) | 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { L as LRLanguage, a as LanguageSupport, i as indentNodeProp, c as continuedIndent, f as foldNodeProp, s as styleTags, t as tags, b as syntaxTree } from "./code-palette-
|
|
2
|
-
import { E as ExternalTokenizer, L as LRParser } from "./index-
|
|
3
|
-
import { i as ifNotIn, c as completeFromList } from "./index-
|
|
1
|
+
import { L as LRLanguage, a as LanguageSupport, i as indentNodeProp, c as continuedIndent, f as foldNodeProp, s as styleTags, t as tags, b as syntaxTree } from "./code-palette-BWrZDi47.js";
|
|
2
|
+
import { E as ExternalTokenizer, L as LRParser } from "./index-2YPxXIaf.js";
|
|
3
|
+
import { i as ifNotIn, c as completeFromList } from "./index-KgumaL1c.js";
|
|
4
4
|
const whitespace = 36, LineComment = 1, BlockComment = 2, String$1 = 3, Number = 4, Bool = 5, Null = 6, ParenL = 7, ParenR = 8, BraceL = 9, BraceR = 10, BracketL = 11, BracketR = 12, Semi = 13, Dot = 14, Operator = 15, Punctuation = 16, SpecialVar = 17, Identifier = 18, QuotedIdentifier = 19, Keyword = 20, Type = 21, Bits = 22, Bytes = 23, Builtin = 24;
|
|
5
5
|
function isAlpha(ch) {
|
|
6
6
|
return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 48 && ch <= 57;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as LanguageSupport, L as LRLanguage, i as indentNodeProp, e as delimitedIndent, f as foldNodeProp, g as foldInside, s as styleTags, t as tags } from "./code-palette-
|
|
2
|
-
import { L as LRParser } from "./index-
|
|
1
|
+
import { a as LanguageSupport, L as LRLanguage, i as indentNodeProp, e as delimitedIndent, f as foldNodeProp, g as foldInside, s as styleTags, t as tags } from "./code-palette-BWrZDi47.js";
|
|
2
|
+
import { L as LRParser } from "./index-2YPxXIaf.js";
|
|
3
3
|
const spec_Keyword = { __proto__: null, anyref: 34, dataref: 34, eqref: 34, externref: 34, i31ref: 34, funcref: 34, i8: 34, i16: 34, i32: 34, i64: 34, f32: 34, f64: 34 };
|
|
4
4
|
const parser = /* @__PURE__ */ LRParser.deserialize({
|
|
5
5
|
version: 14,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { L as LRParser, E as ExternalTokenizer, C as ContextTracker } from "./index-
|
|
2
|
-
import { s as styleTags, t as tags, a as LanguageSupport, L as LRLanguage, f as foldNodeProp, g as foldInside, i as indentNodeProp, c as continuedIndent } from "./code-palette-
|
|
3
|
-
import { defineCSSCompletionSource } from "./index-
|
|
1
|
+
import { L as LRParser, E as ExternalTokenizer, C as ContextTracker } from "./index-2YPxXIaf.js";
|
|
2
|
+
import { s as styleTags, t as tags, a as LanguageSupport, L as LRLanguage, f as foldNodeProp, g as foldInside, i as indentNodeProp, c as continuedIndent } from "./code-palette-BWrZDi47.js";
|
|
3
|
+
import { defineCSSCompletionSource } from "./index-CefLTKmi.js";
|
|
4
4
|
const indent = 168, dedent = 169, descendantOp = 170, InterpolationEnd = 1, InterpolationContinue = 2, Unit = 3, callee = 171, identifier = 172, VariableName = 4, queryIdentifier = 173, InterpolationStart = 5, newline = 174, blankLineStart = 175, eof = 176, whitespace = 177, LineComment = 6, Comment = 7, IndentedMixin = 8, IndentedInclude = 9, Dialect_indented = 0;
|
|
5
5
|
const space = [
|
|
6
6
|
9,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LRParser, E as ExternalTokenizer } from "./index-
|
|
2
|
-
import { s as styleTags, t as tags, a as LanguageSupport, L as LRLanguage, i as indentNodeProp, c as continuedIndent, f as foldNodeProp, g as foldInside } from "./code-palette-
|
|
1
|
+
import { L as LRParser, E as ExternalTokenizer } from "./index-2YPxXIaf.js";
|
|
2
|
+
import { s as styleTags, t as tags, a as LanguageSupport, L as LRLanguage, i as indentNodeProp, c as continuedIndent, f as foldNodeProp, g as foldInside } from "./code-palette-BWrZDi47.js";
|
|
3
3
|
const closureParamDelim = 1, tpOpen = 2, tpClose = 3, RawString = 4, Float = 5;
|
|
4
4
|
const _b = 98, _e = 101, _f = 102, _r = 114, _E = 69, Zero = 48, Dot = 46, Plus = 43, Minus = 45, Hash = 35, Quote = 34, Pipe = 124, LessThan = 60, GreaterThan = 62;
|
|
5
5
|
function isNum(ch) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LRParser } from "./index-
|
|
2
|
-
import { s as styleTags, t as tags, a as LanguageSupport, L as LRLanguage, i as indentNodeProp, c as continuedIndent, f as foldNodeProp, g as foldInside } from "./code-palette-
|
|
1
|
+
import { L as LRParser } from "./index-2YPxXIaf.js";
|
|
2
|
+
import { s as styleTags, t as tags, a as LanguageSupport, L as LRLanguage, i as indentNodeProp, c as continuedIndent, f as foldNodeProp, g as foldInside } from "./code-palette-BWrZDi47.js";
|
|
3
3
|
const jsonHighlighting = styleTags({
|
|
4
4
|
String: tags.string,
|
|
5
5
|
Number: tags.number,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as syntaxTree, T as Transaction, h as Text, S as StateEffect, j as codePointAt, d as EditorSelection, k as indentUnit, A as Annotation, D as Decoration, l as StateField, E as EditorView, P as Prec, m as keymap, n as codePointSize, R as RangeSet, o as showTooltip, V as ViewPlugin, q as logException, r as getTooltip, F as Facet, u as combineConfig, v as fromCodePoint, M as MapMode, W as WidgetType, w as RangeValue, x as Direction, C as CharCategory } from "./code-palette-
|
|
1
|
+
import { b as syntaxTree, T as Transaction, h as Text, S as StateEffect, j as codePointAt, d as EditorSelection, k as indentUnit, A as Annotation, D as Decoration, l as StateField, E as EditorView, P as Prec, m as keymap, n as codePointSize, R as RangeSet, o as showTooltip, V as ViewPlugin, q as logException, r as getTooltip, F as Facet, u as combineConfig, v as fromCodePoint, M as MapMode, W as WidgetType, w as RangeValue, x as Direction, C as CharCategory } from "./code-palette-BWrZDi47.js";
|
|
2
2
|
class CompletionContext {
|
|
3
3
|
/**
|
|
4
4
|
Create a new completion context. (Mostly useful for testing
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as LanguageSupport, L as LRLanguage, i as indentNodeProp, c as continuedIndent, f as foldNodeProp, g as foldInside, s as styleTags, t as tags } from "./code-palette-
|
|
2
|
-
import { defineCSSCompletionSource } from "./index-
|
|
3
|
-
import { L as LRParser, E as ExternalTokenizer } from "./index-
|
|
1
|
+
import { a as LanguageSupport, L as LRLanguage, i as indentNodeProp, c as continuedIndent, f as foldNodeProp, g as foldInside, s as styleTags, t as tags } from "./code-palette-BWrZDi47.js";
|
|
2
|
+
import { defineCSSCompletionSource } from "./index-CefLTKmi.js";
|
|
3
|
+
import { L as LRParser, E as ExternalTokenizer } from "./index-2YPxXIaf.js";
|
|
4
4
|
const descendantOp = 110, Unit = 1, openArgList = 2;
|
|
5
5
|
const space = [
|
|
6
6
|
9,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { L as LRLanguage, a as LanguageSupport, p as parseMixed, s as styleTags, t as tags } from "./code-palette-
|
|
2
|
-
import { html } from "./index-
|
|
3
|
-
import { javascriptLanguage } from "./index-
|
|
4
|
-
import { L as LRParser, E as ExternalTokenizer } from "./index-
|
|
1
|
+
import { L as LRLanguage, a as LanguageSupport, p as parseMixed, s as styleTags, t as tags } from "./code-palette-BWrZDi47.js";
|
|
2
|
+
import { html } from "./index-ptbBQ53d.js";
|
|
3
|
+
import { javascriptLanguage } from "./index-Cx5ThXzs.js";
|
|
4
|
+
import { L as LRParser, E as ExternalTokenizer } from "./index-2YPxXIaf.js";
|
|
5
5
|
const Text = 1, attributeContentSingle = 33, attributeContentDouble = 34, scriptAttributeContentSingle = 35, scriptAttributeContentDouble = 36;
|
|
6
6
|
const text = /* @__PURE__ */ new ExternalTokenizer((input) => {
|
|
7
7
|
let start = input.pos;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as EditorView, d as EditorSelection, a as LanguageSupport, p as parseMixed, b as syntaxTree, L as LRLanguage, s as styleTags, t as tags, i as indentNodeProp, e as delimitedIndent, f as foldNodeProp } from "./code-palette-
|
|
2
|
-
import { html } from "./index-
|
|
3
|
-
import { L as LRParser, E as ExternalTokenizer } from "./index-
|
|
1
|
+
import { E as EditorView, d as EditorSelection, a as LanguageSupport, p as parseMixed, b as syntaxTree, L as LRLanguage, s as styleTags, t as tags, i as indentNodeProp, e as delimitedIndent, f as foldNodeProp } from "./code-palette-BWrZDi47.js";
|
|
2
|
+
import { html } from "./index-ptbBQ53d.js";
|
|
3
|
+
import { L as LRParser, E as ExternalTokenizer } from "./index-2YPxXIaf.js";
|
|
4
4
|
const interpolationStart = 1, tagStart = 2, endTagStart = 3, text = 180, endrawTagStart = 4, rawText = 181, endcommentTagStart = 5, commentText = 182, InlineComment = 6;
|
|
5
5
|
function wordChar(code) {
|
|
6
6
|
return code >= 65 && code <= 90 || code >= 97 && code <= 122;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { L as LRParser, E as ExternalTokenizer, C as ContextTracker } from "./index-
|
|
2
|
-
import { p as parseMixed, s as styleTags, t as tags, E as EditorView, b as syntaxTree, d as EditorSelection, a as LanguageSupport, L as LRLanguage, i as indentNodeProp, f as foldNodeProp, ag as bracketMatchingHandle } from "./code-palette-
|
|
3
|
-
import { cssLanguage, css } from "./index-
|
|
4
|
-
import { typescriptLanguage, jsxLanguage, tsxLanguage, javascriptLanguage, javascript } from "./index-
|
|
1
|
+
import { L as LRParser, E as ExternalTokenizer, C as ContextTracker } from "./index-2YPxXIaf.js";
|
|
2
|
+
import { p as parseMixed, s as styleTags, t as tags, E as EditorView, b as syntaxTree, d as EditorSelection, a as LanguageSupport, L as LRLanguage, i as indentNodeProp, f as foldNodeProp, ag as bracketMatchingHandle } from "./code-palette-BWrZDi47.js";
|
|
3
|
+
import { cssLanguage, css } from "./index-CefLTKmi.js";
|
|
4
|
+
import { typescriptLanguage, jsxLanguage, tsxLanguage, javascriptLanguage, javascript } from "./index-Cx5ThXzs.js";
|
|
5
5
|
const scriptText = 55, StartCloseScriptTag = 1, styleText = 56, StartCloseStyleTag = 2, textareaText = 57, StartCloseTextareaTag = 3, EndTag = 4, SelfClosingEndTag = 5, StartTag = 6, StartScriptTag = 7, StartStyleTag = 8, StartTextareaTag = 9, StartSelfClosingTag = 10, StartCloseTag = 11, NoMatchStartCloseTag = 12, MismatchedStartCloseTag = 13, missingCloseTag = 58, IncompleteTag = 14, IncompleteCloseTag = 15, commentContent$1 = 59, Element = 21, TagName = 23, Attribute = 24, AttributeName = 25, AttributeValue = 27, UnquotedAttributeValue = 28, ScriptText = 29, StyleText = 32, TextareaText = 35, OpenTag = 37, CloseTag = 38, Dialect_noMatch = 0, Dialect_selfClosing = 1;
|
|
6
6
|
const selfClosers$1 = {
|
|
7
7
|
area: true,
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type { ChatActions, ChatState, ConversationSession, CreateConversationInp
|
|
|
7
7
|
export { SdkError, createDocumentUploadProvider, defaultDocumentUploadConfig, defaultEndpoints, useDocumentUploadWithDefaultConfig, } from './composables/fileUpload';
|
|
8
8
|
export type { DocumentUploadConfig, DocumentUploadProvider, FileEntry, FileStatus, } from './composables/fileUpload';
|
|
9
9
|
export { CkAgentMessage, CkAgentMessageHeader, CkHeaderActivityButton, CkCitation, CkCitationLabel, CkCitationCard, CkConversation, CkConversationLayout, CkCopyMessageButton, CkDropZoneOverlay, CkFeedbackButton, CkFeedbackDialog, CkFileItemsList, CkHistory, CkHistoryItem, CkHistoryWrapper, CkMarkdownRenderer, CkMessageButton, CkModelSelector, CkPromptSendButton, CkPromptMenuButton, CkPromptStopButton, CkPromptInput, CkPromptInputDisclaimer, CkRegenerateMessageButton, CkSendIcon, CkStopIcon, CkUserMessage, CkEditableUserMessage, CkMilkdownEditor, CkCodeEditor, } from './components';
|
|
10
|
-
export type { CkAgentMessageHeaderProps, CkHeaderActivityButtonProps, CkHeaderActivityButtonEmits, CkCitationProps, CkCitationEmits, CkCitationSource, CkCitationLabelProps, CkCitationCardProps, CkCitationCardEmits, CkConversationLayoutProps, CkConversationProps, CkDropZoneOverlayProps, CkDropZoneOverlayEmits, CkDropZoneRejection, CkDropZoneRejectionReason, CkFeedbackButtonProps, CkFeedbackDialogEmits, CkFeedbackDialogProps, CkFeedbackDialogSubmitPayload, CkFeedbackReason, CkFeedbackSentiment, CkFeedbackValue, CkFileEntry, CkFileItemsListEmits, CkFileItemsListProps, CkHistoryEmits, CkHistoryItemEmits, CkHistoryItemProps, CkHistoryProps, CkHistoryWrapperProps, CkMarkdownElementClasses, CkMarkdownRendererProps, CkMarkdownRendererEmits, CkModelOption, CkModelSelectorProps, CkModelSelectorEmits, CkPromptMenuButtonProps, CkUserMessageProps, CkEditableUserMessageProps, CkEditableUserMessageEmits, CkMilkdownEditorEmits, CkMilkdownEditorExposed, CkMilkdownEditorProps, CkCodeEditorEmits, CkCodeEditorExposed, CkCodeEditorProps, } from './components';
|
|
10
|
+
export type { CkAgentMessageHeaderProps, CkHeaderActivityButtonProps, CkHeaderActivityButtonEmits, CkCitationProps, CkCitationEmits, CkCitationSource, CkCitationLabelProps, CkCitationCardProps, CkCitationCardEmits, CkConversationLayoutProps, CkConversationProps, CkDropZoneOverlayProps, CkDropZoneOverlayEmits, CkDropZoneRejection, CkDropZoneRejectionReason, CkFeedbackButtonProps, CkFeedbackDialogEmits, CkFeedbackDialogProps, CkFeedbackDialogSubmitPayload, CkFeedbackReason, CkFeedbackSentiment, CkFeedbackValue, CkFileEntry, CkFileItemsListEmits, CkFileItemsListProps, CkHistoryEmits, CkHistoryItemEmits, CkHistoryItemProps, CkHistoryProps, CkHistoryWrapperProps, CkMarkdownElementClasses, CkMarkdownRendererProps, CkMarkdownRendererEmits, CkModelOption, CkModelSelectorProps, CkModelSelectorEmits, CkPromptMenuButtonProps, CkUserMessageProps, CkEditableUserMessageProps, CkEditableUserMessageEmits, CkMilkdownEditorEmits, CkMilkdownEditorExposed, CkMilkdownEditorProps, CkCodeEditorEmits, CkCodeEditorExposed, CkCodeEditorFadeSurface, CkCodeEditorProps, } from './components';
|
|
11
11
|
export { formatRelativeTime, markdownToPlainText } from './helpers';
|
|
12
12
|
export type { ActiveComparison, BaseMessage, ComparisonLane, Conversation, ConversationTree, MessageContent, MessageContentStatus, MessageMetadata, MessageReasoningContent, MessageRole, MessageStatus, MessageTextContent, MessageToolContent, TreeMessage, } from './types';
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,iBAAiB,CAAC;AAGzB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AASpB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EACL,OAAO,EACP,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,eAAe,EACf,aAAa,EACb,6BAA6B,EAC7B,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,QAAQ,EACR,4BAA4B,EAC5B,2BAA2B,EAC3B,gBAAgB,EAChB,kCAAkC,GACnC,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,SAAS,EACT,UAAU,GACX,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,yBAAyB,EACzB,UAAU,EACV,UAAU,EACV,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,yBAAyB,EACzB,2BAA2B,EAC3B,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,0BAA0B,EAC1B,0BAA0B,EAC1B,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGpE,YAAY,EACV,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,GACZ,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,iBAAiB,CAAC;AAGzB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AASpB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EACL,OAAO,EACP,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,eAAe,EACf,aAAa,EACb,6BAA6B,EAC7B,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,QAAQ,EACR,4BAA4B,EAC5B,2BAA2B,EAC3B,gBAAgB,EAChB,kCAAkC,GACnC,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,SAAS,EACT,UAAU,GACX,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,yBAAyB,EACzB,UAAU,EACV,UAAU,EACV,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,yBAAyB,EACzB,2BAA2B,EAC3B,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,0BAA0B,EAC1B,0BAA0B,EAC1B,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGpE,YAAY,EACV,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,GACZ,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { u } from "./useMessageHandler-
|
|
2
|
-
import { C, d, p, u as u2, b } from "./useChatKitLabels-
|
|
3
|
-
import { S, c, d as d2, f, u as u3, a, b as b2, e } from "./index-
|
|
4
|
-
import { _, a as a2, b as b3, c as c2, C as C2, d as d3, e as e2, f as f2, g, h, i, j, k, l, m, n, o, p as p2, q, r, s, t, u as u4, v, w, x, y, z, A, B, D, E } from "./CkHistory.vue_vue_type_script_setup_true_lang-
|
|
5
|
-
import { m as m2 } from "./markdownToPlainText-
|
|
1
|
+
import { u } from "./useMessageHandler-Bkzrdgfj.js";
|
|
2
|
+
import { C, d, p, u as u2, b } from "./useChatKitLabels-DxW0N5U-.js";
|
|
3
|
+
import { S, c, d as d2, f, u as u3, a, b as b2, e } from "./index-D0DQjdsq.js";
|
|
4
|
+
import { _, a as a2, b as b3, c as c2, C as C2, d as d3, e as e2, f as f2, g, h, i, j, k, l, m, n, o, p as p2, q, r, s, t, u as u4, v, w, x, y, z, A, B, D, E } from "./CkHistory.vue_vue_type_script_setup_true_lang-wu1Zrvgc.js";
|
|
5
|
+
import { m as m2 } from "./markdownToPlainText-DN_G-I6g.js";
|
|
6
6
|
export {
|
|
7
7
|
C as CHAT_KIT_LABELS,
|
|
8
8
|
_ as CkAgentMessage,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as unified, r as remarkParse, a as remarkGfm } from "./index-
|
|
1
|
+
import { u as unified, r as remarkParse, a as remarkGfm } from "./index-CfVHzirA.js";
|
|
2
2
|
function generateId() {
|
|
3
3
|
return typeof crypto !== "undefined" && "randomUUID" in crypto ? crypto.randomUUID() : String(Date.now());
|
|
4
4
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, toValue, inject, provide } from "vue";
|
|
2
2
|
import { p as purify } from "./katex.min-md74IFlY.js";
|
|
3
|
-
import { b as asciiAlphanumeric, o as ok, l as longestStreak,
|
|
3
|
+
import { b as asciiAlphanumeric, o as ok, l as longestStreak, c as factorySpace, m as markdownLineEnding, v as visit, d as convert, e as visitParents, S as SKIP, g as ccount, u as unified, r as remarkParse, a as remarkGfm, f as findAndReplace } from "./index-CfVHzirA.js";
|
|
4
4
|
function normalizeUri(value) {
|
|
5
5
|
const result = [];
|
|
6
6
|
let index = -1;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { render, screen, waitFor } from '@testing-library/vue';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
import CkCodeEditor from './CkCodeEditor.vue';
|
|
4
|
-
import { resolveLanguage } from './createCodeMirror';
|
|
4
|
+
import { detectLineSeparator, resolveLanguage } from './createCodeMirror';
|
|
5
5
|
import { matchBadgeRanges } from './badgeDecoration';
|
|
6
6
|
|
|
7
7
|
// CodeMirror measures its own layout on construction; jsdom has none of the
|
|
@@ -233,6 +233,119 @@ describe('CkCodeEditor', () => {
|
|
|
233
233
|
expect(pills).toEqual(['alpha']);
|
|
234
234
|
});
|
|
235
235
|
|
|
236
|
+
it('keeps Windows line endings instead of rewriting them', async () => {
|
|
237
|
+
const crlf = 'alpha\r\nbeta\r\ngamma';
|
|
238
|
+
const { emitted } = await renderEditor({ modelValue: crlf });
|
|
239
|
+
|
|
240
|
+
const content = document.querySelector('.cm-content') as HTMLElement;
|
|
241
|
+
await userEvent.click(content);
|
|
242
|
+
await userEvent.type(content, '!');
|
|
243
|
+
|
|
244
|
+
await waitFor(() => expect(emitted()['update:modelValue']).toBeTruthy());
|
|
245
|
+
const updates = emitted()['update:modelValue'] as string[][];
|
|
246
|
+
const value = updates.at(-1)?.[0] ?? '';
|
|
247
|
+
// Every original separator survives, rather than being flattened to \n.
|
|
248
|
+
expect(value).toContain('alpha\r\nbeta\r\ngamma');
|
|
249
|
+
expect(value).not.toContain('alpha\nbeta');
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
it('leaves a Unix document on Unix endings', async () => {
|
|
253
|
+
const { emitted } = await renderEditor({ modelValue: 'alpha\nbeta' });
|
|
254
|
+
|
|
255
|
+
const content = document.querySelector('.cm-content') as HTMLElement;
|
|
256
|
+
await userEvent.click(content);
|
|
257
|
+
await userEvent.type(content, '!');
|
|
258
|
+
|
|
259
|
+
await waitFor(() => expect(emitted()['update:modelValue']).toBeTruthy());
|
|
260
|
+
const updates = emitted()['update:modelValue'] as string[][];
|
|
261
|
+
expect(updates.at(-1)?.[0]).not.toContain('\r');
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
it('wraps the code in the design system fade mask', async () => {
|
|
265
|
+
const { container } = await renderEditor({ modelValue: 'a\nb' });
|
|
266
|
+
|
|
267
|
+
const mask = container.querySelector('.ui-fade-mask');
|
|
268
|
+
expect(mask).toBeInTheDocument();
|
|
269
|
+
expect(mask?.querySelector('.ck-code-editor__host')).toBeInTheDocument();
|
|
270
|
+
// jsdom reports no layout, so nothing scrolls and the bands collapse.
|
|
271
|
+
expect(
|
|
272
|
+
(mask as HTMLElement).style.getPropertyValue('--ui-fade-mask-height'),
|
|
273
|
+
).toBe('0px');
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
it('fades into the design surfaces by default', async () => {
|
|
277
|
+
const { container } = await renderEditor({ modelValue: 'a\nb' });
|
|
278
|
+
|
|
279
|
+
const mask = container.querySelector('.ui-fade-mask') as HTMLElement;
|
|
280
|
+
expect(mask.style.getPropertyValue('--ck-code-fade-top')).toBe(
|
|
281
|
+
'var(--background-surface-secondary)',
|
|
282
|
+
);
|
|
283
|
+
expect(mask.style.getPropertyValue('--ck-code-fade-bottom')).toBe(
|
|
284
|
+
'var(--background-surface-floating)',
|
|
285
|
+
);
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
it('fades each edge into the surface its prop names', async () => {
|
|
289
|
+
const { container } = await renderEditor({
|
|
290
|
+
modelValue: 'a\nb',
|
|
291
|
+
fadeTopBackground: 'modal',
|
|
292
|
+
fadeBottomBackground: 'primary',
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
const mask = container.querySelector('.ui-fade-mask') as HTMLElement;
|
|
296
|
+
expect(mask.style.getPropertyValue('--ck-code-fade-top')).toBe(
|
|
297
|
+
'var(--background-surface-modal)',
|
|
298
|
+
);
|
|
299
|
+
expect(mask.style.getPropertyValue('--ck-code-fade-bottom')).toBe(
|
|
300
|
+
'var(--background-surface-primary)',
|
|
301
|
+
);
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
it('omits the fade mask when `scrollFade` is off', async () => {
|
|
305
|
+
const { container } = await renderEditor({
|
|
306
|
+
modelValue: 'a\nb',
|
|
307
|
+
scrollFade: false,
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
expect(container.querySelector('.ui-fade-mask')).toBeNull();
|
|
311
|
+
expect(
|
|
312
|
+
container.querySelector('.ck-code-editor__host'),
|
|
313
|
+
).toBeInTheDocument();
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
// CodeMirror reports focus changes from a 10ms timeout, so a test asserting
|
|
317
|
+
// that no event followed has to outlast it.
|
|
318
|
+
const settleFocus = () => new Promise((resolve) => setTimeout(resolve, 30));
|
|
319
|
+
|
|
320
|
+
it('keeps focus while it moves between the code and the header', async () => {
|
|
321
|
+
const { emitted } = await renderEditor({ modelValue: 'x' });
|
|
322
|
+
|
|
323
|
+
const content = document.querySelector('.cm-content') as HTMLElement;
|
|
324
|
+
await userEvent.click(content);
|
|
325
|
+
await waitFor(() => expect(emitted().focus).toBeTruthy());
|
|
326
|
+
|
|
327
|
+
// The copy button is inside the component, so the editor has not been left.
|
|
328
|
+
await userEvent.click(screen.getByRole('button', { name: 'Copy code' }));
|
|
329
|
+
await settleFocus();
|
|
330
|
+
expect(emitted().blur).toBeUndefined();
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
it('emits `blur` once focus leaves the component entirely', async () => {
|
|
334
|
+
const outside = document.createElement('button');
|
|
335
|
+
document.body.append(outside);
|
|
336
|
+
const { emitted } = await renderEditor({ modelValue: 'x' });
|
|
337
|
+
|
|
338
|
+
const content = document.querySelector('.cm-content') as HTMLElement;
|
|
339
|
+
await userEvent.click(content);
|
|
340
|
+
await userEvent.click(outside);
|
|
341
|
+
|
|
342
|
+
await waitFor(() => expect(emitted().blur).toHaveLength(1));
|
|
343
|
+
// And exactly once, not again from CodeMirror's own focus tracking.
|
|
344
|
+
await settleFocus();
|
|
345
|
+
expect(emitted().blur).toHaveLength(1);
|
|
346
|
+
outside.remove();
|
|
347
|
+
});
|
|
348
|
+
|
|
236
349
|
it('does not throw when unmounted before or after the editor is created', async () => {
|
|
237
350
|
const early = render(CkCodeEditor, { props: { modelValue: 'x' } });
|
|
238
351
|
expect(() => early.unmount()).not.toThrow();
|
|
@@ -282,3 +395,17 @@ describe('matchBadgeRanges', () => {
|
|
|
282
395
|
).toHaveLength(0);
|
|
283
396
|
});
|
|
284
397
|
});
|
|
398
|
+
|
|
399
|
+
describe('detectLineSeparator', () => {
|
|
400
|
+
it('reports the separator a document already uses', () => {
|
|
401
|
+
expect(detectLineSeparator('a\nb')).toBe('\n');
|
|
402
|
+
expect(detectLineSeparator('a\r\nb')).toBe('\r\n');
|
|
403
|
+
expect(detectLineSeparator('no newlines at all')).toBe('\n');
|
|
404
|
+
expect(detectLineSeparator('')).toBe('\n');
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
it('follows the majority in a mixed document', () => {
|
|
408
|
+
expect(detectLineSeparator('a\r\nb\r\nc\nd')).toBe('\r\n');
|
|
409
|
+
expect(detectLineSeparator('a\nb\nc\r\nd')).toBe('\n');
|
|
410
|
+
});
|
|
411
|
+
});
|
|
@@ -57,6 +57,17 @@ const meta: Meta<typeof CkCodeEditor> = {
|
|
|
57
57
|
showLineNumbers: { control: 'boolean' },
|
|
58
58
|
lineWrapping: { control: 'boolean' },
|
|
59
59
|
autofocus: { control: 'boolean' },
|
|
60
|
+
scrollFade: { control: 'boolean' },
|
|
61
|
+
fadeTopBackground: {
|
|
62
|
+
control: 'inline-radio',
|
|
63
|
+
options: ['primary', 'secondary', 'floating', 'modal'],
|
|
64
|
+
description: 'Surface the top scroll fade dissolves into.',
|
|
65
|
+
},
|
|
66
|
+
fadeBottomBackground: {
|
|
67
|
+
control: 'inline-radio',
|
|
68
|
+
options: ['primary', 'secondary', 'floating', 'modal'],
|
|
69
|
+
description: 'Surface the bottom scroll fade dissolves into.',
|
|
70
|
+
},
|
|
60
71
|
// A regex plus a callback cannot be typed into a control, so the rule is
|
|
61
72
|
// offered as named presets instead. Without this, badges could only be seen
|
|
62
73
|
// on the one story that hard-codes a rule.
|
|
@@ -324,7 +335,8 @@ export const WithoutHeader: Story = {
|
|
|
324
335
|
|
|
325
336
|
/**
|
|
326
337
|
* `maxHeight` caps the scrollable area and `lineWrapping` folds long lines
|
|
327
|
-
* instead of scrolling sideways.
|
|
338
|
+
* instead of scrolling sideways. Scroll it: the code fades at whichever edge
|
|
339
|
+
* has more of the document beyond it, and neither edge fades once you reach it.
|
|
328
340
|
*/
|
|
329
341
|
export const ScrollingAndWrapping: Story = {
|
|
330
342
|
render: (args) => ({
|