dsh-plugin-core-demo 0.35.20 → 0.35.21
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/client.js +22 -101
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -54975,34 +54975,8 @@ function languageForPath(path) {
|
|
|
54975
54975
|
}
|
|
54976
54976
|
|
|
54977
54977
|
// dist/ui/display/code-viewer-theme.js
|
|
54978
|
-
var
|
|
54979
|
-
|
|
54980
|
-
gray: "#abb2bf",
|
|
54981
|
-
faintGray: "#5c6370",
|
|
54982
|
-
white: "#ffffff",
|
|
54983
|
-
red: "#e06c75",
|
|
54984
|
-
green: "#98c379",
|
|
54985
|
-
yellow: "#e5c07b",
|
|
54986
|
-
blue: "#61afef",
|
|
54987
|
-
magenta: "#c678dd",
|
|
54988
|
-
cyan: "#56b6c2",
|
|
54989
|
-
orange: "#d19a66",
|
|
54990
|
-
link: "#56b6c2"
|
|
54991
|
-
};
|
|
54992
|
-
var ONE_LIGHT = {
|
|
54993
|
-
black: "#383a42",
|
|
54994
|
-
gray: "#a0a1a7",
|
|
54995
|
-
faintGray: "#4f525e",
|
|
54996
|
-
white: "#ffffff",
|
|
54997
|
-
red: "#e45649",
|
|
54998
|
-
green: "#50a14f",
|
|
54999
|
-
yellow: "#c18401",
|
|
55000
|
-
blue: "#0184bc",
|
|
55001
|
-
magenta: "#a626a4",
|
|
55002
|
-
cyan: "#0997b3",
|
|
55003
|
-
orange: "#986801",
|
|
55004
|
-
link: "#4078f2"
|
|
55005
|
-
};
|
|
54978
|
+
var CURSOR_FALLBACK_DARK = "#abb2bf";
|
|
54979
|
+
var CURSOR_FALLBACK_LIGHT = "#383a42";
|
|
55006
54980
|
var cmSurfaceTheme = EditorView.theme({
|
|
55007
54981
|
"&": {
|
|
55008
54982
|
height: "100%",
|
|
@@ -55014,6 +54988,9 @@ var cmSurfaceTheme = EditorView.theme({
|
|
|
55014
54988
|
overflow: "auto",
|
|
55015
54989
|
fontFamily: "var(--dshpc-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)"
|
|
55016
54990
|
},
|
|
54991
|
+
// basicSetup 默认开 drawSelection(),它会把 .cm-content 的 caret-color 置为 transparent:
|
|
54992
|
+
// CodeMirror 6 用自绘 .cm-cursor,不认原生 caret。真正决定光标色的是下面 cmSurfaceTint
|
|
54993
|
+
// 里的 borderLeftColor;这一条只在没开 drawSelection 时兜底。
|
|
55017
54994
|
".cm-content": {
|
|
55018
54995
|
caretColor: "var(--dshpc-fg, #1f2328)"
|
|
55019
54996
|
},
|
|
@@ -55033,78 +55010,19 @@ var SELECTION_DARK = "#3E4451";
|
|
|
55033
55010
|
var SELECTION_LIGHT = "#c8d3f0";
|
|
55034
55011
|
function cmSurfaceTint(dark) {
|
|
55035
55012
|
return EditorView.theme({
|
|
55036
|
-
//
|
|
55037
|
-
// 聚焦态选区画在 .cm-selectionLayer 里,未聚焦走 .cm-selectionBackground,
|
|
55038
|
-
// 浏览器原生取 .cm-content ::selection —— 三条都盖住,避免任一路径漏配。
|
|
55013
|
+
// 与官方 oneDarkTheme 的选区选择器一致(dist/index.js:41),本层后注入 ⇒ 覆盖。
|
|
55039
55014
|
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": {
|
|
55040
55015
|
backgroundColor: dark ? SELECTION_DARK : SELECTION_LIGHT
|
|
55016
|
+
},
|
|
55017
|
+
// 官方 oneDarkTheme 也给 .cm-cursor 上色,但亮色没有等价规则;本层统一吃 token,
|
|
55018
|
+
// 且后注入覆盖官方,明暗两套表现一致。
|
|
55019
|
+
".cm-cursor, .cm-dropCursor": {
|
|
55020
|
+
borderLeftColor: `var(--dshpc-fg, ${dark ? CURSOR_FALLBACK_DARK : CURSOR_FALLBACK_LIGHT})`
|
|
55041
55021
|
}
|
|
55042
55022
|
});
|
|
55043
55023
|
}
|
|
55044
|
-
var HIGHLIGHTS_DARK = [
|
|
55045
|
-
{ tag: [tags.comment, tags.lineComment, tags.blockComment], color: ONE_DARK.faintGray, fontStyle: "italic" },
|
|
55046
|
-
{ tag: [tags.keyword, tags.modifier, tags.controlKeyword, tags.moduleKeyword], color: ONE_DARK.magenta },
|
|
55047
|
-
{ tag: [tags.operator, tags.operatorKeyword, tags.compareOperator, tags.logicOperator, tags.bitwiseOperator], color: ONE_DARK.cyan },
|
|
55048
|
-
{ tag: [tags.definitionKeyword, tags.atom], color: ONE_DARK.cyan },
|
|
55049
|
-
{ tag: [tags.number, tags.bool, tags.null, tags.escape], color: ONE_DARK.orange },
|
|
55050
|
-
{ tag: [tags.string, tags.special(tags.string), tags.regexp], color: ONE_DARK.green },
|
|
55051
|
-
{ tag: [tags.character, tags.special(tags.character)], color: ONE_DARK.orange },
|
|
55052
|
-
{ tag: [tags.propertyName], color: ONE_DARK.yellow },
|
|
55053
|
-
// 变量名取 ivory(#abb2bf) 而非纯白:官方 one-dark 的正文色就是 ivory,纯白在深底上过曝、
|
|
55054
|
-
// 且压在选区上对比度更差(旧值 #ffffff)。
|
|
55055
|
-
{ tag: [tags.variableName], color: ONE_DARK.gray },
|
|
55056
|
-
{ tag: [tags.function(tags.variableName), tags.function(tags.propertyName), tags.labelName], color: ONE_DARK.blue },
|
|
55057
|
-
{ tag: [tags.className, tags.typeName, tags.namespace], color: ONE_DARK.yellow },
|
|
55058
|
-
{ tag: [tags.definition(tags.typeName), tags.definition(tags.className), tags.definition(tags.namespace)], color: ONE_DARK.yellow },
|
|
55059
|
-
{ tag: [tags.tagName], color: ONE_DARK.red },
|
|
55060
|
-
{ tag: [tags.attributeName], color: ONE_DARK.yellow },
|
|
55061
|
-
{ tag: [tags.self, tags.standard(tags.variableName), tags.constant(tags.variableName)], color: ONE_DARK.orange },
|
|
55062
|
-
{ tag: [tags.punctuation, tags.separator, tags.bracket], color: ONE_DARK.gray },
|
|
55063
|
-
{ tag: [tags.squareBracket, tags.paren, tags.brace], color: ONE_DARK.gray },
|
|
55064
|
-
{ tag: [tags.meta, tags.documentMeta, tags.annotation], color: ONE_DARK.gray },
|
|
55065
|
-
{ tag: [tags.link, tags.url], color: ONE_DARK.link, fontStyle: "underline" },
|
|
55066
|
-
{ tag: [tags.heading], color: ONE_DARK.blue, fontStyle: "bold" },
|
|
55067
|
-
{ tag: [tags.emphasis], fontStyle: "italic" },
|
|
55068
|
-
{ tag: [tags.strong], fontWeight: "bold" },
|
|
55069
|
-
{ tag: [tags.strikethrough], textDecoration: "line-through" },
|
|
55070
|
-
{ tag: [tags.monospace], color: ONE_DARK.green },
|
|
55071
|
-
{ tag: [tags.contentSeparator], color: ONE_DARK.faintGray },
|
|
55072
|
-
{ tag: [tags.invalid], color: ONE_DARK.red }
|
|
55073
|
-
];
|
|
55074
|
-
var HIGHLIGHTS_LIGHT = [
|
|
55075
|
-
{ tag: [tags.comment, tags.lineComment, tags.blockComment], color: ONE_LIGHT.faintGray, fontStyle: "italic" },
|
|
55076
|
-
{ tag: [tags.keyword, tags.modifier, tags.controlKeyword, tags.moduleKeyword], color: ONE_LIGHT.magenta },
|
|
55077
|
-
{ tag: [tags.operator, tags.operatorKeyword, tags.compareOperator, tags.logicOperator, tags.bitwiseOperator], color: ONE_LIGHT.cyan },
|
|
55078
|
-
{ tag: [tags.definitionKeyword, tags.atom], color: ONE_LIGHT.cyan },
|
|
55079
|
-
{ tag: [tags.number, tags.bool, tags.null, tags.escape], color: ONE_LIGHT.orange },
|
|
55080
|
-
{ tag: [tags.string, tags.special(tags.string), tags.regexp], color: ONE_LIGHT.green },
|
|
55081
|
-
{ tag: [tags.character, tags.special(tags.character)], color: ONE_LIGHT.orange },
|
|
55082
|
-
{ tag: [tags.propertyName], color: ONE_LIGHT.black },
|
|
55083
|
-
{ tag: [tags.variableName], color: ONE_LIGHT.black },
|
|
55084
|
-
{ tag: [tags.function(tags.variableName), tags.function(tags.propertyName), tags.labelName], color: ONE_LIGHT.blue },
|
|
55085
|
-
{ tag: [tags.className, tags.typeName, tags.namespace], color: ONE_LIGHT.yellow },
|
|
55086
|
-
{ tag: [tags.definition(tags.typeName), tags.definition(tags.className), tags.definition(tags.namespace)], color: ONE_LIGHT.yellow },
|
|
55087
|
-
{ tag: [tags.tagName], color: ONE_LIGHT.red },
|
|
55088
|
-
{ tag: [tags.attributeName], color: ONE_LIGHT.yellow },
|
|
55089
|
-
{ tag: [tags.self, tags.standard(tags.variableName), tags.constant(tags.variableName)], color: ONE_LIGHT.orange },
|
|
55090
|
-
{ tag: [tags.punctuation, tags.separator, tags.bracket], color: ONE_LIGHT.gray },
|
|
55091
|
-
{ tag: [tags.squareBracket, tags.paren, tags.brace], color: ONE_LIGHT.gray },
|
|
55092
|
-
{ tag: [tags.meta, tags.documentMeta, tags.annotation], color: ONE_LIGHT.gray },
|
|
55093
|
-
{ tag: [tags.link, tags.url], color: ONE_LIGHT.link, fontStyle: "underline" },
|
|
55094
|
-
{ tag: [tags.heading], color: ONE_LIGHT.blue, fontStyle: "bold" },
|
|
55095
|
-
{ tag: [tags.emphasis], fontStyle: "italic" },
|
|
55096
|
-
{ tag: [tags.strong], fontWeight: "bold" },
|
|
55097
|
-
{ tag: [tags.strikethrough], textDecoration: "line-through" },
|
|
55098
|
-
{ tag: [tags.monospace], color: ONE_LIGHT.green },
|
|
55099
|
-
{ tag: [tags.contentSeparator], color: ONE_LIGHT.faintGray },
|
|
55100
|
-
{ tag: [tags.invalid], color: ONE_LIGHT.red }
|
|
55101
|
-
];
|
|
55102
55024
|
function codeMirrorTheme(dark) {
|
|
55103
|
-
return [
|
|
55104
|
-
cmSurfaceTheme,
|
|
55105
|
-
cmSurfaceTint(dark),
|
|
55106
|
-
syntaxHighlighting(HighlightStyle.define(dark ? HIGHLIGHTS_DARK : HIGHLIGHTS_LIGHT))
|
|
55107
|
-
];
|
|
55025
|
+
return [cmSurfaceTheme, cmSurfaceTint(dark)];
|
|
55108
55026
|
}
|
|
55109
55027
|
|
|
55110
55028
|
// dist/ui/infra/code-mirror-surface.js
|
|
@@ -55154,7 +55072,10 @@ function CodeMirrorSurface(props) {
|
|
|
55154
55072
|
return (0, import_react50.createElement)("div", { className: `dshpc-cv${className2 ? ` ${className2}` : ""}`, style: style2 }, overlay ?? null, (0, import_react50.createElement)(esm_default, {
|
|
55155
55073
|
value,
|
|
55156
55074
|
className: "dshpc-cv__editor dshpc-scroll-thin",
|
|
55157
|
-
|
|
55075
|
+
// 明暗与语法配色交给官方:dark → oneDark(官方主题 + 完整 highlighter),
|
|
55076
|
+
// light → 官方亮色表面 + basicSetup 的 defaultHighlightStyle 兜底。
|
|
55077
|
+
// 核心 cmSurfaceTheme / cmSurfaceTint 在 extensions 里后注入,覆盖官方面板背景。
|
|
55078
|
+
theme: dark ? "dark" : "light",
|
|
55158
55079
|
extensions,
|
|
55159
55080
|
readOnly: readOnly2,
|
|
55160
55081
|
onChange: onChange === void 0 ? void 0 : (next) => {
|
|
@@ -71564,9 +71485,9 @@ function ReferencePage() {
|
|
|
71564
71485
|
"tbody",
|
|
71565
71486
|
null,
|
|
71566
71487
|
[
|
|
71567
|
-
[t3("buildCore"), `v${"0.35.
|
|
71568
|
-
[t3("buildDemo"), `v${"0.35.
|
|
71569
|
-
[t3("buildStamp"), "
|
|
71488
|
+
[t3("buildCore"), `v${"0.35.21"}`],
|
|
71489
|
+
[t3("buildDemo"), `v${"0.35.21"}`],
|
|
71490
|
+
[t3("buildStamp"), "261111-015227-309"]
|
|
71570
71491
|
].map(
|
|
71571
71492
|
([label, value]) => (0, import_react99.createElement)(
|
|
71572
71493
|
"tr",
|
|
@@ -71882,9 +71803,9 @@ function DemoPage() {
|
|
|
71882
71803
|
lineHeight: "14px"
|
|
71883
71804
|
}
|
|
71884
71805
|
},
|
|
71885
|
-
(0, import_react101.createElement)("span", null, `core v${"0.35.
|
|
71886
|
-
(0, import_react101.createElement)("span", null, `demo v${"0.35.
|
|
71887
|
-
(0, import_react101.createElement)("span", { style: { marginTop: "4px", fontSize: "9px" } }, "
|
|
71806
|
+
(0, import_react101.createElement)("span", null, `core v${"0.35.21"}`),
|
|
71807
|
+
(0, import_react101.createElement)("span", null, `demo v${"0.35.21"}`),
|
|
71808
|
+
(0, import_react101.createElement)("span", { style: { marginTop: "4px", fontSize: "9px" } }, "261111-015227-309")
|
|
71888
71809
|
)
|
|
71889
71810
|
)
|
|
71890
71811
|
),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-core-demo",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.21",
|
|
4
4
|
"description": "The shared UI foundation for DSH plugins, with a live component preview: design tokens, common controls, workspace browsing and notifications maintained in one place — install it to preview every component in a real host.",
|
|
5
5
|
"icon": "./assets/icon-components.svg",
|
|
6
6
|
"keywords": [
|