dsh-diff-approval 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -5
- package/README.zh.md +20 -5
- package/docs/images/pending-panel.png +0 -0
- package/docs/images/pending-panel.zh.png +0 -0
- package/lib/client.js +659 -220
- package/lib/index.js +112 -23
- package/lib/types/client/highlight.d.ts +12 -0
- package/lib/types/client/locales.d.ts +14 -2
- package/lib/types/index.d.ts +4 -3
- package/lib/types/persist.d.ts +10 -0
- package/package.json +3 -2
package/lib/client.js
CHANGED
|
@@ -11296,6 +11296,8 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
11296
11296
|
//#endregion
|
|
11297
11297
|
//#region node_modules/.pnpm/@shikijs+langs@4.4.3/node_modules/@shikijs/langs/dist/scss.mjs
|
|
11298
11298
|
const lang$1 = Object.freeze(JSON.parse("{\"displayName\":\"SCSS\",\"name\":\"scss\",\"patterns\":[{\"include\":\"#variable_setting\"},{\"include\":\"#at_rule_forward\"},{\"include\":\"#at_rule_use\"},{\"include\":\"#at_rule_include\"},{\"include\":\"#at_rule_import\"},{\"include\":\"#general\"},{\"include\":\"#flow_control\"},{\"include\":\"#rules\"},{\"include\":\"#property_list\"},{\"include\":\"#at_rule_mixin\"},{\"include\":\"#at_rule_media\"},{\"include\":\"#at_rule_function\"},{\"include\":\"#at_rule_charset\"},{\"include\":\"#at_rule_option\"},{\"include\":\"#at_rule_namespace\"},{\"include\":\"#at_rule_fontface\"},{\"include\":\"#at_rule_page\"},{\"include\":\"#at_rule_keyframes\"},{\"include\":\"#at_rule_at_root\"},{\"include\":\"#at_rule_supports\"},{\"match\":\";\",\"name\":\"punctuation.terminator.rule.css\"}],\"repository\":{\"at_rule_at_root\":{\"begin\":\"\\\\s*((@)(at-root))(\\\\s+|$)\",\"beginCaptures\":{\"1\":{\"name\":\"keyword.control.at-rule.at-root.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"end\":\"\\\\s*(?=\\\\{)\",\"name\":\"meta.at-rule.at-root.scss\",\"patterns\":[{\"include\":\"#function_attributes\"},{\"include\":\"#functions\"},{\"include\":\"#selectors\"}]},\"at_rule_charset\":{\"begin\":\"\\\\s*((@)charset)\\\\b\\\\s*\",\"captures\":{\"1\":{\"name\":\"keyword.control.at-rule.charset.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"end\":\"\\\\s*((?=;|$))\",\"name\":\"meta.at-rule.charset.scss\",\"patterns\":[{\"include\":\"#variable\"},{\"include\":\"#string_single\"},{\"include\":\"#string_double\"}]},\"at_rule_content\":{\"begin\":\"\\\\s*((@)content)\\\\b\\\\s*\",\"captures\":{\"1\":{\"name\":\"keyword.control.content.scss\"}},\"end\":\"\\\\s*((?=;))\",\"name\":\"meta.content.scss\",\"patterns\":[{\"include\":\"#variable\"},{\"include\":\"#selectors\"},{\"include\":\"#property_values\"}]},\"at_rule_each\":{\"begin\":\"\\\\s*((@)each)\\\\b\\\\s*\",\"captures\":{\"1\":{\"name\":\"keyword.control.each.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"end\":\"\\\\s*((?=}))\",\"name\":\"meta.at-rule.each.scss\",\"patterns\":[{\"match\":\"\\\\b(in|,)\\\\b\",\"name\":\"keyword.control.operator\"},{\"include\":\"#variable\"},{\"include\":\"#property_values\"},{\"include\":\"$self\"}]},\"at_rule_else\":{\"begin\":\"\\\\s*((@)else(\\\\s*(if)?))\\\\s*\",\"captures\":{\"1\":{\"name\":\"keyword.control.else.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"end\":\"\\\\s*(?=\\\\{)\",\"name\":\"meta.at-rule.else.scss\",\"patterns\":[{\"include\":\"#conditional_operators\"},{\"include\":\"#variable\"},{\"include\":\"#property_values\"}]},\"at_rule_extend\":{\"begin\":\"\\\\s*((@)extend)\\\\b\\\\s*\",\"captures\":{\"1\":{\"name\":\"keyword.control.at-rule.extend.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"end\":\"\\\\s*(?=;)\",\"name\":\"meta.at-rule.extend.scss\",\"patterns\":[{\"include\":\"#variable\"},{\"include\":\"#selectors\"},{\"include\":\"#property_values\"}]},\"at_rule_fontface\":{\"patterns\":[{\"begin\":\"^\\\\s*((@)font-face)\\\\b\",\"beginCaptures\":{\"1\":{\"name\":\"keyword.control.at-rule.fontface.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"end\":\"\\\\s*(?=\\\\{)\",\"name\":\"meta.at-rule.fontface.scss\",\"patterns\":[{\"include\":\"#function_attributes\"}]}]},\"at_rule_for\":{\"begin\":\"\\\\s*((@)for)\\\\b\\\\s*\",\"captures\":{\"1\":{\"name\":\"keyword.control.for.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"end\":\"\\\\s*(?=\\\\{)\",\"name\":\"meta.at-rule.for.scss\",\"patterns\":[{\"match\":\"(==|!=|<=|>=|[<>]|from|to|through)\",\"name\":\"keyword.control.operator\"},{\"include\":\"#variable\"},{\"include\":\"#property_values\"},{\"include\":\"$self\"}]},\"at_rule_forward\":{\"begin\":\"\\\\s*((@)forward)\\\\b\\\\s*\",\"captures\":{\"1\":{\"name\":\"keyword.control.at-rule.forward.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"end\":\"\\\\s*(?=;)\",\"name\":\"meta.at-rule.forward.scss\",\"patterns\":[{\"match\":\"\\\\b(as|hide|show)\\\\b\",\"name\":\"keyword.control.operator\"},{\"captures\":{\"1\":{\"name\":\"entity.other.attribute-name.module.scss\"},\"2\":{\"name\":\"punctuation.definition.wildcard.scss\"}},\"match\":\"\\\\b([-\\\\w]+)(\\\\*)\"},{\"match\":\"\\\\b[-\\\\w]+\\\\b\",\"name\":\"entity.name.function.scss\"},{\"include\":\"#variable\"},{\"include\":\"#string_single\"},{\"include\":\"#string_double\"},{\"include\":\"#comment_line\"},{\"include\":\"#comment_block\"}]},\"at_rule_function\":{\"patterns\":[{\"begin\":\"\\\\s*((@)function)\\\\b\\\\s*\",\"captures\":{\"1\":{\"name\":\"keyword.control.at-rule.function.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"},\"3\":{\"name\":\"entity.name.function.scss\"}},\"end\":\"\\\\s*(?=\\\\{)\",\"name\":\"meta.at-rule.function.scss\",\"patterns\":[{\"include\":\"#function_attributes\"}]},{\"captures\":{\"1\":{\"name\":\"keyword.control.at-rule.function.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"},\"3\":{\"name\":\"entity.name.function.scss\"}},\"match\":\"\\\\s*((@)function)\\\\b\\\\s*\",\"name\":\"meta.at-rule.function.scss\"}]},\"at_rule_if\":{\"begin\":\"\\\\s*((@)if)\\\\b\\\\s*\",\"captures\":{\"1\":{\"name\":\"keyword.control.if.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"end\":\"\\\\s*(?=\\\\{)\",\"name\":\"meta.at-rule.if.scss\",\"patterns\":[{\"include\":\"#conditional_operators\"},{\"include\":\"#variable\"},{\"include\":\"#property_values\"}]},\"at_rule_import\":{\"begin\":\"\\\\s*((@)import)\\\\b\\\\s*\",\"captures\":{\"1\":{\"name\":\"keyword.control.at-rule.import.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"end\":\"\\\\s*((?=;)|(?=}))\",\"name\":\"meta.at-rule.import.scss\",\"patterns\":[{\"include\":\"#variable\"},{\"include\":\"#string_single\"},{\"include\":\"#string_double\"},{\"include\":\"#functions\"},{\"include\":\"#comment_line\"}]},\"at_rule_include\":{\"patterns\":[{\"begin\":\"(?<=@include)\\\\s+(?:([-\\\\w]+)\\\\s*(\\\\.))?([-\\\\w]+)\\\\s*(\\\\()\",\"beginCaptures\":{\"1\":{\"name\":\"variable.scss\"},\"2\":{\"name\":\"punctuation.access.module.scss\"},\"3\":{\"name\":\"entity.name.function.scss\"},\"4\":{\"name\":\"punctuation.definition.parameters.begin.bracket.round.scss\"}},\"end\":\"\\\\)\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.parameters.end.bracket.round.scss\"}},\"name\":\"meta.at-rule.include.scss\",\"patterns\":[{\"include\":\"#function_attributes\"}]},{\"captures\":{\"0\":{\"name\":\"meta.at-rule.include.scss\"},\"1\":{\"name\":\"variable.scss\"},\"2\":{\"name\":\"punctuation.access.module.scss\"},\"3\":{\"name\":\"entity.name.function.scss\"}},\"match\":\"(?<=@include)\\\\s+(?:([-\\\\w]+)\\\\s*(\\\\.))?([-\\\\w]+)\"},{\"captures\":{\"0\":{\"name\":\"meta.at-rule.include.scss\"},\"1\":{\"name\":\"keyword.control.at-rule.include.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"match\":\"((@)include)\\\\b\"}]},\"at_rule_keyframes\":{\"begin\":\"(?<=^|\\\\s)(@)(?:-(?:webkit|moz)-)?keyframes\\\\b\",\"beginCaptures\":{\"0\":{\"name\":\"keyword.control.at-rule.keyframes.scss\"},\"1\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"end\":\"(?<=})\",\"name\":\"meta.at-rule.keyframes.scss\",\"patterns\":[{\"captures\":{\"1\":{\"name\":\"entity.name.function.scss\"}},\"match\":\"(?<=@keyframes)\\\\s+((?:[A-Z_a-z][-\\\\w]|-[A-Z_a-z])[-\\\\w]*)\"},{\"begin\":\"(?<=@keyframes)\\\\s+(\\\")\",\"beginCaptures\":{\"1\":{\"name\":\"punctuation.definition.string.begin.scss\"}},\"contentName\":\"entity.name.function.scss\",\"end\":\"\\\"\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.string.end.scss\"}},\"name\":\"string.quoted.double.scss\",\"patterns\":[{\"match\":\"\\\\\\\\(\\\\h{1,6}|.)\",\"name\":\"constant.character.escape.scss\"},{\"include\":\"#interpolation\"}]},{\"begin\":\"(?<=@keyframes)\\\\s+(')\",\"beginCaptures\":{\"1\":{\"name\":\"punctuation.definition.string.begin.scss\"}},\"contentName\":\"entity.name.function.scss\",\"end\":\"'\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.string.end.scss\"}},\"name\":\"string.quoted.single.scss\",\"patterns\":[{\"match\":\"\\\\\\\\(\\\\h{1,6}|.)\",\"name\":\"constant.character.escape.scss\"},{\"include\":\"#interpolation\"}]},{\"begin\":\"\\\\{\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.section.keyframes.begin.scss\"}},\"end\":\"}\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.section.keyframes.end.scss\"}},\"patterns\":[{\"match\":\"\\\\b(?:(?:100|[1-9]\\\\d|\\\\d)%|from|to)(?=\\\\s*\\\\{)\",\"name\":\"entity.other.attribute-name.scss\"},{\"include\":\"#flow_control\"},{\"include\":\"#interpolation\"},{\"include\":\"#property_list\"},{\"include\":\"#rules\"}]}]},\"at_rule_media\":{\"patterns\":[{\"begin\":\"^\\\\s*((@)media)\\\\b\",\"beginCaptures\":{\"1\":{\"name\":\"keyword.control.at-rule.media.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"end\":\"\\\\s*(?=\\\\{)\",\"name\":\"meta.at-rule.media.scss\",\"patterns\":[{\"include\":\"#comment_docblock\"},{\"include\":\"#comment_block\"},{\"include\":\"#comment_line\"},{\"match\":\"\\\\b(only)\\\\b\",\"name\":\"keyword.control.operator.css.scss\"},{\"begin\":\"\\\\(\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.media-query.begin.bracket.round.scss\"}},\"end\":\"\\\\)\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.media-query.end.bracket.round.scss\"}},\"name\":\"meta.property-list.media-query.scss\",\"patterns\":[{\"begin\":\"(?<![-a-z])(?=[-a-z])\",\"end\":\"$|(?![-a-z])\",\"name\":\"meta.property-name.media-query.scss\",\"patterns\":[{\"include\":\"source.css#media-features\"},{\"include\":\"source.css#property-names\"}]},{\"begin\":\"(:)\\\\s*(?!(\\\\s*\\\\{))\",\"beginCaptures\":{\"1\":{\"name\":\"punctuation.separator.key-value.scss\"}},\"contentName\":\"meta.property-value.media-query.scss\",\"end\":\"\\\\s*(;|(?=[)}]))\",\"endCaptures\":{\"1\":{\"name\":\"punctuation.terminator.rule.scss\"}},\"patterns\":[{\"include\":\"#general\"},{\"include\":\"#property_values\"}]}]},{\"include\":\"#variable\"},{\"include\":\"#conditional_operators\"},{\"include\":\"source.css#media-types\"}]}]},\"at_rule_mixin\":{\"patterns\":[{\"begin\":\"(?<=@mixin)\\\\s+([-\\\\w]+)\\\\s*(\\\\()\",\"beginCaptures\":{\"1\":{\"name\":\"entity.name.function.scss\"},\"2\":{\"name\":\"punctuation.definition.parameters.begin.bracket.round.scss\"}},\"end\":\"\\\\)\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.parameters.end.bracket.round.scss\"}},\"name\":\"meta.at-rule.mixin.scss\",\"patterns\":[{\"include\":\"#function_attributes\"}]},{\"captures\":{\"1\":{\"name\":\"entity.name.function.scss\"}},\"match\":\"(?<=@mixin)\\\\s+([-\\\\w]+)\",\"name\":\"meta.at-rule.mixin.scss\"},{\"captures\":{\"1\":{\"name\":\"keyword.control.at-rule.mixin.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"match\":\"((@)mixin)\\\\b\",\"name\":\"meta.at-rule.mixin.scss\"}]},\"at_rule_namespace\":{\"patterns\":[{\"begin\":\"(?<=@namespace)\\\\s+(?=url)\",\"end\":\"(?=;|$)\",\"name\":\"meta.at-rule.namespace.scss\",\"patterns\":[{\"include\":\"#property_values\"},{\"include\":\"#string_single\"},{\"include\":\"#string_double\"}]},{\"begin\":\"(?<=@namespace)\\\\s+([-\\\\w]*)\",\"captures\":{\"1\":{\"name\":\"entity.name.namespace-prefix.scss\"}},\"end\":\"(?=;|$)\",\"name\":\"meta.at-rule.namespace.scss\",\"patterns\":[{\"include\":\"#variables\"},{\"include\":\"#property_values\"},{\"include\":\"#string_single\"},{\"include\":\"#string_double\"}]},{\"captures\":{\"1\":{\"name\":\"keyword.control.at-rule.namespace.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"match\":\"((@)namespace)\\\\b\",\"name\":\"meta.at-rule.namespace.scss\"}]},\"at_rule_option\":{\"captures\":{\"1\":{\"name\":\"keyword.control.at-rule.charset.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"match\":\"^\\\\s*((@)option)\\\\b\\\\s*\",\"name\":\"meta.at-rule.option.scss\"},\"at_rule_page\":{\"patterns\":[{\"begin\":\"^\\\\s*((@)page)(?=[:\\\\s])\\\\s*([-:\\\\w]*)\",\"captures\":{\"1\":{\"name\":\"keyword.control.at-rule.page.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"},\"3\":{\"name\":\"entity.name.function.scss\"}},\"end\":\"\\\\s*(?=\\\\{)\",\"name\":\"meta.at-rule.page.scss\"}]},\"at_rule_return\":{\"begin\":\"\\\\s*((@)(return))\\\\b\",\"captures\":{\"1\":{\"name\":\"keyword.control.return.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"end\":\"\\\\s*((?=;))\",\"name\":\"meta.at-rule.return.scss\",\"patterns\":[{\"include\":\"#variable\"},{\"include\":\"#property_values\"}]},\"at_rule_supports\":{\"begin\":\"(?<=^|\\\\s)(@)supports\\\\b\",\"captures\":{\"0\":{\"name\":\"keyword.control.at-rule.supports.scss\"},\"1\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"end\":\"(?=\\\\{)|$\",\"name\":\"meta.at-rule.supports.scss\",\"patterns\":[{\"include\":\"#logical_operators\"},{\"include\":\"#properties\"},{\"match\":\"\\\\(\",\"name\":\"punctuation.definition.condition.begin.bracket.round.scss\"},{\"match\":\"\\\\)\",\"name\":\"punctuation.definition.condition.end.bracket.round.scss\"}]},\"at_rule_use\":{\"begin\":\"\\\\s*((@)use)\\\\b\\\\s*\",\"captures\":{\"1\":{\"name\":\"keyword.control.at-rule.use.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"end\":\"\\\\s*(?=;)\",\"name\":\"meta.at-rule.use.scss\",\"patterns\":[{\"match\":\"\\\\b(as|with)\\\\b\",\"name\":\"keyword.control.operator\"},{\"match\":\"\\\\b[-\\\\w]+\\\\b\",\"name\":\"variable.scss\"},{\"match\":\"\\\\*\",\"name\":\"variable.language.expanded-namespace.scss\"},{\"include\":\"#string_single\"},{\"include\":\"#string_double\"},{\"include\":\"#comment_line\"},{\"include\":\"#comment_block\"},{\"begin\":\"\\\\(\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.parameters.begin.bracket.round.scss\"}},\"end\":\"\\\\)\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.parameters.end.bracket.round.scss\"}},\"patterns\":[{\"include\":\"#function_attributes\"}]}]},\"at_rule_warn\":{\"begin\":\"\\\\s*((@)(warn|debug|error))\\\\b\\\\s*\",\"captures\":{\"1\":{\"name\":\"keyword.control.warn.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"end\":\"\\\\s*(?=;)\",\"name\":\"meta.at-rule.warn.scss\",\"patterns\":[{\"include\":\"#variable\"},{\"include\":\"#string_double\"},{\"include\":\"#string_single\"}]},\"at_rule_while\":{\"begin\":\"\\\\s*((@)while)\\\\b\\\\s*\",\"captures\":{\"1\":{\"name\":\"keyword.control.while.scss\"},\"2\":{\"name\":\"punctuation.definition.keyword.scss\"}},\"end\":\"\\\\s*(?=})\",\"name\":\"meta.at-rule.while.scss\",\"patterns\":[{\"include\":\"#conditional_operators\"},{\"include\":\"#variable\"},{\"include\":\"#property_values\"},{\"include\":\"$self\"}]},\"comment_block\":{\"begin\":\"/\\\\*\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.comment.scss\"}},\"end\":\"\\\\*/\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.comment.scss\"}},\"name\":\"comment.block.scss\"},\"comment_docblock\":{\"begin\":\"///\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.comment.scss\"}},\"end\":\"(?=$)\",\"name\":\"comment.block.documentation.scss\",\"patterns\":[{\"include\":\"source.sassdoc\"}]},\"comment_line\":{\"begin\":\"//\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.comment.scss\"}},\"end\":\"\\\\n\",\"name\":\"comment.line.scss\"},\"comparison_operators\":{\"match\":\"==|!=|<=|>=|[<>]\",\"name\":\"keyword.operator.comparison.scss\"},\"conditional_operators\":{\"patterns\":[{\"include\":\"#comparison_operators\"},{\"include\":\"#logical_operators\"}]},\"constant_default\":{\"match\":\"!default\",\"name\":\"keyword.other.default.scss\"},\"constant_functions\":{\"begin\":\"(?:([-\\\\w]+)(\\\\.))?([-\\\\w]+)(\\\\()\",\"beginCaptures\":{\"1\":{\"name\":\"variable.scss\"},\"2\":{\"name\":\"punctuation.access.module.scss\"},\"3\":{\"name\":\"support.function.misc.scss\"},\"4\":{\"name\":\"punctuation.section.function.scss\"}},\"end\":\"(\\\\))\",\"endCaptures\":{\"1\":{\"name\":\"punctuation.section.function.scss\"}},\"patterns\":[{\"include\":\"#parameters\"}]},\"constant_important\":{\"match\":\"!important\",\"name\":\"keyword.other.important.scss\"},\"constant_mathematical_symbols\":{\"match\":\"\\\\b([-*+/])\\\\b\",\"name\":\"support.constant.mathematical-symbols.scss\"},\"constant_optional\":{\"match\":\"!optional\",\"name\":\"keyword.other.optional.scss\"},\"constant_sass_functions\":{\"begin\":\"(headings|stylesheet-url|rgba?|hsla?|ie-hex-str|red|green|blue|alpha|opacity|hue|saturation|lightness|prefixed|prefix|-moz|-svg|-css2|-pie|-webkit|-ms|font-(?:files|url)|grid-image|image-(?:width|height|url|color)|sprites?|sprite-(?:map|map-name|file|url|position)|inline-(?:font-files|image)|opposite-position|grad-point|grad-end-position|color-stops|color-stops-in-percentages|grad-color-stops|(?:radial|linear)-(?:|svg-)gradient|opacify|fade-?in|transparentize|fade-?out|lighten|darken|saturate|desaturate|grayscale|adjust-(?:hue|lightness|saturation|color)|scale-(?:lightness|saturation|color)|change-color|spin|complement|invert|mix|-compass-(?:list|space-list|slice|nth|list-size)|blank|compact|nth|first-value-of|join|length|append|nest|append-selector|headers|enumerate|range|percentage|unitless|unit|if|type-of|comparable|elements-of-type|quote|unquote|escape|e|sin|cos|tan|abs|round|ceil|floor|pi|translate[XY])(\\\\()\",\"beginCaptures\":{\"1\":{\"name\":\"support.function.misc.scss\"},\"2\":{\"name\":\"punctuation.section.function.scss\"}},\"end\":\"(\\\\))\",\"endCaptures\":{\"1\":{\"name\":\"punctuation.section.function.scss\"}},\"patterns\":[{\"include\":\"#parameters\"}]},\"flow_control\":{\"patterns\":[{\"include\":\"#at_rule_if\"},{\"include\":\"#at_rule_else\"},{\"include\":\"#at_rule_warn\"},{\"include\":\"#at_rule_for\"},{\"include\":\"#at_rule_while\"},{\"include\":\"#at_rule_each\"},{\"include\":\"#at_rule_return\"}]},\"function_attributes\":{\"patterns\":[{\"match\":\":\",\"name\":\"punctuation.separator.key-value.scss\"},{\"include\":\"#general\"},{\"include\":\"#property_values\"},{\"match\":\"[;=?@{}]\",\"name\":\"invalid.illegal.scss\"}]},\"functions\":{\"patterns\":[{\"begin\":\"([-\\\\w]+)(\\\\()\\\\s*\",\"beginCaptures\":{\"1\":{\"name\":\"support.function.misc.scss\"},\"2\":{\"name\":\"punctuation.section.function.scss\"}},\"end\":\"(\\\\))\",\"endCaptures\":{\"1\":{\"name\":\"punctuation.section.function.scss\"}},\"patterns\":[{\"include\":\"#parameters\"}]},{\"match\":\"([-\\\\w]+)\",\"name\":\"support.function.misc.scss\"}]},\"general\":{\"patterns\":[{\"include\":\"#variable\"},{\"include\":\"#comment_docblock\"},{\"include\":\"#comment_block\"},{\"include\":\"#comment_line\"}]},\"interpolation\":{\"begin\":\"#\\\\{\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.interpolation.begin.bracket.curly.scss\"}},\"end\":\"}\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.interpolation.end.bracket.curly.scss\"}},\"name\":\"variable.interpolation.scss\",\"patterns\":[{\"include\":\"#variable\"},{\"include\":\"#property_values\"}]},\"logical_operators\":{\"match\":\"\\\\b(not|or|and)\\\\b\",\"name\":\"keyword.operator.logical.scss\"},\"map\":{\"begin\":\"\\\\(\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.map.begin.bracket.round.scss\"}},\"end\":\"\\\\)\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.map.end.bracket.round.scss\"}},\"name\":\"meta.definition.variable.map.scss\",\"patterns\":[{\"include\":\"#comment_docblock\"},{\"include\":\"#comment_block\"},{\"include\":\"#comment_line\"},{\"captures\":{\"1\":{\"name\":\"support.type.map.key.scss\"},\"2\":{\"name\":\"punctuation.separator.key-value.scss\"}},\"match\":\"\\\\b([-\\\\w]+)\\\\s*(:)\"},{\"match\":\",\",\"name\":\"punctuation.separator.delimiter.scss\"},{\"include\":\"#map\"},{\"include\":\"#variable\"},{\"include\":\"#property_values\"}]},\"operators\":{\"match\":\"[-*+/](?!\\\\s*[-*+/])\",\"name\":\"keyword.operator.css\"},\"parameters\":{\"patterns\":[{\"include\":\"#variable\"},{\"begin\":\"\\\\(\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.begin.bracket.round.scss\"}},\"end\":\"\\\\)\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.end.bracket.round.scss\"}},\"patterns\":[{\"include\":\"#function_attributes\"}]},{\"include\":\"#property_values\"},{\"include\":\"#comment_block\"},{\"match\":\"[^\\\\t \\\"'),]+\",\"name\":\"variable.parameter.url.scss\"},{\"match\":\",\",\"name\":\"punctuation.separator.delimiter.scss\"}]},\"parent_selector_suffix\":{\"captures\":{\"1\":{\"name\":\"punctuation.definition.entity.css\"},\"2\":{\"patterns\":[{\"include\":\"#interpolation\"},{\"match\":\"\\\\\\\\(\\\\h{1,6}|.)\",\"name\":\"constant.character.escape.scss\"},{\"match\":\"[$}]\",\"name\":\"invalid.illegal.identifier.scss\"}]}},\"match\":\"(?<=&)((?:[-0-9A-Z_a-z[^\\\\x00-\\\\x7F]]|\\\\\\\\(?:\\\\h{1,6}|.)|#\\\\{|[$}])+)(?=$|[#)+,.:>\\\\[{|~\\\\s]|/\\\\*)\",\"name\":\"entity.other.attribute-name.parent-selector-suffix.css\"},\"properties\":{\"patterns\":[{\"begin\":\"(?<![-a-z])(?=[-a-z])\",\"end\":\"$|(?![-a-z])\",\"name\":\"meta.property-name.scss\",\"patterns\":[{\"include\":\"source.css#property-names\"},{\"include\":\"#at_rule_include\"}]},{\"begin\":\"(:)\\\\s*(?!(\\\\s*\\\\{))\",\"beginCaptures\":{\"1\":{\"name\":\"punctuation.separator.key-value.scss\"}},\"contentName\":\"meta.property-value.scss\",\"end\":\"\\\\s*(;|(?=[)}]))\",\"endCaptures\":{\"1\":{\"name\":\"punctuation.terminator.rule.scss\"}},\"patterns\":[{\"include\":\"#general\"},{\"include\":\"#property_values\"}]}]},\"property_list\":{\"begin\":\"\\\\{\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.section.property-list.begin.bracket.curly.scss\"}},\"end\":\"}\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.section.property-list.end.bracket.curly.scss\"}},\"name\":\"meta.property-list.scss\",\"patterns\":[{\"include\":\"#flow_control\"},{\"include\":\"#rules\"},{\"include\":\"#properties\"},{\"include\":\"$self\"}]},\"property_values\":{\"patterns\":[{\"include\":\"#string_single\"},{\"include\":\"#string_double\"},{\"include\":\"#constant_functions\"},{\"include\":\"#constant_sass_functions\"},{\"include\":\"#constant_important\"},{\"include\":\"#constant_default\"},{\"include\":\"#constant_optional\"},{\"include\":\"source.css#numeric-values\"},{\"include\":\"source.css#property-keywords\"},{\"include\":\"source.css#color-keywords\"},{\"include\":\"source.css#property-names\"},{\"include\":\"#constant_mathematical_symbols\"},{\"include\":\"#operators\"},{\"begin\":\"\\\\(\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.begin.bracket.round.scss\"}},\"end\":\"\\\\)\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.end.bracket.round.scss\"}},\"patterns\":[{\"include\":\"#general\"},{\"include\":\"#property_values\"}]}]},\"rules\":{\"patterns\":[{\"include\":\"#general\"},{\"include\":\"#at_rule_extend\"},{\"include\":\"#at_rule_content\"},{\"include\":\"#at_rule_include\"},{\"include\":\"#at_rule_media\"},{\"include\":\"#selectors\"}]},\"selector_attribute\":{\"captures\":{\"1\":{\"name\":\"punctuation.definition.attribute-selector.begin.bracket.square.scss\"},\"2\":{\"name\":\"entity.other.attribute-name.attribute.scss\",\"patterns\":[{\"include\":\"#interpolation\"},{\"match\":\"\\\\\\\\(\\\\h{1,6}|.)\",\"name\":\"constant.character.escape.scss\"},{\"match\":\"[$}]\",\"name\":\"invalid.illegal.scss\"}]},\"3\":{\"name\":\"keyword.operator.scss\"},\"4\":{\"name\":\"string.unquoted.attribute-value.scss\",\"patterns\":[{\"include\":\"#interpolation\"},{\"match\":\"\\\\\\\\(\\\\h{1,6}|.)\",\"name\":\"constant.character.escape.scss\"},{\"match\":\"[$}]\",\"name\":\"invalid.illegal.scss\"}]},\"5\":{\"name\":\"string.quoted.double.attribute-value.scss\"},\"6\":{\"name\":\"punctuation.definition.string.begin.scss\"},\"7\":{\"patterns\":[{\"include\":\"#interpolation\"},{\"match\":\"\\\\\\\\(\\\\h{1,6}|.)\",\"name\":\"constant.character.escape.scss\"},{\"match\":\"[$}]\",\"name\":\"invalid.illegal.scss\"}]},\"8\":{\"name\":\"punctuation.definition.string.end.scss\"},\"9\":{\"name\":\"string.quoted.single.attribute-value.scss\"},\"10\":{\"name\":\"punctuation.definition.string.begin.scss\"},\"11\":{\"patterns\":[{\"include\":\"#interpolation\"},{\"match\":\"\\\\\\\\(\\\\h{1,6}|.)\",\"name\":\"constant.character.escape.scss\"},{\"match\":\"[$}]\",\"name\":\"invalid.illegal.scss\"}]},\"12\":{\"name\":\"punctuation.definition.string.end.scss\"},\"13\":{\"name\":\"punctuation.definition.attribute-selector.end.bracket.square.scss\"}},\"match\":\"(?i)(\\\\[)\\\\s*((?:[-0-9A-Z_a-z[^\\\\x00-\\\\x7F]]|\\\\\\\\(?:\\\\h{1,6}|.)|#\\\\{|\\\\.?\\\\$|})+?)(?:\\\\s*([$*^|~]?=)\\\\s*(?:((?:[-0-9A-Z_a-z[^\\\\x00-\\\\x7F]]|\\\\\\\\(?:\\\\h{1,6}|.)|#\\\\{|\\\\.?\\\\$|})+)|((\\\")(.*?)(\\\"))|((')(.*?)('))))?\\\\s*(])\",\"name\":\"meta.attribute-selector.scss\"},\"selector_class\":{\"captures\":{\"1\":{\"name\":\"punctuation.definition.entity.css\"},\"2\":{\"patterns\":[{\"include\":\"#interpolation\"},{\"match\":\"\\\\\\\\(\\\\h{1,6}|.)\",\"name\":\"constant.character.escape.scss\"},{\"match\":\"[$}]\",\"name\":\"invalid.illegal.scss\"}]}},\"match\":\"(\\\\.)((?:[-0-9A-Z_a-z[^\\\\x00-\\\\x7F]]|\\\\\\\\(?:\\\\h{1,6}|.)|#\\\\{|\\\\.?\\\\$|})+)(?=$|[#)+,:>\\\\[{|~\\\\s]|\\\\.[^$]|/\\\\*|;)\",\"name\":\"entity.other.attribute-name.class.css\"},\"selector_custom\":{\"match\":\"\\\\b([0-9A-Za-z]+(-[0-9A-Za-z]+)+)(?=\\\\.|\\\\s++[^:]|\\\\s*[,\\\\[{]|:(link|visited|hover|active|focus|target|lang|disabled|enabled|checked|indeterminate|root|nth-((?:|last-)(?:child|of-type))|first-child|last-child|first-of-type|last-of-type|only-child|only-of-type|empty|not|valid|invalid)(\\\\([0-9A-Za-z]*\\\\))?)\",\"name\":\"entity.name.tag.custom.scss\"},\"selector_id\":{\"captures\":{\"1\":{\"name\":\"punctuation.definition.entity.css\"},\"2\":{\"patterns\":[{\"include\":\"#interpolation\"},{\"match\":\"\\\\\\\\(\\\\h{1,6}|.)\",\"name\":\"constant.character.escape.scss\"},{\"match\":\"[$}]\",\"name\":\"invalid.illegal.identifier.scss\"}]}},\"match\":\"(#)((?:[-0-9A-Z_a-z[^\\\\x00-\\\\x7F]]|\\\\\\\\(?:\\\\h{1,6}|.)|#\\\\{|\\\\.?\\\\$|})+)(?=$|[#)+,:>\\\\[{|~\\\\s]|\\\\.[^$]|/\\\\*)\",\"name\":\"entity.other.attribute-name.id.css\"},\"selector_placeholder\":{\"captures\":{\"1\":{\"name\":\"punctuation.definition.entity.css\"},\"2\":{\"patterns\":[{\"include\":\"#interpolation\"},{\"match\":\"\\\\\\\\(\\\\h{1,6}|.)\",\"name\":\"constant.character.escape.scss\"},{\"match\":\"[$}]\",\"name\":\"invalid.illegal.identifier.scss\"}]}},\"match\":\"(%)((?:[-0-9A-Z_a-z[^\\\\x00-\\\\x7F]]|\\\\\\\\(?:\\\\h{1,6}|.)|#\\\\{|\\\\.\\\\$|[$}])+)(?=;|$|[#)+,:>\\\\[{|~\\\\s]|\\\\.[^$]|/\\\\*)\",\"name\":\"entity.other.attribute-name.placeholder.css\"},\"selector_pseudo_class\":{\"patterns\":[{\"begin\":\"((:)\\\\bnth-(?:|last-)(?:child|of-type))(\\\\()\",\"beginCaptures\":{\"1\":{\"name\":\"entity.other.attribute-name.pseudo-class.css\"},\"2\":{\"name\":\"punctuation.definition.entity.css\"},\"3\":{\"name\":\"punctuation.definition.pseudo-class.begin.bracket.round.css\"}},\"end\":\"\\\\)\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.pseudo-class.end.bracket.round.css\"}},\"patterns\":[{\"include\":\"#interpolation\"},{\"match\":\"\\\\d+\",\"name\":\"constant.numeric.css\"},{\"match\":\"(?:(?<=\\\\d)n|\\\\b(n|even|odd))\\\\b\",\"name\":\"constant.other.scss\"},{\"match\":\"\\\\w+\",\"name\":\"invalid.illegal.scss\"}]},{\"include\":\"source.css#pseudo-classes\"},{\"include\":\"source.css#pseudo-elements\"},{\"include\":\"source.css#functional-pseudo-classes\"}]},\"selectors\":{\"patterns\":[{\"include\":\"source.css#tag-names\"},{\"include\":\"#selector_custom\"},{\"include\":\"#selector_class\"},{\"include\":\"#selector_id\"},{\"include\":\"#selector_pseudo_class\"},{\"include\":\"#tag_wildcard\"},{\"include\":\"#tag_parent_reference\"},{\"include\":\"source.css#pseudo-elements\"},{\"include\":\"#selector_attribute\"},{\"include\":\"#selector_placeholder\"},{\"include\":\"#parent_selector_suffix\"}]},\"string_double\":{\"begin\":\"\\\"\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.string.begin.scss\"}},\"end\":\"\\\"\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.string.end.scss\"}},\"name\":\"string.quoted.double.scss\",\"patterns\":[{\"match\":\"\\\\\\\\(\\\\h{1,6}|.)\",\"name\":\"constant.character.escape.scss\"},{\"include\":\"#interpolation\"}]},\"string_single\":{\"begin\":\"'\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.string.begin.scss\"}},\"end\":\"'\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.string.end.scss\"}},\"name\":\"string.quoted.single.scss\",\"patterns\":[{\"match\":\"\\\\\\\\(\\\\h{1,6}|.)\",\"name\":\"constant.character.escape.scss\"},{\"include\":\"#interpolation\"}]},\"tag_parent_reference\":{\"match\":\"&\",\"name\":\"entity.name.tag.reference.scss\"},\"tag_wildcard\":{\"match\":\"\\\\*\",\"name\":\"entity.name.tag.wildcard.scss\"},\"variable\":{\"patterns\":[{\"include\":\"#variables\"},{\"include\":\"#interpolation\"}]},\"variable_setting\":{\"begin\":\"(?=\\\\$[-\\\\w]+\\\\s*:)\",\"contentName\":\"meta.definition.variable.scss\",\"end\":\";\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.terminator.rule.scss\"}},\"patterns\":[{\"match\":\"\\\\$[-\\\\w]+(?=\\\\s*:)\",\"name\":\"variable.scss\"},{\"begin\":\":\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.separator.key-value.scss\"}},\"end\":\"(?=;)\",\"patterns\":[{\"include\":\"#comment_docblock\"},{\"include\":\"#comment_block\"},{\"include\":\"#comment_line\"},{\"include\":\"#map\"},{\"include\":\"#property_values\"},{\"include\":\"#variable\"},{\"match\":\",\",\"name\":\"punctuation.separator.delimiter.scss\"}]}]},\"variables\":{\"patterns\":[{\"captures\":{\"1\":{\"name\":\"variable.scss\"},\"2\":{\"name\":\"punctuation.access.module.scss\"},\"3\":{\"name\":\"variable.scss\"}},\"match\":\"\\\\b([-\\\\w]+)(\\\\.)(\\\\$[-\\\\w]+)\\\\b\"},{\"match\":\"(\\\\$|--)[-0-9A-Z_a-z]+\\\\b\",\"name\":\"variable.scss\"}]}},\"scopeName\":\"source.css.scss\",\"embeddedLangs\":[\"css\"]}"));
|
|
11299
|
+
var scss_default = [...css_default, lang$1];
|
|
11300
|
+
var toml_default = [Object.freeze(JSON.parse("{\"displayName\":\"TOML\",\"fileTypes\":[\"toml\"],\"name\":\"toml\",\"patterns\":[{\"include\":\"#comments\"},{\"include\":\"#groups\"},{\"include\":\"#key_pair\"},{\"include\":\"#invalid\"}],\"repository\":{\"comments\":{\"begin\":\"(^[\\\\t ]+)?(?=#)\",\"beginCaptures\":{\"1\":{\"name\":\"punctuation.whitespace.comment.leading.toml\"}},\"end\":\"(?!\\\\G)\",\"patterns\":[{\"begin\":\"#\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.comment.toml\"}},\"end\":\"\\\\n\",\"name\":\"comment.line.number-sign.toml\"}]},\"groups\":{\"patterns\":[{\"captures\":{\"1\":{\"name\":\"punctuation.definition.section.begin.toml\"},\"2\":{\"patterns\":[{\"match\":\"[^.\\\\s]+\",\"name\":\"entity.name.section.toml\"}]},\"3\":{\"name\":\"punctuation.definition.section.begin.toml\"}},\"match\":\"^\\\\s*(\\\\[)([^]\\\\[]*)(])\",\"name\":\"meta.group.toml\"},{\"captures\":{\"1\":{\"name\":\"punctuation.definition.section.begin.toml\"},\"2\":{\"patterns\":[{\"match\":\"[^.\\\\s]+\",\"name\":\"entity.name.section.toml\"}]},\"3\":{\"name\":\"punctuation.definition.section.begin.toml\"}},\"match\":\"^\\\\s*(\\\\[\\\\[)([^]\\\\[]*)(]])\",\"name\":\"meta.group.double.toml\"}]},\"invalid\":{\"match\":\"\\\\S+(\\\\s*(?=\\\\S))?\",\"name\":\"invalid.illegal.not-allowed-here.toml\"},\"key_pair\":{\"patterns\":[{\"begin\":\"([-0-9A-Z_a-z]+)\\\\s*(=)\\\\s*\",\"captures\":{\"1\":{\"name\":\"variable.other.key.toml\"},\"2\":{\"name\":\"punctuation.separator.key-value.toml\"}},\"end\":\"(?<=\\\\S)(?<!=)|$\",\"patterns\":[{\"include\":\"#primatives\"}]},{\"begin\":\"((\\\")(.*?)(\\\"))\\\\s*(=)\\\\s*\",\"captures\":{\"1\":{\"name\":\"variable.other.key.toml\"},\"2\":{\"name\":\"punctuation.definition.variable.begin.toml\"},\"3\":{\"patterns\":[{\"match\":\"\\\\\\\\([\\\"\\\\\\\\bfnrt]|u\\\\h{4}|U\\\\h{8})\",\"name\":\"constant.character.escape.toml\"},{\"match\":\"\\\\\\\\[^\\\"\\\\\\\\bfnrt]\",\"name\":\"invalid.illegal.escape.toml\"},{\"match\":\"\\\"\",\"name\":\"invalid.illegal.not-allowed-here.toml\"}]},\"4\":{\"name\":\"punctuation.definition.variable.end.toml\"},\"5\":{\"name\":\"punctuation.separator.key-value.toml\"}},\"end\":\"(?<=\\\\S)(?<!=)|$\",\"patterns\":[{\"include\":\"#primatives\"}]},{\"begin\":\"((')([^']*)('))\\\\s*(=)\\\\s*\",\"captures\":{\"1\":{\"name\":\"variable.other.key.toml\"},\"2\":{\"name\":\"punctuation.definition.variable.begin.toml\"},\"4\":{\"name\":\"punctuation.definition.variable.end.toml\"},\"5\":{\"name\":\"punctuation.separator.key-value.toml\"}},\"end\":\"(?<=\\\\S)(?<!=)|$\",\"patterns\":[{\"include\":\"#primatives\"}]},{\"begin\":\"(((?:[-0-9A-Z_a-z]+|\\\"(?:[^\\\"\\\\\\\\]|\\\\\\\\.)*\\\"|'[^']*')(?:\\\\s*\\\\.\\\\s*|(?=\\\\s*=))){2,})\\\\s*(=)\\\\s*\",\"captures\":{\"1\":{\"name\":\"variable.other.key.toml\",\"patterns\":[{\"match\":\"\\\\.\",\"name\":\"punctuation.separator.variable.toml\"},{\"captures\":{\"1\":{\"name\":\"punctuation.definition.variable.begin.toml\"},\"2\":{\"patterns\":[{\"match\":\"\\\\\\\\([\\\"\\\\\\\\bfnrt]|u\\\\h{4}|U\\\\h{8})\",\"name\":\"constant.character.escape.toml\"},{\"match\":\"\\\\\\\\[^\\\"\\\\\\\\bfnrt]\",\"name\":\"invalid.illegal.escape.toml\"}]},\"3\":{\"name\":\"punctuation.definition.variable.end.toml\"}},\"match\":\"(\\\")((?:[^\\\"\\\\\\\\]|\\\\\\\\.)*)(\\\")\"},{\"captures\":{\"1\":{\"name\":\"punctuation.definition.variable.begin.toml\"},\"2\":{\"name\":\"punctuation.definition.variable.end.toml\"}},\"match\":\"(')[^']*(')\"}]},\"3\":{\"name\":\"punctuation.separator.key-value.toml\"}},\"end\":\"(?<=\\\\S)(?<!=)|$\",\"patterns\":[{\"include\":\"#primatives\"}]}]},\"primatives\":{\"patterns\":[{\"begin\":\"\\\\G\\\"\\\"\\\"\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.string.begin.toml\"}},\"end\":\"\\\"{3,5}\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.string.end.toml\"}},\"name\":\"string.quoted.triple.double.toml\",\"patterns\":[{\"match\":\"\\\\\\\\([\\\"\\\\\\\\bfnrt]|u\\\\h{4}|U\\\\h{8})\",\"name\":\"constant.character.escape.toml\"},{\"match\":\"\\\\\\\\[^\\\\n\\\"\\\\\\\\bfnrt]\",\"name\":\"invalid.illegal.escape.toml\"}]},{\"begin\":\"\\\\G\\\"\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.string.begin.toml\"}},\"end\":\"\\\"\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.string.end.toml\"}},\"name\":\"string.quoted.double.toml\",\"patterns\":[{\"match\":\"\\\\\\\\([\\\"\\\\\\\\bfnrt]|u\\\\h{4}|U\\\\h{8})\",\"name\":\"constant.character.escape.toml\"},{\"match\":\"\\\\\\\\[^\\\"\\\\\\\\bfnrt]\",\"name\":\"invalid.illegal.escape.toml\"}]},{\"begin\":\"\\\\G'''\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.string.begin.toml\"}},\"end\":\"'{3,5}\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.string.end.toml\"}},\"name\":\"string.quoted.triple.single.toml\"},{\"begin\":\"\\\\G'\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.string.begin.toml\"}},\"end\":\"'\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.string.end.toml\"}},\"name\":\"string.quoted.single.toml\"},{\"match\":\"\\\\G[0-9]{4}-(0[1-9]|1[012])-(?!00|3[2-9])[0-3][0-9]([ Tt](?!2[5-9])[012][0-9]:[0-5][0-9]:(?!6[1-9])[0-6][0-9](\\\\.[0-9]+)?(Z|[-+](?!2[5-9])[012][0-9]:[0-5][0-9])?)?\",\"name\":\"constant.other.date.toml\"},{\"match\":\"\\\\G(?!2[5-9])[012][0-9]:[0-5][0-9]:(?!6[1-9])[0-6][0-9](\\\\.[0-9]+)?\",\"name\":\"constant.other.time.toml\"},{\"match\":\"\\\\G(true|false)\",\"name\":\"constant.language.boolean.toml\"},{\"match\":\"\\\\G0x\\\\h(_??\\\\h)*\",\"name\":\"constant.numeric.hex.toml\"},{\"match\":\"\\\\G0o[0-7]([0-7]|_[0-7])*\",\"name\":\"constant.numeric.octal.toml\"},{\"match\":\"\\\\G0b[01]([01]|_[01])*\",\"name\":\"constant.numeric.binary.toml\"},{\"match\":\"\\\\G[-+]?(inf|nan)\",\"name\":\"constant.numeric.toml\"},{\"match\":\"\\\\G([-+]?(0|([1-9](([0-9]|_[0-9])+)?)))(?=[.Ee])(\\\\.([0-9](([0-9]|_[0-9])+)?))?([Ee]([-+]?[0-9](([0-9]|_[0-9])+)?))?\",\"name\":\"constant.numeric.float.toml\"},{\"match\":\"\\\\G([-+]?(0|([1-9](([0-9]|_[0-9])+)?)))\",\"name\":\"constant.numeric.integer.toml\"},{\"begin\":\"\\\\G\\\\[\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.array.begin.toml\"}},\"end\":\"]\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.array.end.toml\"}},\"name\":\"meta.array.toml\",\"patterns\":[{\"begin\":\"(?=[\\\"']|[-+]?[0-9]|[-+]?(inf|nan)|true|false|[\\\\[{])\",\"end\":\",|(?=])\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.separator.array.toml\"}},\"patterns\":[{\"include\":\"#primatives\"},{\"include\":\"#comments\"},{\"include\":\"#invalid\"}]},{\"include\":\"#comments\"},{\"include\":\"#invalid\"}]},{\"begin\":\"\\\\G\\\\{\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.definition.inline-table.begin.toml\"}},\"end\":\"}\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.definition.inline-table.end.toml\"}},\"name\":\"meta.inline-table.toml\",\"patterns\":[{\"begin\":\"(?=\\\\S)\",\"end\":\",|(?=})\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.separator.inline-table.toml\"}},\"patterns\":[{\"include\":\"#key_pair\"}]},{\"include\":\"#comments\"}]}]}},\"scopeName\":\"source.toml\"}"))];
|
|
11299
11301
|
//#endregion
|
|
11300
11302
|
//#region lib/types/client/highlight.js
|
|
11301
11303
|
/**
|
|
@@ -11309,6 +11311,34 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
11309
11311
|
* never an error.
|
|
11310
11312
|
* @module dsh-diff-approval/client/highlight
|
|
11311
11313
|
*/
|
|
11314
|
+
/**
|
|
11315
|
+
* Tokenize guards: the viewer must never let the synchronous JS-regex engine
|
|
11316
|
+
* block the main thread on a hostile file. Lines above the length cap are
|
|
11317
|
+
* returned plain by shiki, the per-line budget caps a single pathological
|
|
11318
|
+
* line, and whole files above the size/line caps skip highlighting entirely
|
|
11319
|
+
* (the diff still shows its added/deleted coloring). Company-workload files
|
|
11320
|
+
* (generated bundles, minified output, huge data dumps) otherwise stall the
|
|
11321
|
+
* tab for tens of seconds and can OOM it.
|
|
11322
|
+
*/
|
|
11323
|
+
const MAX_LINE_LENGTH = 2e3;
|
|
11324
|
+
const TOKENIZE_TIME_LIMIT_MS = 100;
|
|
11325
|
+
const MAX_HIGHLIGHT_CHARS = 3e5;
|
|
11326
|
+
const MAX_HIGHLIGHT_LINES = 1e4;
|
|
11327
|
+
/**
|
|
11328
|
+
* Bounded tokenize cache keyed by the code string: reselecting a recently
|
|
11329
|
+
* viewed file (or a file whose content reference reappears) reuses the runs
|
|
11330
|
+
* instead of re-running the engine. Insertion-ordered, so the oldest entry is
|
|
11331
|
+
* evicted first; 16 codes bounds both memory and the eviction cost.
|
|
11332
|
+
*/
|
|
11333
|
+
const TOKENIZE_CACHE_MAX = 16;
|
|
11334
|
+
const tokenizeCache = /* @__PURE__ */ new Map();
|
|
11335
|
+
/** Whether `code` is too large to highlight safely (short-circuits fast). */
|
|
11336
|
+
function tooLargeToHighlight(code) {
|
|
11337
|
+
if (code.length > MAX_HIGHLIGHT_CHARS) return true;
|
|
11338
|
+
let newlines = 0;
|
|
11339
|
+
for (let index = 0; index < code.length; index++) if (code.charCodeAt(index) === 10 && ++newlines > MAX_HIGHLIGHT_LINES) return true;
|
|
11340
|
+
return false;
|
|
11341
|
+
}
|
|
11312
11342
|
/** All grammars this bundle registers; each entry's own `name` is the tokenize id. */
|
|
11313
11343
|
const LANGS = [
|
|
11314
11344
|
c_default,
|
|
@@ -11325,14 +11355,75 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
11325
11355
|
python_default,
|
|
11326
11356
|
ruby_default,
|
|
11327
11357
|
rust_default,
|
|
11328
|
-
|
|
11358
|
+
scss_default,
|
|
11329
11359
|
shellscript_default,
|
|
11330
11360
|
sql_default,
|
|
11331
|
-
|
|
11361
|
+
toml_default,
|
|
11332
11362
|
typescript_default,
|
|
11333
11363
|
xml_default,
|
|
11334
11364
|
yaml_default
|
|
11335
11365
|
];
|
|
11366
|
+
/**
|
|
11367
|
+
* Primary grammar ids offered in the viewer's language selector, in picker
|
|
11368
|
+
* order (alphabetical). Kept explicit instead of deriving from `LANGS`: some
|
|
11369
|
+
* `@shikijs/langs` modules are composite grammars whose `.name` arrays expose
|
|
11370
|
+
* embedded sub-grammars (e.g. C++ → `[regexp, glsl, cpp-macro, cpp]`,
|
|
11371
|
+
* TypeScript → `[typescript, jsx, tsx, graphql]`), which would otherwise leak
|
|
11372
|
+
* ids like `regexp`, `glsl`, `haml` into the menu. `LANGS` still registers the
|
|
11373
|
+
* full grammars (including their embedded languages) for highlighting.
|
|
11374
|
+
*/
|
|
11375
|
+
const HIGHLIGHT_LANGS = [
|
|
11376
|
+
"c",
|
|
11377
|
+
"cpp",
|
|
11378
|
+
"csharp",
|
|
11379
|
+
"css",
|
|
11380
|
+
"go",
|
|
11381
|
+
"html",
|
|
11382
|
+
"ini",
|
|
11383
|
+
"java",
|
|
11384
|
+
"json",
|
|
11385
|
+
"lua",
|
|
11386
|
+
"markdown",
|
|
11387
|
+
"python",
|
|
11388
|
+
"ruby",
|
|
11389
|
+
"rust",
|
|
11390
|
+
"scss",
|
|
11391
|
+
"shellscript",
|
|
11392
|
+
"sql",
|
|
11393
|
+
"toml",
|
|
11394
|
+
"typescript",
|
|
11395
|
+
"xml",
|
|
11396
|
+
"yaml"
|
|
11397
|
+
];
|
|
11398
|
+
/** Display names for the grammar ids: shiki ids are lowercase, so the picker
|
|
11399
|
+
and trigger show conventional casing ("TypeScript", "C#", "Shell", …). */
|
|
11400
|
+
const LANGUAGE_DISPLAY_NAMES = {
|
|
11401
|
+
c: "C",
|
|
11402
|
+
cpp: "C++",
|
|
11403
|
+
csharp: "C#",
|
|
11404
|
+
css: "CSS",
|
|
11405
|
+
go: "Go",
|
|
11406
|
+
html: "HTML",
|
|
11407
|
+
ini: "INI",
|
|
11408
|
+
java: "Java",
|
|
11409
|
+
json: "JSON",
|
|
11410
|
+
lua: "Lua",
|
|
11411
|
+
markdown: "Markdown",
|
|
11412
|
+
python: "Python",
|
|
11413
|
+
ruby: "Ruby",
|
|
11414
|
+
rust: "Rust",
|
|
11415
|
+
scss: "SCSS",
|
|
11416
|
+
shellscript: "Shell",
|
|
11417
|
+
sql: "SQL",
|
|
11418
|
+
toml: "TOML",
|
|
11419
|
+
typescript: "TypeScript",
|
|
11420
|
+
xml: "XML",
|
|
11421
|
+
yaml: "YAML"
|
|
11422
|
+
};
|
|
11423
|
+
/** Conventional display name for a grammar id, falling back to the id itself. */
|
|
11424
|
+
function languageDisplayName(id) {
|
|
11425
|
+
return LANGUAGE_DISPLAY_NAMES[id] ?? id;
|
|
11426
|
+
}
|
|
11336
11427
|
/** All token colors resolve through `--shiki-*` custom properties (theme package sheets). */
|
|
11337
11428
|
const cssVariablesTheme = createCssVariablesTheme({
|
|
11338
11429
|
name: "css-variables",
|
|
@@ -11400,15 +11491,31 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
11400
11491
|
function highlightLines(code, lang) {
|
|
11401
11492
|
if (lang === void 0 || code === "") return void 0;
|
|
11402
11493
|
if (!highlighter().getLoadedLanguages().includes(lang)) return void 0;
|
|
11494
|
+
if (tooLargeToHighlight(code)) return void 0;
|
|
11495
|
+
const cached = tokenizeCache.get(code)?.get(lang);
|
|
11496
|
+
if (cached !== void 0) return cached;
|
|
11403
11497
|
const { tokens } = highlighter().codeToTokens(code, {
|
|
11404
11498
|
lang,
|
|
11405
|
-
theme: "css-variables"
|
|
11499
|
+
theme: "css-variables",
|
|
11500
|
+
tokenizeTimeLimit: TOKENIZE_TIME_LIMIT_MS,
|
|
11501
|
+
tokenizeMaxLineLength: MAX_LINE_LENGTH
|
|
11406
11502
|
});
|
|
11407
11503
|
const last = tokens[tokens.length - 1];
|
|
11408
|
-
|
|
11504
|
+
const runs = (tokens.length > 1 && last !== void 0 && last.length === 0 ? tokens.slice(0, -1) : tokens).map((line) => line.map((token) => ({
|
|
11409
11505
|
text: token.content,
|
|
11410
11506
|
style: { color: token.color }
|
|
11411
11507
|
})));
|
|
11508
|
+
let byLang = tokenizeCache.get(code);
|
|
11509
|
+
if (byLang === void 0) {
|
|
11510
|
+
if (tokenizeCache.size >= TOKENIZE_CACHE_MAX) {
|
|
11511
|
+
const oldest = tokenizeCache.keys().next().value;
|
|
11512
|
+
if (oldest !== void 0) tokenizeCache.delete(oldest);
|
|
11513
|
+
}
|
|
11514
|
+
byLang = /* @__PURE__ */ new Map();
|
|
11515
|
+
tokenizeCache.set(code, byLang);
|
|
11516
|
+
}
|
|
11517
|
+
byLang.set(lang, runs);
|
|
11518
|
+
return runs;
|
|
11412
11519
|
}
|
|
11413
11520
|
//#endregion
|
|
11414
11521
|
//#region lib/types/client/lang.js
|
|
@@ -11485,7 +11592,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
11485
11592
|
* @param path - the path to shorten.
|
|
11486
11593
|
* @returns the segment after the final separator.
|
|
11487
11594
|
*/
|
|
11488
|
-
function basenameOf(path) {
|
|
11595
|
+
function basenameOf$1(path) {
|
|
11489
11596
|
const normalized = path.replaceAll("\\", "/");
|
|
11490
11597
|
return normalized.slice(normalized.lastIndexOf("/") + 1);
|
|
11491
11598
|
}
|
|
@@ -11497,8 +11604,8 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
11497
11604
|
* @returns the display path for a copied reference.
|
|
11498
11605
|
*/
|
|
11499
11606
|
function copyDisplayPath(path, files) {
|
|
11500
|
-
const base = basenameOf(path);
|
|
11501
|
-
return files.some((file) => file.path !== path && basenameOf(file.path) === base) ? path : base;
|
|
11607
|
+
const base = basenameOf$1(path);
|
|
11608
|
+
return files.some((file) => file.path !== path && basenameOf$1(file.path) === base) ? path : base;
|
|
11502
11609
|
}
|
|
11503
11610
|
/**
|
|
11504
11611
|
* Format one line range as a reference suffix: a single line number, or the
|
|
@@ -11522,8 +11629,8 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
11522
11629
|
return `${copyDisplayPath(path, files)}:${lineRangeLabel(start, end)}`;
|
|
11523
11630
|
}
|
|
11524
11631
|
//#endregion
|
|
11525
|
-
//#region \0dsh-css
|
|
11526
|
-
const css = ".
|
|
11632
|
+
//#region \0dsh-css:/home/runner/work/dsh-diff-approval/dsh-diff-approval/src/client/PendingPanel.module.css.mjs
|
|
11633
|
+
const css = ".F1KBNa_layer{box-sizing:border-box;flex:none;align-items:center;width:calc(100% + 8px);height:42px;margin:4px -4px;display:flex;position:relative}.F1KBNa_footerButtons{align-items:center;width:100%;display:flex}.F1KBNa_badge{box-sizing:border-box;width:100%;height:42px;color:var(--dsw-alias-label-primary);cursor:pointer;background:0 0;border:none;border-radius:12px;align-items:center;gap:8px;padding:0 10px 0 8px;font-family:inherit;font-size:14px;line-height:22px;display:flex;overflow:hidden}.F1KBNa_badge:hover{background:var(--dsw-alias-interactive-bg-hover)}.F1KBNa_badge[data-active]{background:var(--dsw-alias-interactive-bg-hover-solid)}.F1KBNa_badgeLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.F1KBNa_badgeCount{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex:none;margin-left:auto;font-size:12px;line-height:16px}.F1KBNa_layer.F1KBNa_rail{width:36px;height:36px;margin:8px 0 10px}.F1KBNa_rail .F1KBNa_badge{border-radius:50%;justify-content:center;gap:0;width:36px;height:36px;padding:0}.F1KBNa_rail .F1KBNa_badgeLabel{display:none}.F1KBNa_rail .F1KBNa_badgeCount{box-sizing:border-box;background:var(--dsw-alias-state-business-primary);min-width:18px;height:18px;color:var(--dsw-alias-label-primary-foreground);font-variant-numeric:tabular-nums;border-radius:9px;justify-content:center;align-items:center;padding:0 4px;font-size:11px;line-height:18px;display:flex;position:absolute;top:-3px;right:-7px}.F1KBNa_panel{z-index:30;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);width:auto;max-width:none;box-shadow:var(--dsw-shadow-lv2);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-radius:12px;flex-direction:column;display:flex;position:fixed;inset:8px 8px 128px;overflow:hidden}.F1KBNa_header{box-sizing:border-box;border-bottom:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);flex:none;justify-content:space-between;align-items:center;min-height:44px;padding:10px 12px;display:flex}.F1KBNa_headerActions{align-items:center;gap:2px;display:flex}.F1KBNa_states{flex:1;min-height:0;padding:4px 12px 12px;overflow-y:auto}.F1KBNa_split{flex:1;align-items:stretch;min-height:0;display:flex}.F1KBNa_fileList{box-sizing:border-box;border-right:1px solid var(--dsw-alias-border-l2);flex:none;width:240px;min-height:0;padding:4px 8px 12px;overflow-y:auto}.F1KBNa_resizeHandle{cursor:col-resize;background:0 0;flex:none;width:5px;margin:0 -2px}.F1KBNa_resizeHandle:hover{background:var(--dsw-alias-border-l2)}.F1KBNa_detail{flex-direction:column;flex:1;min-width:0;min-height:0;display:flex}.F1KBNa_detailEmpty{color:var(--dsw-alias-label-tertiary);text-align:center;flex:1;justify-content:center;align-items:center;margin:0;padding:24px;font-size:12px;line-height:18px;display:flex}.F1KBNa_title{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;line-height:20px}.F1KBNa_note,.F1KBNa_readError,.F1KBNa_hint{color:var(--dsw-alias-label-tertiary);margin:4px 0;font-size:12px;line-height:18px}.F1KBNa_readError{color:var(--dsw-alias-state-error-primary)}.F1KBNa_group{color:var(--dsw-alias-label-tertiary);margin:8px 0 4px;font-size:12px;font-weight:500;line-height:16px}.F1KBNa_rows{margin:0;padding:0;list-style:none}.F1KBNa_row{border:1px solid #0000;border-radius:10px;margin:2px 0}.F1KBNa_rowHead{width:100%;color:var(--dsw-alias-label-primary);font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;border-radius:10px;align-items:baseline;gap:8px;padding:6px 8px;display:flex}.F1KBNa_rowHead:hover{background:var(--dsw-alias-interactive-bg-hover-solid)}.F1KBNa_rowHead[data-selected]{background:var(--dsw-alias-interactive-bg-hover)}.F1KBNa_rowPath{text-overflow:ellipsis;white-space:nowrap;min-width:0;font:var(--dsw-font-markdown-code-block);overflow:hidden}.F1KBNa_kindTag{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-tertiary);white-space:nowrap;border-radius:6px;flex:none;padding:1px 6px;font-size:11px;line-height:14px}.F1KBNa_kindHint{color:var(--dsw-alias-label-tertiary);flex:none;font-size:12px;line-height:16px}.F1KBNa_divergedHint,.F1KBNa_missingHint{border-bottom:1px solid var(--dsw-alias-border-l2);margin:0;padding:6px 8px;font-size:12px;line-height:18px}.F1KBNa_missing{border:1px solid var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-state-warn-label,var(--dsw-alias-state-warn-primary));white-space:nowrap;border-radius:6px;flex:none;padding:1px 6px;font-size:11px;line-height:14px}.F1KBNa_missingHint{color:var(--dsw-alias-state-warn-label,var(--dsw-alias-state-warn-primary))}.F1KBNa_rowMeta{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex:none;gap:6px;margin-left:auto;font-size:12px;line-height:16px;display:inline-flex}.F1KBNa_addCount{color:color-mix(in srgb, var(--dsw-alias-state-success-primary) 60%, var(--dsw-alias-label-primary))}.F1KBNa_delCount{color:color-mix(in srgb, var(--dsw-alias-state-error-primary) 60%, var(--dsw-alias-label-primary))}.F1KBNa_diff{background:var(--dsw-alias-markdown-code-block);flex-direction:column;flex:1;min-height:0;display:flex;position:relative;overflow:hidden}.F1KBNa_diffHeader{border-bottom:1px solid var(--dsw-alias-border-l2);align-items:center;gap:8px;padding:6px 8px;display:flex}.F1KBNa_diffPath{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-primary);font:var(--dsw-font-markdown-code-block);flex:1;font-size:12px;line-height:18px;overflow:hidden}.F1KBNa_diffActions{border-bottom:1px solid var(--dsw-alias-border-l2);align-items:center;gap:8px;padding:6px 8px;display:flex}.F1KBNa_diffStats{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px;line-height:16px}.F1KBNa_flexSpacer{flex:1}.F1KBNa_action{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-primary);cursor:pointer;background:0 0;border-radius:8px;padding:3px 12px;font-family:inherit;font-size:12px;line-height:18px}.F1KBNa_action:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.F1KBNa_action:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.F1KBNa_iconAction{justify-content:center;align-items:center;padding:4px 6px;display:inline-flex}.F1KBNa_close{cursor:pointer;width:28px;height:28px;color:var(--dsw-alias-label-tertiary);background:0 0;border:none;border-radius:28px;justify-content:center;align-items:center;padding:0;display:inline-flex}.F1KBNa_close:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.F1KBNa_expand{cursor:pointer;width:28px;height:28px;color:var(--dsw-alias-label-tertiary);background:0 0;border:none;border-radius:28px;justify-content:center;align-items:center;padding:0;display:inline-flex}.F1KBNa_expand:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.F1KBNa_expandExpanded svg{transform:rotate(180deg)}.F1KBNa_diffBodyWrap{flex:1;min-height:0;display:flex;position:relative}.F1KBNa_diffBody{min-width:0;font:var(--dsw-font-markdown-code-block);flex:1;padding:8px 10px;overflow:auto}.F1KBNa_overviewRuler{pointer-events:none;opacity:.5;width:8px;position:absolute;top:0;bottom:0;right:0}.F1KBNa_overviewMarker{border-radius:2px;width:100%;min-height:2px;position:absolute;right:0}.F1KBNa_markerDel{background-color:var(--dsw-alias-state-error-primary)}.F1KBNa_markerAdd{background-color:var(--dsw-alias-state-success-primary)}.F1KBNa_lines{border-spacing:0;width:max-content;min-width:100%;display:table}.F1KBNa_line{height:22px;line-height:22px;display:table-row}.F1KBNa_vSpacer{display:table-row}.F1KBNa_gutter{box-sizing:border-box;text-align:right;width:44px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;user-select:none;padding-right:10px;display:table-cell}.F1KBNa_code{white-space:pre;display:table-cell}.F1KBNa_context{color:var(--dsw-alias-label-primary)}.F1KBNa_del{background-color:color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent)}.F1KBNa_add{background-color:color-mix(in srgb, var(--dsw-alias-state-success-primary) 10%, transparent)}.F1KBNa_statusBar{box-sizing:border-box;border-top:1px solid var(--dsw-alias-border-l2);height:34px;color:var(--dsw-alias-label-tertiary);font-family:var(--dsw-font-markdown-code-block);font-variant-numeric:tabular-nums;flex:none;align-items:center;padding:0 8px;font-size:12px;line-height:18px;display:flex}.F1KBNa_statusAction{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-primary);white-space:nowrap;cursor:pointer;background:0 0;border-radius:8px;padding:3px 12px;font-family:inherit;font-size:12px;line-height:18px}.F1KBNa_statusAction:hover{background:var(--dsw-alias-interactive-bg-hover)}.F1KBNa_langSelect{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-primary);cursor:pointer;background:0 0;border-radius:8px;flex:none;align-items:center;gap:4px;padding:3px 12px;font-family:inherit;font-size:12px;line-height:18px;display:inline-flex}.F1KBNa_langSelect:hover{background:var(--dsw-alias-interactive-bg-hover)}.F1KBNa_langLabel{text-overflow:ellipsis;white-space:nowrap;max-width:140px;overflow:hidden}";
|
|
11527
11634
|
const tagId = "dsh-diff-approval/PendingPanel.module.css";
|
|
11528
11635
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
11529
11636
|
const tag = document.createElement("style");
|
|
@@ -11533,53 +11640,67 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
11533
11640
|
document.head.appendChild(tag);
|
|
11534
11641
|
}
|
|
11535
11642
|
var PendingPanel_module_css_default = {
|
|
11536
|
-
"
|
|
11537
|
-
"
|
|
11538
|
-
"
|
|
11539
|
-
"
|
|
11540
|
-
"
|
|
11541
|
-
"
|
|
11542
|
-
"
|
|
11543
|
-
"
|
|
11544
|
-
"
|
|
11545
|
-
"
|
|
11546
|
-
"
|
|
11547
|
-
"
|
|
11548
|
-
"
|
|
11549
|
-
"
|
|
11550
|
-
"
|
|
11551
|
-
"
|
|
11552
|
-
"
|
|
11553
|
-
"
|
|
11554
|
-
"
|
|
11555
|
-
"
|
|
11556
|
-
"
|
|
11557
|
-
"
|
|
11558
|
-
"
|
|
11559
|
-
"
|
|
11560
|
-
"
|
|
11561
|
-
"
|
|
11562
|
-
"title": "
|
|
11563
|
-
"
|
|
11564
|
-
"
|
|
11565
|
-
"
|
|
11566
|
-
"
|
|
11567
|
-
"
|
|
11568
|
-
"
|
|
11569
|
-
"
|
|
11570
|
-
"
|
|
11571
|
-
"
|
|
11572
|
-
"
|
|
11573
|
-
"
|
|
11574
|
-
"
|
|
11575
|
-
"
|
|
11576
|
-
"
|
|
11577
|
-
"
|
|
11578
|
-
"
|
|
11579
|
-
"
|
|
11580
|
-
"
|
|
11581
|
-
"
|
|
11582
|
-
"
|
|
11643
|
+
"code": "F1KBNa_code",
|
|
11644
|
+
"diffBodyWrap": "F1KBNa_diffBodyWrap",
|
|
11645
|
+
"badge": "F1KBNa_badge",
|
|
11646
|
+
"readError": "F1KBNa_readError",
|
|
11647
|
+
"diff": "F1KBNa_diff",
|
|
11648
|
+
"markerDel": "F1KBNa_markerDel",
|
|
11649
|
+
"group": "F1KBNa_group",
|
|
11650
|
+
"divergedHint": "F1KBNa_divergedHint",
|
|
11651
|
+
"detailEmpty": "F1KBNa_detailEmpty",
|
|
11652
|
+
"iconAction": "F1KBNa_iconAction",
|
|
11653
|
+
"diffBody": "F1KBNa_diffBody",
|
|
11654
|
+
"rowPath": "F1KBNa_rowPath",
|
|
11655
|
+
"addCount": "F1KBNa_addCount",
|
|
11656
|
+
"vSpacer": "F1KBNa_vSpacer",
|
|
11657
|
+
"add": "F1KBNa_add",
|
|
11658
|
+
"overviewMarker": "F1KBNa_overviewMarker",
|
|
11659
|
+
"panel": "F1KBNa_panel",
|
|
11660
|
+
"del": "F1KBNa_del",
|
|
11661
|
+
"row": "F1KBNa_row",
|
|
11662
|
+
"kindHint": "F1KBNa_kindHint",
|
|
11663
|
+
"layer": "F1KBNa_layer",
|
|
11664
|
+
"rowMeta": "F1KBNa_rowMeta",
|
|
11665
|
+
"resizeHandle": "F1KBNa_resizeHandle",
|
|
11666
|
+
"footerButtons": "F1KBNa_footerButtons",
|
|
11667
|
+
"rowHead": "F1KBNa_rowHead",
|
|
11668
|
+
"close": "F1KBNa_close",
|
|
11669
|
+
"title": "F1KBNa_title",
|
|
11670
|
+
"overviewRuler": "F1KBNa_overviewRuler",
|
|
11671
|
+
"lines": "F1KBNa_lines",
|
|
11672
|
+
"missingHint": "F1KBNa_missingHint",
|
|
11673
|
+
"diffPath": "F1KBNa_diffPath",
|
|
11674
|
+
"detail": "F1KBNa_detail",
|
|
11675
|
+
"states": "F1KBNa_states",
|
|
11676
|
+
"headerActions": "F1KBNa_headerActions",
|
|
11677
|
+
"fileList": "F1KBNa_fileList",
|
|
11678
|
+
"langSelect": "F1KBNa_langSelect",
|
|
11679
|
+
"expand": "F1KBNa_expand",
|
|
11680
|
+
"langLabel": "F1KBNa_langLabel",
|
|
11681
|
+
"statusAction": "F1KBNa_statusAction",
|
|
11682
|
+
"badgeLabel": "F1KBNa_badgeLabel",
|
|
11683
|
+
"diffActions": "F1KBNa_diffActions",
|
|
11684
|
+
"flexSpacer": "F1KBNa_flexSpacer",
|
|
11685
|
+
"kindTag": "F1KBNa_kindTag",
|
|
11686
|
+
"gutter": "F1KBNa_gutter",
|
|
11687
|
+
"markerAdd": "F1KBNa_markerAdd",
|
|
11688
|
+
"rows": "F1KBNa_rows",
|
|
11689
|
+
"delCount": "F1KBNa_delCount",
|
|
11690
|
+
"context": "F1KBNa_context",
|
|
11691
|
+
"action": "F1KBNa_action",
|
|
11692
|
+
"statusBar": "F1KBNa_statusBar",
|
|
11693
|
+
"badgeCount": "F1KBNa_badgeCount",
|
|
11694
|
+
"diffHeader": "F1KBNa_diffHeader",
|
|
11695
|
+
"diffStats": "F1KBNa_diffStats",
|
|
11696
|
+
"split": "F1KBNa_split",
|
|
11697
|
+
"line": "F1KBNa_line",
|
|
11698
|
+
"expandExpanded": "F1KBNa_expandExpanded",
|
|
11699
|
+
"rail": "F1KBNa_rail",
|
|
11700
|
+
"note": "F1KBNa_note",
|
|
11701
|
+
"missing": "F1KBNa_missing",
|
|
11702
|
+
"header": "F1KBNa_header",
|
|
11703
|
+
"hint": "F1KBNa_hint"
|
|
11583
11704
|
};
|
|
11584
11705
|
//#endregion
|
|
11585
11706
|
//#region lib/types/client/PendingPanel.js
|
|
@@ -11595,17 +11716,72 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
11595
11716
|
const FALLBACK_BOTTOM_PX = 128;
|
|
11596
11717
|
/** Gap kept between the composer's top edge and the panel bottom, in px. */
|
|
11597
11718
|
const COMPOSER_GAP_PX = 12;
|
|
11598
|
-
/**
|
|
11599
|
-
const
|
|
11719
|
+
/** Fixed window-edge inset used when expanded, mirroring `.panel`'s top/left/right. */
|
|
11720
|
+
const PANEL_INSET_PX = 8;
|
|
11721
|
+
/** The harness composer seat (conversation scroll body + seat div). */
|
|
11722
|
+
const SCROLL_SELECTOR = "[data-conversation-scroll]";
|
|
11723
|
+
const SEAT_SELECTOR = "[data-composer-seat]";
|
|
11724
|
+
/** Seat height ui-conversation publishes for floating controls (its own seat observer). */
|
|
11725
|
+
const COMPOSER_HEIGHT_VAR = "--dsh-composer-height";
|
|
11726
|
+
/** Interactive composer/approval cards; clicking these keeps the panel open.
|
|
11727
|
+
Deliberately the cards themselves, not the seat: the approval frame's wide
|
|
11728
|
+
side gutters are blank space, so a click there must still close. */
|
|
11729
|
+
const KEEP_OPEN_SELECTOR = "[data-composer-card],[data-question-key] > *,[data-plan-review-key] > *";
|
|
11730
|
+
/** Seat counts as docked when its bottom is this close to the window bottom. */
|
|
11731
|
+
const DOCKED_TOLERANCE_PX = 48;
|
|
11600
11732
|
/** File-list pane width bounds for the manual split drag, in px. */
|
|
11601
11733
|
const MIN_LIST_WIDTH_PX = 160;
|
|
11602
11734
|
const MAX_LIST_WIDTH_PX = 560;
|
|
11735
|
+
/** Fixed diff-row height in px; the virtual window and jump math are built on it. */
|
|
11736
|
+
const ROW_HEIGHT_PX = 22;
|
|
11737
|
+
/** Rows rendered beyond the visible window in each direction. */
|
|
11738
|
+
const OVERSCAN_ROWS = 8;
|
|
11739
|
+
/** The trailing file-name segment of a path, used for row display. */
|
|
11740
|
+
function basenameOf(path) {
|
|
11741
|
+
const index = Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"));
|
|
11742
|
+
return index < 0 ? path : path.slice(index + 1);
|
|
11743
|
+
}
|
|
11603
11744
|
/** The diff body's row class per line kind. */
|
|
11604
11745
|
const ROW_CLASS = {
|
|
11605
11746
|
context: PendingPanel_module_css_default.context,
|
|
11606
11747
|
del: PendingPanel_module_css_default.del,
|
|
11607
11748
|
add: PendingPanel_module_css_default.add
|
|
11608
11749
|
};
|
|
11750
|
+
/**
|
|
11751
|
+
* One rendered diff row, memoized so a poll or an unrelated state change
|
|
11752
|
+
* does not re-render rows whose content, highlight, and focus are unchanged.
|
|
11753
|
+
*/
|
|
11754
|
+
const DiffRow = (0, react.memo)(function DiffRow(props) {
|
|
11755
|
+
const { index, row, runs, focused } = props;
|
|
11756
|
+
const lineNumber = row.kind === "del" ? row.oldLine : row.newLine;
|
|
11757
|
+
const sideRuns = row.kind === "del" ? runs?.oldRuns : runs?.newRuns;
|
|
11758
|
+
const lineRuns = lineNumber === void 0 ? void 0 : sideRuns?.[lineNumber - 1];
|
|
11759
|
+
const content = lineRuns === void 0 || lineRuns.length === 0 ? row.text === "" ? "\xA0" : row.text : lineRuns.map((span, spanIndex) => (0, react_jsx_runtime.jsx)("span", {
|
|
11760
|
+
style: span.style,
|
|
11761
|
+
children: span.text
|
|
11762
|
+
}, spanIndex));
|
|
11763
|
+
return (0, react_jsx_runtime.jsxs)("div", {
|
|
11764
|
+
className: `${PendingPanel_module_css_default.line} ${ROW_CLASS[row.kind]}`,
|
|
11765
|
+
"data-diff-line": row.kind,
|
|
11766
|
+
"data-diff-row": index,
|
|
11767
|
+
"data-diff-focused": focused ? "" : void 0,
|
|
11768
|
+
children: [
|
|
11769
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
11770
|
+
className: PendingPanel_module_css_default.gutter,
|
|
11771
|
+
children: row.oldLine ?? ""
|
|
11772
|
+
}),
|
|
11773
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
11774
|
+
className: PendingPanel_module_css_default.gutter,
|
|
11775
|
+
children: row.newLine ?? ""
|
|
11776
|
+
}),
|
|
11777
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
11778
|
+
className: PendingPanel_module_css_default.code,
|
|
11779
|
+
"data-diff-code": true,
|
|
11780
|
+
children: content
|
|
11781
|
+
})
|
|
11782
|
+
]
|
|
11783
|
+
});
|
|
11784
|
+
});
|
|
11609
11785
|
/** Split a row list into maximal runs of non-context rows. */
|
|
11610
11786
|
function changeBlocksOf(diff) {
|
|
11611
11787
|
const blocks = [];
|
|
@@ -11627,8 +11803,66 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
11627
11803
|
});
|
|
11628
11804
|
return blocks;
|
|
11629
11805
|
}
|
|
11806
|
+
/** The diff-row index containing a node, or undefined. */
|
|
11807
|
+
function rowIndexAt(node) {
|
|
11808
|
+
if (node === null) return void 0;
|
|
11809
|
+
const row = (node instanceof Element ? node : node.parentElement)?.closest("[data-diff-row]");
|
|
11810
|
+
if (row === null || row === void 0) return void 0;
|
|
11811
|
+
const index = Number(row.dataset.diffRow);
|
|
11812
|
+
return Number.isFinite(index) ? index : void 0;
|
|
11813
|
+
}
|
|
11814
|
+
/** Character offset of a selection boundary within its line's code text. */
|
|
11815
|
+
function lineOffsetAt(node, offset) {
|
|
11816
|
+
const code = (node instanceof Element ? node : node.parentElement)?.closest("[data-diff-code]");
|
|
11817
|
+
if (code === null || code === void 0) return 0;
|
|
11818
|
+
let before = 0;
|
|
11819
|
+
const walker = document.createTreeWalker(code, NodeFilter.SHOW_TEXT);
|
|
11820
|
+
let current = walker.nextNode();
|
|
11821
|
+
while (current !== null) {
|
|
11822
|
+
if (current === node) return before + offset;
|
|
11823
|
+
if (node instanceof Element && node.contains(current)) break;
|
|
11824
|
+
before += current.length;
|
|
11825
|
+
current = walker.nextNode();
|
|
11826
|
+
}
|
|
11827
|
+
if (node instanceof Element) {
|
|
11828
|
+
const children = [...node.childNodes];
|
|
11829
|
+
for (let i = 0; i < Math.min(offset, children.length); i++) {
|
|
11830
|
+
const inner = document.createTreeWalker(children[i], NodeFilter.SHOW_TEXT);
|
|
11831
|
+
let text = inner.nextNode();
|
|
11832
|
+
while (text !== null) {
|
|
11833
|
+
before += text.length;
|
|
11834
|
+
text = inner.nextNode();
|
|
11835
|
+
}
|
|
11836
|
+
}
|
|
11837
|
+
}
|
|
11838
|
+
return before;
|
|
11839
|
+
}
|
|
11840
|
+
/** Length of the code text on the line holding a node. */
|
|
11841
|
+
function lineLengthAt(node) {
|
|
11842
|
+
return ((node instanceof Element ? node : node.parentElement)?.closest("[data-diff-code]"))?.textContent?.length ?? 0;
|
|
11843
|
+
}
|
|
11844
|
+
/**
|
|
11845
|
+
* Derive the selected diff-row range from a native text selection. A
|
|
11846
|
+
* boundary sitting exactly at a line edge contributes no content: a start at
|
|
11847
|
+
* the line's end skips to the next line, an end at the line's start falls
|
|
11848
|
+
* back to the previous line.
|
|
11849
|
+
*/
|
|
11850
|
+
function rowRangeOf(selection) {
|
|
11851
|
+
if (selection === null || selection.isCollapsed || selection.rangeCount === 0) return void 0;
|
|
11852
|
+
const range = selection.getRangeAt(0);
|
|
11853
|
+
let start = rowIndexAt(range.startContainer);
|
|
11854
|
+
let end = rowIndexAt(range.endContainer);
|
|
11855
|
+
if (start === void 0 || end === void 0) return void 0;
|
|
11856
|
+
if (lineOffsetAt(range.startContainer, range.startOffset) >= lineLengthAt(range.startContainer)) start += 1;
|
|
11857
|
+
if (lineOffsetAt(range.endContainer, range.endOffset) === 0) end -= 1;
|
|
11858
|
+
if (start > end) return void 0;
|
|
11859
|
+
return {
|
|
11860
|
+
start,
|
|
11861
|
+
end
|
|
11862
|
+
};
|
|
11863
|
+
}
|
|
11630
11864
|
/** One row of the file list: the clickable head in the left pane. */
|
|
11631
|
-
function PendingFileRow({ file,
|
|
11865
|
+
function PendingFileRow({ file, selected, t, onSelect }) {
|
|
11632
11866
|
const stats = (0, react.useMemo)(() => computeWholeFileDiff(file.oldText, file.newText), [file.oldText, file.newText]);
|
|
11633
11867
|
return (0, react_jsx_runtime.jsx)("li", {
|
|
11634
11868
|
className: PendingPanel_module_css_default.row,
|
|
@@ -11637,13 +11871,17 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
11637
11871
|
className: PendingPanel_module_css_default.rowHead,
|
|
11638
11872
|
"data-selected": selected || void 0,
|
|
11639
11873
|
onClick: () => {
|
|
11640
|
-
onSelect(
|
|
11874
|
+
onSelect(file.id);
|
|
11641
11875
|
},
|
|
11642
11876
|
children: [
|
|
11643
|
-
(0, react_jsx_runtime.jsx)(
|
|
11644
|
-
|
|
11645
|
-
|
|
11646
|
-
|
|
11877
|
+
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
11878
|
+
label: file.path,
|
|
11879
|
+
delayMs: 500,
|
|
11880
|
+
maxWidth: 560,
|
|
11881
|
+
children: (0, react_jsx_runtime.jsx)("span", {
|
|
11882
|
+
className: PendingPanel_module_css_default.rowPath,
|
|
11883
|
+
children: basenameOf(file.path)
|
|
11884
|
+
})
|
|
11647
11885
|
}),
|
|
11648
11886
|
file.kind === "create" && (0, react_jsx_runtime.jsx)("span", {
|
|
11649
11887
|
className: PendingPanel_module_css_default.kindTag,
|
|
@@ -11670,129 +11908,226 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
11670
11908
|
}
|
|
11671
11909
|
/** The selected file's diff, actions, jump controls, and copy toolbar. */
|
|
11672
11910
|
function PendingDiff({ file, files, busy, t, onKeep, onRevert, onOpen }) {
|
|
11673
|
-
const
|
|
11911
|
+
const [langOverride, setLangOverride] = (0, react.useState)(void 0);
|
|
11912
|
+
const [langMenuOpen, setLangMenuOpen] = (0, react.useState)(false);
|
|
11913
|
+
const langMenuItems = (0, react.useMemo)(() => [{
|
|
11914
|
+
id: "",
|
|
11915
|
+
label: t("action.langAuto")
|
|
11916
|
+
}, ...HIGHLIGHT_LANGS.map((language) => ({
|
|
11917
|
+
id: language,
|
|
11918
|
+
label: languageDisplayName(language)
|
|
11919
|
+
}))], [t]);
|
|
11920
|
+
const detectedLang = (0, react.useMemo)(() => langFromPath(file.path), [file.path]);
|
|
11921
|
+
const lang = (0, react.useMemo)(() => langOverride ?? detectedLang, [detectedLang, langOverride]);
|
|
11922
|
+
const langLabel = langOverride === void 0 ? detectedLang === void 0 ? t("action.langAuto") : t("action.langAutoDetected", { lang: languageDisplayName(detectedLang) }) : languageDisplayName(langOverride);
|
|
11674
11923
|
const model = (0, react.useMemo)(() => {
|
|
11675
11924
|
const diff = computeWholeFileDiff(file.oldText, file.newText);
|
|
11676
11925
|
return {
|
|
11677
11926
|
diff,
|
|
11678
|
-
blocks: changeBlocksOf(diff)
|
|
11679
|
-
|
|
11680
|
-
|
|
11927
|
+
blocks: changeBlocksOf(diff)
|
|
11928
|
+
};
|
|
11929
|
+
}, [file.oldText, file.newText]);
|
|
11930
|
+
const rulerMarkers = (0, react.useMemo)(() => {
|
|
11931
|
+
const rows = model.diff.rows;
|
|
11932
|
+
const total = rows.length;
|
|
11933
|
+
if (total === 0) return [];
|
|
11934
|
+
const markers = [];
|
|
11935
|
+
let runStart = -1;
|
|
11936
|
+
let runKind = "del";
|
|
11937
|
+
const flush = (end) => {
|
|
11938
|
+
const span = end - runStart + 1;
|
|
11939
|
+
markers.push({
|
|
11940
|
+
top: runStart / total * 100,
|
|
11941
|
+
height: span / total * 100,
|
|
11942
|
+
kind: runKind
|
|
11943
|
+
});
|
|
11944
|
+
};
|
|
11945
|
+
rows.forEach((row, index) => {
|
|
11946
|
+
if (row.kind === "context") {
|
|
11947
|
+
if (runStart !== -1) {
|
|
11948
|
+
flush(index - 1);
|
|
11949
|
+
runStart = -1;
|
|
11950
|
+
}
|
|
11951
|
+
return;
|
|
11952
|
+
}
|
|
11953
|
+
if (runStart === -1) {
|
|
11954
|
+
runStart = index;
|
|
11955
|
+
runKind = row.kind;
|
|
11956
|
+
} else if (row.kind !== runKind) {
|
|
11957
|
+
flush(index - 1);
|
|
11958
|
+
runStart = index;
|
|
11959
|
+
runKind = row.kind;
|
|
11960
|
+
}
|
|
11961
|
+
});
|
|
11962
|
+
if (runStart !== -1) flush(rows.length - 1);
|
|
11963
|
+
return markers;
|
|
11964
|
+
}, [model]);
|
|
11965
|
+
const [runs, setRuns] = (0, react.useState)(void 0);
|
|
11966
|
+
(0, react.useEffect)(() => {
|
|
11967
|
+
setRuns(void 0);
|
|
11968
|
+
const timer = window.setTimeout(() => {
|
|
11969
|
+
setRuns({
|
|
11970
|
+
oldRuns: highlightLines(file.oldText, lang),
|
|
11971
|
+
newRuns: highlightLines(file.newText, lang)
|
|
11972
|
+
});
|
|
11973
|
+
}, 0);
|
|
11974
|
+
return () => {
|
|
11975
|
+
window.clearTimeout(timer);
|
|
11681
11976
|
};
|
|
11682
11977
|
}, [
|
|
11978
|
+
file.id,
|
|
11683
11979
|
file.oldText,
|
|
11684
11980
|
file.newText,
|
|
11685
11981
|
lang
|
|
11686
11982
|
]);
|
|
11687
|
-
const rowRefs = (0, react.useRef)(/* @__PURE__ */ new Map());
|
|
11688
11983
|
const bodyRef = (0, react.useRef)(null);
|
|
11689
11984
|
const [focus, setFocus] = (0, react.useState)(0);
|
|
11690
|
-
const [
|
|
11691
|
-
const [
|
|
11985
|
+
const [scrollTick, setScrollTick] = (0, react.useState)(0);
|
|
11986
|
+
const [scrollTop, setScrollTop] = (0, react.useState)(0);
|
|
11987
|
+
const [viewportHeight, setViewportHeight] = (0, react.useState)(0);
|
|
11988
|
+
const [selection, setSelection] = (0, react.useState)(void 0);
|
|
11692
11989
|
const [copied, setCopied] = (0, react.useState)(false);
|
|
11693
11990
|
(0, react.useEffect)(() => {
|
|
11694
11991
|
setFocus(0);
|
|
11695
|
-
|
|
11696
|
-
|
|
11992
|
+
setScrollTop(0);
|
|
11993
|
+
if (bodyRef.current !== null) bodyRef.current.scrollTop = 0;
|
|
11994
|
+
setSelection(void 0);
|
|
11995
|
+
setLangOverride(void 0);
|
|
11996
|
+
setLangMenuOpen(false);
|
|
11697
11997
|
setCopied(false);
|
|
11698
11998
|
}, [file.id]);
|
|
11999
|
+
const rows = model.diff.rows;
|
|
12000
|
+
const rowCount = rows.length;
|
|
12001
|
+
const viewport = viewportHeight > 0 ? viewportHeight : rowCount * ROW_HEIGHT_PX;
|
|
12002
|
+
const start = Math.max(0, Math.floor(scrollTop / ROW_HEIGHT_PX) - OVERSCAN_ROWS);
|
|
12003
|
+
const end = Math.min(rowCount, Math.ceil((scrollTop + viewport) / ROW_HEIGHT_PX) + OVERSCAN_ROWS);
|
|
12004
|
+
const visibleRows = rows.slice(start, end);
|
|
12005
|
+
const widestLine = (0, react.useMemo)(() => {
|
|
12006
|
+
let widest = 0;
|
|
12007
|
+
for (const row of model.diff.rows) if (row.text.length > widest) widest = row.text.length;
|
|
12008
|
+
return widest;
|
|
12009
|
+
}, [model]);
|
|
12010
|
+
(0, react.useEffect)(() => {
|
|
12011
|
+
const body = bodyRef.current;
|
|
12012
|
+
if (body === null) return;
|
|
12013
|
+
const measure = () => {
|
|
12014
|
+
setViewportHeight(body.clientHeight);
|
|
12015
|
+
};
|
|
12016
|
+
measure();
|
|
12017
|
+
const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
|
|
12018
|
+
observer?.observe(body);
|
|
12019
|
+
return () => {
|
|
12020
|
+
observer?.disconnect();
|
|
12021
|
+
};
|
|
12022
|
+
}, [file.id]);
|
|
11699
12023
|
(0, react.useEffect)(() => {
|
|
11700
|
-
if (
|
|
12024
|
+
if (rowCount === 0) return;
|
|
11701
12025
|
const block = model.blocks[focus];
|
|
11702
12026
|
if (block === void 0) return;
|
|
11703
|
-
|
|
11704
|
-
|
|
12027
|
+
const body = bodyRef.current;
|
|
12028
|
+
if (body === null) return;
|
|
12029
|
+
const target = block.start * ROW_HEIGHT_PX + ROW_HEIGHT_PX / 2 - body.clientHeight / 2;
|
|
12030
|
+
const clamped = Math.max(0, Math.min(target, body.scrollHeight - body.clientHeight));
|
|
12031
|
+
if (body.scrollTop !== clamped) body.scrollTop = clamped;
|
|
12032
|
+
setScrollTop(clamped);
|
|
12033
|
+
}, [
|
|
12034
|
+
model,
|
|
12035
|
+
focus,
|
|
12036
|
+
scrollTick,
|
|
12037
|
+
rowCount
|
|
12038
|
+
]);
|
|
11705
12039
|
const jump = (direction) => {
|
|
12040
|
+
if (rowCount === 0) return;
|
|
11706
12041
|
setFocus((current) => {
|
|
11707
|
-
if (model.blocks.length === 0) return current;
|
|
11708
12042
|
if (direction === -1) return (current - 1 + model.blocks.length) % model.blocks.length;
|
|
11709
|
-
const
|
|
12043
|
+
const top = bodyRef.current?.scrollTop ?? 0;
|
|
11710
12044
|
for (let index = current + 1; index < model.blocks.length; index++) {
|
|
11711
12045
|
const block = model.blocks[index];
|
|
11712
12046
|
if (block === void 0) continue;
|
|
11713
|
-
|
|
11714
|
-
if (row === void 0 || bodyRect === void 0 || row.getBoundingClientRect().top >= bodyRect.top) return index;
|
|
12047
|
+
if (block.start * ROW_HEIGHT_PX >= top) return index;
|
|
11715
12048
|
}
|
|
11716
12049
|
return 0;
|
|
11717
12050
|
});
|
|
12051
|
+
setScrollTick((tick) => tick + 1);
|
|
11718
12052
|
};
|
|
11719
|
-
const
|
|
11720
|
-
if (element === null) rowRefs.current.delete(index);
|
|
11721
|
-
else rowRefs.current.set(index, element);
|
|
11722
|
-
};
|
|
11723
|
-
const rowMouseDown = (index) => (event) => {
|
|
11724
|
-
if (event.button !== 0) return;
|
|
11725
|
-
event.preventDefault();
|
|
11726
|
-
setDrag({
|
|
11727
|
-
anchor: index,
|
|
11728
|
-
end: index
|
|
11729
|
-
});
|
|
11730
|
-
setRange({
|
|
11731
|
-
start: index,
|
|
11732
|
-
end: index
|
|
11733
|
-
});
|
|
11734
|
-
};
|
|
11735
|
-
const rowMouseEnter = (index) => () => {
|
|
11736
|
-
setDrag((current) => {
|
|
11737
|
-
if (current === void 0) return current;
|
|
11738
|
-
const next = {
|
|
11739
|
-
...current,
|
|
11740
|
-
end: index
|
|
11741
|
-
};
|
|
11742
|
-
setRange({
|
|
11743
|
-
start: Math.min(next.anchor, next.end),
|
|
11744
|
-
end: Math.max(next.anchor, next.end)
|
|
11745
|
-
});
|
|
11746
|
-
return next;
|
|
11747
|
-
});
|
|
11748
|
-
};
|
|
11749
|
-
const endDrag = () => {
|
|
11750
|
-
setDrag((current) => {
|
|
11751
|
-
if (current === void 0) return void 0;
|
|
11752
|
-
setRange({
|
|
11753
|
-
start: Math.min(current.anchor, current.end),
|
|
11754
|
-
end: Math.max(current.anchor, current.end)
|
|
11755
|
-
});
|
|
11756
|
-
});
|
|
11757
|
-
};
|
|
11758
|
-
const selection = drag === void 0 && range !== void 0 ? range : void 0;
|
|
11759
|
-
const selectionTop = (() => {
|
|
11760
|
-
if (selection === void 0) return 0;
|
|
11761
|
-
const row = rowRefs.current.get(selection.start);
|
|
12053
|
+
const onScroll = () => {
|
|
11762
12054
|
const body = bodyRef.current;
|
|
11763
|
-
if (
|
|
11764
|
-
|
|
11765
|
-
|
|
11766
|
-
|
|
11767
|
-
|
|
11768
|
-
|
|
11769
|
-
|
|
11770
|
-
|
|
12055
|
+
if (body === null) return;
|
|
12056
|
+
setScrollTop(body.scrollTop);
|
|
12057
|
+
setViewportHeight(body.clientHeight);
|
|
12058
|
+
};
|
|
12059
|
+
(0, react.useEffect)(() => {
|
|
12060
|
+
const update = () => setSelection(rowRangeOf(window.getSelection()));
|
|
12061
|
+
document.addEventListener("selectionchange", update);
|
|
12062
|
+
update();
|
|
12063
|
+
return () => {
|
|
12064
|
+
document.removeEventListener("selectionchange", update);
|
|
12065
|
+
};
|
|
12066
|
+
}, [file.id]);
|
|
12067
|
+
const selectionReference = (() => {
|
|
12068
|
+
if (selection === void 0) return void 0;
|
|
11771
12069
|
const lineNumbers = model.diff.rows.slice(selection.start, selection.end + 1).map((row) => row.newLine ?? row.oldLine).filter((number) => number !== void 0);
|
|
11772
|
-
if (lineNumbers.length === 0) return;
|
|
11773
|
-
|
|
12070
|
+
if (lineNumbers.length === 0) return void 0;
|
|
12071
|
+
return referenceOf(file.path, files, Math.min(...lineNumbers), Math.max(...lineNumbers));
|
|
12072
|
+
})();
|
|
12073
|
+
const copySelection = (0, react.useCallback)(async () => {
|
|
12074
|
+
if (selectionReference === void 0) return;
|
|
12075
|
+
if (!await (0, _deepseek_ai_dsh_client_ui_primitives.writeClipboard)(selectionReference)) return;
|
|
11774
12076
|
setCopied(true);
|
|
11775
12077
|
window.setTimeout(() => {
|
|
11776
12078
|
setCopied(false);
|
|
11777
12079
|
}, 1500);
|
|
11778
|
-
};
|
|
11779
|
-
|
|
11780
|
-
|
|
11781
|
-
|
|
11782
|
-
|
|
11783
|
-
|
|
11784
|
-
|
|
11785
|
-
|
|
11786
|
-
|
|
11787
|
-
|
|
11788
|
-
|
|
12080
|
+
}, [selectionReference]);
|
|
12081
|
+
(0, react.useEffect)(() => {
|
|
12082
|
+
const onKeyDown = (event) => {
|
|
12083
|
+
if (!(event.ctrlKey || event.metaKey) || event.altKey || event.shiftKey) return;
|
|
12084
|
+
if (event.key.toLowerCase() !== "l") return;
|
|
12085
|
+
if (selectionReference === void 0) return;
|
|
12086
|
+
event.preventDefault();
|
|
12087
|
+
copySelection();
|
|
12088
|
+
};
|
|
12089
|
+
document.addEventListener("keydown", onKeyDown);
|
|
12090
|
+
return () => {
|
|
12091
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
12092
|
+
};
|
|
12093
|
+
}, [copySelection]);
|
|
11789
12094
|
const focusedBlock = model.blocks.length > 0 ? model.blocks[focus] : void 0;
|
|
11790
12095
|
const inFocusedBlock = (index) => focusedBlock !== void 0 && index >= focusedBlock.start && index <= focusedBlock.end;
|
|
11791
12096
|
return (0, react_jsx_runtime.jsxs)("div", {
|
|
11792
12097
|
className: PendingPanel_module_css_default.diff,
|
|
11793
12098
|
"data-diff-approval-diff": true,
|
|
11794
|
-
onMouseUp: endDrag,
|
|
11795
12099
|
children: [
|
|
12100
|
+
(0, react_jsx_runtime.jsxs)("div", {
|
|
12101
|
+
className: PendingPanel_module_css_default.diffHeader,
|
|
12102
|
+
children: [
|
|
12103
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
12104
|
+
className: PendingPanel_module_css_default.diffPath,
|
|
12105
|
+
children: file.path
|
|
12106
|
+
}),
|
|
12107
|
+
(0, react_jsx_runtime.jsx)("button", {
|
|
12108
|
+
type: "button",
|
|
12109
|
+
className: `${PendingPanel_module_css_default.action} ${PendingPanel_module_css_default.iconAction}`,
|
|
12110
|
+
"data-diff-open": true,
|
|
12111
|
+
"aria-label": t("action.openFile"),
|
|
12112
|
+
title: t("action.openFile"),
|
|
12113
|
+
onClick: () => {
|
|
12114
|
+
onOpen(file.sessionId, file.id, "open");
|
|
12115
|
+
},
|
|
12116
|
+
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBrowseOutline16, { size: 14 })
|
|
12117
|
+
}),
|
|
12118
|
+
(0, react_jsx_runtime.jsx)("button", {
|
|
12119
|
+
type: "button",
|
|
12120
|
+
className: `${PendingPanel_module_css_default.action} ${PendingPanel_module_css_default.iconAction}`,
|
|
12121
|
+
"data-diff-reveal": true,
|
|
12122
|
+
"aria-label": t("action.revealFile"),
|
|
12123
|
+
title: t("action.revealFile"),
|
|
12124
|
+
onClick: () => {
|
|
12125
|
+
onOpen(file.sessionId, file.id, "reveal");
|
|
12126
|
+
},
|
|
12127
|
+
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFolderOpenOutline16, { size: 14 })
|
|
12128
|
+
})
|
|
12129
|
+
]
|
|
12130
|
+
}),
|
|
11796
12131
|
(0, react_jsx_runtime.jsxs)("div", {
|
|
11797
12132
|
className: PendingPanel_module_css_default.diffActions,
|
|
11798
12133
|
children: [
|
|
@@ -11830,24 +12165,6 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
11830
12165
|
},
|
|
11831
12166
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, { size: 14 })
|
|
11832
12167
|
})] }),
|
|
11833
|
-
(0, react_jsx_runtime.jsx)("button", {
|
|
11834
|
-
type: "button",
|
|
11835
|
-
className: PendingPanel_module_css_default.action,
|
|
11836
|
-
"data-diff-open": true,
|
|
11837
|
-
onClick: () => {
|
|
11838
|
-
onOpen(file.sessionId, file.id, "open");
|
|
11839
|
-
},
|
|
11840
|
-
children: t("action.openFile")
|
|
11841
|
-
}),
|
|
11842
|
-
(0, react_jsx_runtime.jsx)("button", {
|
|
11843
|
-
type: "button",
|
|
11844
|
-
className: PendingPanel_module_css_default.action,
|
|
11845
|
-
"data-diff-reveal": true,
|
|
11846
|
-
onClick: () => {
|
|
11847
|
-
onOpen(file.sessionId, file.id, "reveal");
|
|
11848
|
-
},
|
|
11849
|
-
children: t("action.revealFile")
|
|
11850
|
-
}),
|
|
11851
12168
|
(0, react_jsx_runtime.jsx)("span", { className: PendingPanel_module_css_default.flexSpacer }),
|
|
11852
12169
|
(0, react_jsx_runtime.jsx)("button", {
|
|
11853
12170
|
type: "button",
|
|
@@ -11875,48 +12192,104 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
11875
12192
|
className: PendingPanel_module_css_default.missingHint,
|
|
11876
12193
|
children: t("panel.missingHint")
|
|
11877
12194
|
}),
|
|
11878
|
-
(0, react_jsx_runtime.
|
|
11879
|
-
className: PendingPanel_module_css_default.
|
|
11880
|
-
|
|
11881
|
-
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
|
|
11888
|
-
onMouseDown: rowMouseDown(index),
|
|
11889
|
-
onMouseEnter: rowMouseEnter(index),
|
|
12195
|
+
(0, react_jsx_runtime.jsxs)("div", {
|
|
12196
|
+
className: PendingPanel_module_css_default.diffBodyWrap,
|
|
12197
|
+
children: [(0, react_jsx_runtime.jsx)("div", {
|
|
12198
|
+
className: PendingPanel_module_css_default.diffBody,
|
|
12199
|
+
ref: bodyRef,
|
|
12200
|
+
onScroll,
|
|
12201
|
+
"data-diff-body": true,
|
|
12202
|
+
children: (0, react_jsx_runtime.jsxs)("div", {
|
|
12203
|
+
className: PendingPanel_module_css_default.lines,
|
|
12204
|
+
style: { minWidth: `max(100%, ${widestLine}ch)` },
|
|
11890
12205
|
children: [
|
|
11891
|
-
(0, react_jsx_runtime.jsx)("
|
|
11892
|
-
className: PendingPanel_module_css_default.
|
|
11893
|
-
|
|
12206
|
+
start > 0 && (0, react_jsx_runtime.jsx)("div", {
|
|
12207
|
+
className: PendingPanel_module_css_default.vSpacer,
|
|
12208
|
+
style: { height: start * ROW_HEIGHT_PX },
|
|
12209
|
+
"aria-hidden": "true"
|
|
11894
12210
|
}),
|
|
11895
|
-
(
|
|
11896
|
-
|
|
11897
|
-
|
|
12211
|
+
visibleRows.map((row, offset) => {
|
|
12212
|
+
const index = start + offset;
|
|
12213
|
+
return (0, react_jsx_runtime.jsx)(DiffRow, {
|
|
12214
|
+
index,
|
|
12215
|
+
row,
|
|
12216
|
+
runs,
|
|
12217
|
+
focused: inFocusedBlock(index)
|
|
12218
|
+
}, index);
|
|
11898
12219
|
}),
|
|
11899
|
-
(0, react_jsx_runtime.jsx)("
|
|
11900
|
-
className: PendingPanel_module_css_default.
|
|
11901
|
-
|
|
12220
|
+
end < rowCount && (0, react_jsx_runtime.jsx)("div", {
|
|
12221
|
+
className: PendingPanel_module_css_default.vSpacer,
|
|
12222
|
+
style: { height: (rowCount - end) * ROW_HEIGHT_PX },
|
|
12223
|
+
"aria-hidden": "true"
|
|
11902
12224
|
})
|
|
11903
12225
|
]
|
|
12226
|
+
})
|
|
12227
|
+
}), rulerMarkers.length > 0 && (0, react_jsx_runtime.jsx)("div", {
|
|
12228
|
+
className: PendingPanel_module_css_default.overviewRuler,
|
|
12229
|
+
"data-diff-approval-ruler": true,
|
|
12230
|
+
"aria-hidden": "true",
|
|
12231
|
+
children: rulerMarkers.map((marker, index) => (0, react_jsx_runtime.jsx)("div", {
|
|
12232
|
+
className: `${PendingPanel_module_css_default.overviewMarker} ${marker.kind === "del" ? PendingPanel_module_css_default.markerDel : PendingPanel_module_css_default.markerAdd}`,
|
|
12233
|
+
"data-diff-ruler-marker": marker.kind,
|
|
12234
|
+
style: {
|
|
12235
|
+
top: `${marker.top}%`,
|
|
12236
|
+
height: `${marker.height}%`
|
|
12237
|
+
}
|
|
11904
12238
|
}, index))
|
|
11905
|
-
})
|
|
12239
|
+
})]
|
|
11906
12240
|
}),
|
|
11907
|
-
|
|
11908
|
-
className: PendingPanel_module_css_default.
|
|
11909
|
-
|
|
11910
|
-
|
|
11911
|
-
|
|
11912
|
-
|
|
11913
|
-
|
|
11914
|
-
|
|
11915
|
-
|
|
11916
|
-
|
|
11917
|
-
|
|
11918
|
-
|
|
11919
|
-
|
|
12241
|
+
(0, react_jsx_runtime.jsxs)("div", {
|
|
12242
|
+
className: PendingPanel_module_css_default.statusBar,
|
|
12243
|
+
"data-diff-status-bar": true,
|
|
12244
|
+
children: [
|
|
12245
|
+
selectionReference === void 0 ? null : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
12246
|
+
label: copied ? t("action.copied") : `${t("action.copyHint")} (Ctrl+L)`,
|
|
12247
|
+
side: "top",
|
|
12248
|
+
delayMs: 300,
|
|
12249
|
+
children: (0, react_jsx_runtime.jsx)("button", {
|
|
12250
|
+
type: "button",
|
|
12251
|
+
className: PendingPanel_module_css_default.statusAction,
|
|
12252
|
+
"data-diff-copy": true,
|
|
12253
|
+
onMouseDown: (event) => {
|
|
12254
|
+
event.preventDefault();
|
|
12255
|
+
},
|
|
12256
|
+
onClick: () => {
|
|
12257
|
+
copySelection();
|
|
12258
|
+
},
|
|
12259
|
+
children: copied ? t("action.copied") : selectionReference
|
|
12260
|
+
})
|
|
12261
|
+
}),
|
|
12262
|
+
(0, react_jsx_runtime.jsx)("span", { className: PendingPanel_module_css_default.flexSpacer }),
|
|
12263
|
+
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
|
|
12264
|
+
open: langMenuOpen,
|
|
12265
|
+
portal: true,
|
|
12266
|
+
compact: true,
|
|
12267
|
+
align: "end",
|
|
12268
|
+
items: langMenuItems,
|
|
12269
|
+
selectedId: langOverride ?? "",
|
|
12270
|
+
onSelect: (id) => {
|
|
12271
|
+
setLangOverride(id === "" ? void 0 : id);
|
|
12272
|
+
setLangMenuOpen(false);
|
|
12273
|
+
},
|
|
12274
|
+
onClose: () => {
|
|
12275
|
+
setLangMenuOpen(false);
|
|
12276
|
+
},
|
|
12277
|
+
anchor: (0, react_jsx_runtime.jsxs)("button", {
|
|
12278
|
+
type: "button",
|
|
12279
|
+
className: PendingPanel_module_css_default.langSelect,
|
|
12280
|
+
"data-diff-lang": true,
|
|
12281
|
+
"aria-label": t("action.langSelect"),
|
|
12282
|
+
title: t("action.langSelect"),
|
|
12283
|
+
onClick: () => {
|
|
12284
|
+
setLangMenuOpen((value) => !value);
|
|
12285
|
+
},
|
|
12286
|
+
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
12287
|
+
className: PendingPanel_module_css_default.langLabel,
|
|
12288
|
+
children: langLabel
|
|
12289
|
+
}), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, { size: 12 })]
|
|
12290
|
+
})
|
|
12291
|
+
})
|
|
12292
|
+
]
|
|
11920
12293
|
})
|
|
11921
12294
|
]
|
|
11922
12295
|
});
|
|
@@ -11931,6 +12304,8 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
11931
12304
|
const [openedCount, setOpenedCount] = (0, react.useState)(0);
|
|
11932
12305
|
/** Bottom offset tracking the chat composer's top edge so the input stays visible. */
|
|
11933
12306
|
const [bottomPx, setBottomPx] = (0, react.useState)(FALLBACK_BOTTOM_PX);
|
|
12307
|
+
/** Fullscreen expanded: the panel bottom pins to the window edge, ignoring the composer offset. */
|
|
12308
|
+
const [expanded, setExpanded] = (0, react.useState)(false);
|
|
11934
12309
|
/** File-list pane width, adjustable by dragging the divider. */
|
|
11935
12310
|
const [listWidth, setListWidth] = (0, react.useState)(240);
|
|
11936
12311
|
const resizeDrag = (0, react.useRef)(null);
|
|
@@ -11945,31 +12320,61 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
11945
12320
|
}, [current, onRefresh]);
|
|
11946
12321
|
(0, react.useEffect)(() => {
|
|
11947
12322
|
if (!open) return;
|
|
12323
|
+
const MEASURE_INTERVAL_MS = 400;
|
|
11948
12324
|
const measure = () => {
|
|
11949
|
-
const
|
|
11950
|
-
|
|
11951
|
-
|
|
12325
|
+
const scrollers = document.querySelectorAll(SCROLL_SELECTOR);
|
|
12326
|
+
for (const scroller of scrollers) {
|
|
12327
|
+
const seat = scroller.querySelector(SEAT_SELECTOR);
|
|
12328
|
+
if (seat === null) continue;
|
|
12329
|
+
const seatRect = seat.getBoundingClientRect();
|
|
12330
|
+
if (!(seatRect.bottom >= window.innerHeight - DOCKED_TOLERANCE_PX && seatRect.top > 0 && seatRect.top < window.innerHeight)) continue;
|
|
12331
|
+
const height = Number.parseFloat(scroller.style.getPropertyValue(COMPOSER_HEIGHT_VAR));
|
|
12332
|
+
const clearance = Number.isFinite(height) && height > 0 ? height : window.innerHeight - seatRect.top;
|
|
12333
|
+
setBottomPx(Math.round(clearance) + COMPOSER_GAP_PX);
|
|
11952
12334
|
return;
|
|
11953
12335
|
}
|
|
11954
|
-
|
|
11955
|
-
if (top <= 0) return;
|
|
11956
|
-
setBottomPx(Math.round(window.innerHeight - top) + COMPOSER_GAP_PX);
|
|
12336
|
+
setBottomPx(FALLBACK_BOTTOM_PX);
|
|
11957
12337
|
};
|
|
11958
12338
|
measure();
|
|
11959
|
-
|
|
11960
|
-
const
|
|
11961
|
-
|
|
11962
|
-
const
|
|
11963
|
-
observer.observe(composer);
|
|
12339
|
+
const seats = [...document.querySelectorAll(SEAT_SELECTOR)];
|
|
12340
|
+
const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
|
|
12341
|
+
for (const seat of seats) observer?.observe(seat);
|
|
12342
|
+
const timer = window.setInterval(measure, MEASURE_INTERVAL_MS);
|
|
11964
12343
|
window.addEventListener("resize", measure);
|
|
11965
12344
|
return () => {
|
|
11966
|
-
observer
|
|
12345
|
+
observer?.disconnect();
|
|
12346
|
+
window.clearInterval(timer);
|
|
11967
12347
|
window.removeEventListener("resize", measure);
|
|
11968
12348
|
};
|
|
11969
12349
|
}, [open]);
|
|
12350
|
+
(0, react.useEffect)(() => {
|
|
12351
|
+
if (!open) return;
|
|
12352
|
+
const onPointerDown = (event) => {
|
|
12353
|
+
const target = event.target;
|
|
12354
|
+
if (target === null) return;
|
|
12355
|
+
const element = target instanceof Element ? target : target.parentElement;
|
|
12356
|
+
if (element !== null && (element.closest("[data-diff-approval-panel]") !== null || element.closest("[data-diff-approval-badge]") !== null || element.closest(KEEP_OPEN_SELECTOR) !== null)) return;
|
|
12357
|
+
setOpen(false);
|
|
12358
|
+
};
|
|
12359
|
+
document.addEventListener("pointerdown", onPointerDown, true);
|
|
12360
|
+
return () => {
|
|
12361
|
+
document.removeEventListener("pointerdown", onPointerDown, true);
|
|
12362
|
+
};
|
|
12363
|
+
}, [open]);
|
|
11970
12364
|
const files = snapshot.files;
|
|
11971
12365
|
const mine = files.filter((file) => file.sessionId === current);
|
|
11972
12366
|
const theirs = files.filter((file) => file.sessionId !== current);
|
|
12367
|
+
(0, react.useEffect)(() => {
|
|
12368
|
+
if (!open) return;
|
|
12369
|
+
if (selected !== "" && files.some((file) => file.id === selected)) return;
|
|
12370
|
+
const next = [...mine, ...theirs][0];
|
|
12371
|
+
if (next !== void 0 && next.id !== selected) setSelected(next.id);
|
|
12372
|
+
}, [
|
|
12373
|
+
open,
|
|
12374
|
+
current,
|
|
12375
|
+
files,
|
|
12376
|
+
selected
|
|
12377
|
+
]);
|
|
11973
12378
|
(0, react.useEffect)(() => {
|
|
11974
12379
|
if (open && openedCount > 0 && snapshot.read && snapshot.error === void 0 && files.length === 0) {
|
|
11975
12380
|
setOpenedCount(0);
|
|
@@ -11988,7 +12393,6 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
11988
12393
|
};
|
|
11989
12394
|
const renderEntry = (entry) => (0, react_jsx_runtime.jsx)(PendingFileRow, {
|
|
11990
12395
|
file: entry,
|
|
11991
|
-
files,
|
|
11992
12396
|
selected: selected === entry.id,
|
|
11993
12397
|
t,
|
|
11994
12398
|
onSelect: setSelected
|
|
@@ -12024,15 +12428,38 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
12024
12428
|
className: wide ? PendingPanel_module_css_default.layer : `${PendingPanel_module_css_default.layer} ${PendingPanel_module_css_default.rail}`,
|
|
12025
12429
|
children: [open && (0, react_jsx_runtime.jsxs)("section", {
|
|
12026
12430
|
className: PendingPanel_module_css_default.panel,
|
|
12027
|
-
style: { bottom: bottomPx },
|
|
12431
|
+
style: { bottom: expanded ? PANEL_INSET_PX : bottomPx },
|
|
12028
12432
|
"data-diff-approval-panel": true,
|
|
12029
12433
|
"aria-label": t("panel.title"),
|
|
12030
|
-
children: [(0, react_jsx_runtime.
|
|
12434
|
+
children: [(0, react_jsx_runtime.jsxs)("header", {
|
|
12031
12435
|
className: PendingPanel_module_css_default.header,
|
|
12032
|
-
children: (0, react_jsx_runtime.jsx)("span", {
|
|
12436
|
+
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
12033
12437
|
className: PendingPanel_module_css_default.title,
|
|
12034
12438
|
children: t("panel.title")
|
|
12035
|
-
})
|
|
12439
|
+
}), (0, react_jsx_runtime.jsxs)("div", {
|
|
12440
|
+
className: PendingPanel_module_css_default.headerActions,
|
|
12441
|
+
children: [(0, react_jsx_runtime.jsx)("button", {
|
|
12442
|
+
type: "button",
|
|
12443
|
+
className: expanded ? `${PendingPanel_module_css_default.expand} ${PendingPanel_module_css_default.expandExpanded}` : PendingPanel_module_css_default.expand,
|
|
12444
|
+
"data-diff-approval-expand": true,
|
|
12445
|
+
"aria-label": t(expanded ? "action.exitFullscreen" : "action.expand"),
|
|
12446
|
+
title: t(expanded ? "action.exitFullscreen" : "action.expand"),
|
|
12447
|
+
onClick: () => {
|
|
12448
|
+
setExpanded((value) => !value);
|
|
12449
|
+
},
|
|
12450
|
+
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFullscreenOutline16, { size: 14 })
|
|
12451
|
+
}), (0, react_jsx_runtime.jsx)("button", {
|
|
12452
|
+
type: "button",
|
|
12453
|
+
className: PendingPanel_module_css_default.close,
|
|
12454
|
+
"data-diff-approval-close": true,
|
|
12455
|
+
"aria-label": t("action.close"),
|
|
12456
|
+
title: t("action.close"),
|
|
12457
|
+
onClick: () => {
|
|
12458
|
+
setOpen(false);
|
|
12459
|
+
},
|
|
12460
|
+
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseOutline16, { size: 14 })
|
|
12461
|
+
})]
|
|
12462
|
+
})]
|
|
12036
12463
|
}), snapshot.error !== void 0 || !snapshot.read || files.length === 0 ? (0, react_jsx_runtime.jsxs)("div", {
|
|
12037
12464
|
className: PendingPanel_module_css_default.states,
|
|
12038
12465
|
children: [
|
|
@@ -12099,7 +12526,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
12099
12526
|
type: "button",
|
|
12100
12527
|
className: PendingPanel_module_css_default.badge,
|
|
12101
12528
|
"data-diff-approval-badge": files.length,
|
|
12102
|
-
"data-active": open
|
|
12529
|
+
"data-active": open ? "" : void 0,
|
|
12103
12530
|
"aria-label": t("panel.aria"),
|
|
12104
12531
|
"aria-expanded": open,
|
|
12105
12532
|
onClick: toggleOpen,
|
|
@@ -12337,7 +12764,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
12337
12764
|
"panel.group.others": "其他会话",
|
|
12338
12765
|
"panel.aria": "待处理改动",
|
|
12339
12766
|
"panel.stats": "+{added} -{removed}",
|
|
12340
|
-
"panel.selectHint": "
|
|
12767
|
+
"panel.selectHint": "点击每项查看整个文件的差异;选中文本后,用底部状态栏或 Ctrl+L 复制引用",
|
|
12341
12768
|
"panel.missing": "文件已不存在",
|
|
12342
12769
|
"panel.missingHint": "该文件已不存在,回退会恢复该文件。",
|
|
12343
12770
|
"panel.createHint": "回退会删除该新建的文件。",
|
|
@@ -12351,8 +12778,14 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
12351
12778
|
"action.busy": "处理中…",
|
|
12352
12779
|
"action.prevDiff": "上一处差异",
|
|
12353
12780
|
"action.nextDiff": "下一处差异",
|
|
12354
|
-
"action.
|
|
12781
|
+
"action.copyHint": "复制引用",
|
|
12355
12782
|
"action.copied": "已复制",
|
|
12783
|
+
"action.langAuto": "自动",
|
|
12784
|
+
"action.langAutoDetected": "自动:{lang}",
|
|
12785
|
+
"action.langSelect": "高亮语言",
|
|
12786
|
+
"action.expand": "展开全屏",
|
|
12787
|
+
"action.exitFullscreen": "退出全屏",
|
|
12788
|
+
"action.close": "关闭",
|
|
12356
12789
|
"status.kept": "已保留",
|
|
12357
12790
|
"status.reverted": "已回退",
|
|
12358
12791
|
"status.missing": "该改动已不存在"
|
|
@@ -12367,7 +12800,7 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
12367
12800
|
"panel.group.others": "Other sessions",
|
|
12368
12801
|
"panel.aria": "Pending changes",
|
|
12369
12802
|
"panel.stats": "+{added} -{removed}",
|
|
12370
|
-
"panel.selectHint": "Select an item to review its whole-file diff;
|
|
12803
|
+
"panel.selectHint": "Select an item to review its whole-file diff; select text and copy its reference from the status bar (Ctrl+L)",
|
|
12371
12804
|
"panel.missing": "File is gone",
|
|
12372
12805
|
"panel.missingHint": "This file no longer exists; reverting restores it.",
|
|
12373
12806
|
"panel.createHint": "Reverting removes this created file.",
|
|
@@ -12381,8 +12814,14 @@ XID_Start XIDS`.split(/\s/).map((p) => [w(p), p]));
|
|
|
12381
12814
|
"action.busy": "Working…",
|
|
12382
12815
|
"action.prevDiff": "Previous diff",
|
|
12383
12816
|
"action.nextDiff": "Next diff",
|
|
12384
|
-
"action.
|
|
12817
|
+
"action.copyHint": "Copy reference",
|
|
12385
12818
|
"action.copied": "Copied",
|
|
12819
|
+
"action.langAuto": "Auto",
|
|
12820
|
+
"action.langAutoDetected": "Auto: {lang}",
|
|
12821
|
+
"action.langSelect": "Highlight language",
|
|
12822
|
+
"action.expand": "Expand fullscreen",
|
|
12823
|
+
"action.exitFullscreen": "Exit fullscreen",
|
|
12824
|
+
"action.close": "Close",
|
|
12386
12825
|
"status.kept": "Kept",
|
|
12387
12826
|
"status.reverted": "Reverted",
|
|
12388
12827
|
"status.missing": "This change no longer exists"
|