@dooc-dev/dooc 0.0.26 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/edit.global.js +280 -260
- package/dist/engine/compiler/format-collections.js +9 -3
- package/dist/engine/core/html.js +3 -5
- package/dist/engine/core/icons.js +2 -2
- package/dist/frontend/document-application.js +185 -90
- package/dist/frontend/git-style.d.ts +1 -0
- package/dist/frontend/git-style.js +172 -0
- package/dist/frontend/language-picker.d.ts +5 -1
- package/dist/frontend/language-picker.js +19 -4
- package/dist/frontend/link-preview.d.ts +2 -0
- package/dist/frontend/link-preview.js +385 -0
- package/dist/frontend/locales/eng.json +137 -3
- package/dist/frontend/locales/jpn.json +139 -5
- package/dist/frontend/locales/zho.json +137 -3
- package/dist/frontend/resource-download.js +11 -6
- package/dist/frontend/scrollbars.d.ts +1 -0
- package/dist/frontend/scrollbars.js +9 -0
- package/dist/frontend/video-ui.js +9 -3
- package/dist/manifest.global.js +188 -186
- package/dist/mcp-relay.mjs +20 -1
- package/dist/plugins.global.js +31 -31
- package/dist/server/build.js +11 -8
- package/dist/server/cli.js +6 -1
- package/dist/server/git-origin.js +1 -1
- package/dist/server/git.js +49 -26
- package/dist/server/operation-log.js +9 -1
- package/dist/server/serve.d.ts +1 -0
- package/dist/server/serve.js +18 -7
- package/dist/server/static-client.js +4 -14
- package/dist/server/workspace-server.js +2 -1
- package/dist/subformats.global.js +57 -57
- package/dist/ui.global.js +71 -69
- package/dist/workspace/git-review.d.ts +5 -0
- package/dist/workspace/git-review.js +56 -0
- package/dist/workspace/git-types.d.ts +29 -2
- package/dist/workspace/git-types.js +5 -1
- package/dist/workspace/github.d.ts +1 -1
- package/dist/workspace/github.js +73 -9
- package/dist/workspace/mcp-tools.js +20 -1
- package/dist/workspace-worker.global.js +337 -87
- package/package.json +1 -1
- package/dist/workspace-mcp-worker.global.js +0 -3263
- package/dist/workspace-reader-mcp-worker.global.js +0 -3263
- package/dist/workspace-reader-worker.global.js +0 -3263
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GIT_CSS = "\nbody.edit:has(#preview-panes:not(.split) .preview-pane.active .git-page) #panel { display: none; }\n.preview-pane.resources-pane:has(.git-page) { background: var(--c-bg0); }\n.git-page { container: git-console / inline-size; width: 100%; min-width: 0; color: var(--c-fg); font: 14px/1.5 var(--font-sans); }\n.git-page > #git-manager { max-width: 1100px; min-width: 0; margin: 0 auto; padding: 28px 0; }\n.git-page [hidden] { display: none !important; }\n.git-page details > summary { opacity: 1; }\n.git-controls { min-width: 0; margin: 0; padding: 0; border: 0; }\n.git-header, .git-identity, .git-toolbar, .git-branches, .git-section-head, .git-section-title, .git-actions, .git-checkbox { display: flex; align-items: center; gap: 8px; }\n.git-header, .git-section-head { flex-wrap: wrap; justify-content: space-between; gap: 12px 18px; }\n.git-header { justify-content: flex-start; }\n.git-header .git-toolbar { margin-inline-start: auto; }\n.git-page :is(h1,h2,h3,p,pre) { margin: 0; }\n.git-page h1, .git-page h2, .git-page h3 { padding: 0; border: 0; color: var(--c-fg); font-family: var(--font-sans); }\n.git-identity { min-width: 0; gap: 10px; }\n.git-header h1 { margin: 0; overflow-wrap: anywhere; font-size: 24px; line-height: 1.2; font-weight: 650; letter-spacing: -.025em; }\n.git-page h2 { font-size: 16px; font-weight: 600; line-height: 1.4; }\n.git-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; }\n.git-identity > .git-icon { width: 34px; height: 34px; border-radius: 7px; background: var(--c-bg1); color: var(--c-fg-muted); }\n.git-identity > .git-icon svg { width: 22px; height: 22px; }\n.git-toolbar, .git-actions { flex-wrap: wrap; gap: 6px; }\n.git-page .git-button, .git-new-branch > summary { display: inline-flex; box-sizing: border-box; align-items: center; justify-content: center; gap: 5px;\n min-height: 32px; padding: 4px 10px; border: 1px solid var(--c-line); border-radius: 5px; color: var(--c-fg); background: var(--c-bg0); font: 500 12px/1.4 var(--font-sans); cursor: pointer; }\n.git-page .git-button:not(:disabled):hover, .git-new-branch > summary:hover { background: var(--c-raised); }\n.git-page .git-button:disabled { color: var(--c-fg-muted); background: var(--c-bg1); opacity: .65; cursor: default; }\n.git-page :is(button,summary,a,input,textarea,select,pre):focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }\n.git-page :is(input:not([type=checkbox]),textarea,select) { box-sizing: border-box; min-width: 0; max-width: 100%; margin: 0; border: 1px solid var(--c-line);\n border-radius: 5px; padding: 6px 9px; background: var(--c-bg0); color: var(--c-fg); font: 13px/1.5 var(--font-sans); }\n.git-page :is(input,textarea)::placeholder { color: var(--c-fg-faint); opacity: 1; }\n.git-page select option { background: var(--c-bg0); color: var(--c-fg); }\n.git-branches { flex-wrap: wrap; gap: 6px 12px; min-width: 0; }\n.git-branch-select { display: inline-flex; align-items: center; gap: 3px; min-width: 0; max-width: 100%; color: var(--c-fg-muted); }\n.git-branch-select select { width: auto; max-width: min(48ch,100% - 22px); border-color: transparent; padding: 4px 2px; color: var(--c-fg); font: 13px var(--doc-mono); text-overflow: ellipsis; }\n.git-revision { border-inline-start: 1px solid var(--c-line); padding-inline-start: 12px; color: var(--c-fg-muted); font: 12px var(--doc-mono); }\n.git-new-branch { min-width: 0; max-width: 100%; }\n.git-new-branch > summary { border-color: transparent; background: none; color: var(--c-fg-muted); list-style: none; }\n.git-new-branch > summary::before { content: \"+\"; font: 16px var(--doc-mono); }\n.git-new-branch[open] { flex-basis: 100%; }\n.git-new-branch[open] > summary::before { content: \"\u2212\"; }\n.git-new-branch > summary::-webkit-details-marker { display: none; }\n.git-new-branch form { margin: 6px 0 4px; }\n.git-tabs { display: flex; flex-wrap: wrap; gap: 18px; margin: 19px 0 22px; border-bottom: 1px solid var(--c-line); }\n.git-tabs a { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding-inline: 2px; border-bottom: 2px solid transparent; color: var(--c-fg-muted); text-decoration: none; font-size: 13px; }\n.git-tabs a:hover { color: var(--c-fg); }\n.git-tabs a[aria-current] { border-color: var(--c-accent); color: var(--c-fg); font-weight: 600; }\n.git-pr-filters { align-self: center; justify-content: flex-end; max-width: 100%; margin: 0 0 4px auto; }\n.git-pr-filters .git-button { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }\n.git-page .git-commit-jump { display: none; }\n.git-count { display: inline-block; min-width: 1.6em; padding: 1px 5px; border-radius: 4px; background: var(--c-raised); color: var(--c-fg-muted); font: 500 11px/1.5 var(--font-sans); font-variant-numeric: tabular-nums; text-align: center; }\n.git-workspace { display: grid; align-items: start; grid-template-columns: minmax(0,1fr) minmax(240px,30%); gap: 32px; }\n.git-content, .git-side, .git-files, .git-group { min-width: 0; }\n.git-side { display: grid; align-content: start; gap: 20px; }\n.git-section-head { margin-bottom: 14px; }\n.git-search { display: flex; align-items: center; align-self: center; gap: 6px; min-width: 0; width: min(190px,100%); margin: 0 0 4px auto; box-sizing: border-box; padding-inline: 8px; border: 1px solid var(--c-line); border-radius: 5px; color: var(--c-fg-muted); }\n.git-search input[type=search] { width: 100%; min-height: 30px; padding: 4px 0; border: 0; background: transparent; }\n.git-search:focus-within { outline: 2px solid var(--c-accent); outline-offset: 1px; }\n.git-search input:focus-visible { outline: none; }\n.git-groups { display: grid; gap: 16px; }\n.git-group { border: 1px solid var(--c-line); border-radius: 6px; }\n.git-page .git-group-title { display: flex; align-items: center; gap: 8px; min-height: 36px; padding-inline: 12px; border-radius: 5px 5px 0 0; background: var(--c-bg1); font: 600 13px var(--font-sans); }\n.git-file { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 0 8px; border-top: 1px solid var(--c-line-soft); }\n.git-file:has(.git-file-open[aria-expanded=true]) { background: var(--c-bg1); }\n.git-file-open { display: grid; grid-template-columns: 6px minmax(0,1fr) auto; align-items: center; gap: 10px; min-width: 0; min-height: 40px; padding: 6px 0 6px 12px;\n border: 0; border-radius: 3px; background: none; color: var(--c-fg); text-align: start; cursor: pointer; }\n.git-file-open:hover .git-filename { text-decoration: underline; text-underline-offset: 3px; }\n.git-file-open::before, .git-pr-open::before, .git-review-file > summary::before { content: \"\"; width: 5px; height: 5px; border-right: 1.5px solid var(--c-fg-muted); border-bottom: 1.5px solid var(--c-fg-muted); transform: rotate(-45deg); }\n.git-file-open[aria-expanded=true]::before, .git-pr-open[aria-expanded=true]::before, .git-review-file[open] > summary::before { transform: rotate(45deg); }\n.git-file-path { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 9px; min-width: 0; overflow-wrap: anywhere; }\n.git-filename { font: 500 13px/1.4 var(--doc-mono); }\n.git-directory, .git-upstream { color: var(--c-fg-muted); font: 12px/1.4 var(--doc-mono); }\n.git-file-status { color: var(--c-fg-muted); font: 500 12px/1.4 var(--font-sans); }\n.git-file-status:is([data-status=A],[data-status=\"?\"]) { color: var(--c-ok); }\n.git-file-status:is([data-status=M],[data-status=T]) { color: var(--c-warn); }\n.git-file-status:is([data-status=D],[data-status=U]) { color: var(--c-danger); }\n.git-file > .git-button { margin-inline-end: 8px; border-color: transparent; background: transparent; }\n.git-file > .git-button:has(> .git-icon:only-child) { min-width: 32px; padding-inline: 0; }\n.git-file > .git-button svg { width: 15px; height: 15px; }\n.git-patch { grid-column: 1/-1; min-width: 0; padding: 0 8px 8px; }\n.git-page .git-diff { max-height: 320px; overflow: auto; padding: 8px 0; border: 1px solid var(--c-line); border-radius: 4px; background: var(--c-bg0); color: var(--c-fg); font: 12px/1.6 var(--doc-mono); white-space: pre; tab-size: 4; }\n.git-line { display: block; width: max-content; min-width: 100%; box-sizing: border-box; padding: 0 8px; }\n.git-line.meta { color: var(--c-fg-muted); }\n.git-line.hunk { background: color-mix(in srgb,var(--c-info) 10%,var(--c-bg0)); color: var(--c-info); }\n.git-line.add { background: color-mix(in srgb,var(--c-ok) 13%,var(--c-bg0)); }\n.git-line.del { background: color-mix(in srgb,var(--c-danger) 12%,var(--c-bg0)); }\n.git-more { margin: 8px 12px; }\n.git-page .git-clean { padding: 24px 16px; border-block: 1px solid var(--c-line); color: var(--c-ok); font-weight: 550; }\n.git-page .git-hint, .git-page .git-tracking { margin: 0; color: var(--c-fg-muted); font: 12px/1.5 var(--font-sans); overflow-wrap: anywhere; }\n.git-form { display: grid; gap: 10px; }\n.git-commit { gap: 7px; }\n.git-commit-actions { align-items: flex-start; gap: 4px; }\n.git-commit-options > summary { display: grid; place-items: center; width: 32px; min-height: 36px; box-sizing: border-box; list-style: none; border: 1px solid var(--c-line); border-radius: 5px; color: var(--c-fg-muted); cursor: pointer; }\n.git-commit-options > summary::-webkit-details-marker { display: none; }\n.git-commit-options > summary::after { content: \"\"; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }\n.git-commit-options[open] > summary::after { transform: rotate(225deg); }\n.git-commit-options > button { margin-top: 4px; }\n.git-section-title > .git-icon { color: var(--c-fg-muted); }\n.git-provider { color: var(--c-fg-muted); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }\n.git-staged-total { margin: 9px 0 0 auto; color: var(--c-fg-muted); font: 500 12px var(--font-sans); font-variant-numeric: tabular-nums; }\n.git-field { display: grid; gap: 5px; min-width: 0; color: var(--c-fg-muted); font: 500 12px/1.5 var(--font-sans); }\n.git-field textarea { width: 100%; resize: vertical; }\n.git-commit textarea { width: 100%; min-height: 60px; resize: vertical; }\n.git-page .git-primary { min-height: 36px; }\n.git-page .git-primary:not(:disabled) { color: var(--doc-accent-fg); border-color: transparent; background: color-mix(in srgb,var(--c-accent) 85%,black); }\n.git-page .git-primary:not(:disabled):hover { background: color-mix(in srgb,var(--c-accent) 75%,black); }\n.git-page .git-primary:disabled { background: var(--c-raised); opacity: 1; }\n.git-sync, .git-stash { display: grid; justify-items: start; gap: 8px; padding: 0 1px; }\n.git-stash .git-button { border-color: transparent; color: var(--c-fg-muted); }\n.git-page .git-upstream { display: block; max-width: 100%; padding: 0; background: none; overflow-wrap: anywhere; }\n.git-prs { display: grid; gap: 0; }\n.git-prs > .git-button { justify-self: start; margin-top: 8px; }\n.git-pr-create { margin-bottom: 18px; padding: 14px; border: 1px solid var(--c-line); border-radius: 6px; background: var(--c-bg1); }\n.git-pr-create h3 { font-size: 15px; }\n.git-pr-row { display: grid; grid-template: \"title link\" auto \"meta meta\" auto \"body body\" auto / minmax(0,1fr) auto; align-items: start; column-gap: 16px; min-width: 0; border-top: 1px solid var(--c-line); }\n.git-pr-open { grid-area: title; display: grid; grid-template-columns: 6px auto minmax(0,1fr) auto; align-items: baseline; gap: 2px 8px; min-width: 0; padding: 10px 2px 2px; border: 0; color: inherit; background: none; font: inherit; text-align: start; cursor: pointer; }\n.git-pr-open::before { align-self: start; margin-top: 7px; }\n.git-pr-open:hover .git-pr-title { text-decoration: underline; text-underline-offset: 3px; }\n.git-pr-number, .git-pr-route { font: 12px/1.5 var(--doc-mono); color: var(--c-fg-muted); overflow-wrap: anywhere; }\n.git-pr-title { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }\n.git-pr-state { font-size: 12px; color: var(--c-fg-muted); }\n.git-pr-state[data-state=open] { color: var(--c-ok); }\n.git-pr-state[data-state=merged] { color: var(--c-info); }\n.git-pr-meta { grid-area: meta; display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 14px; min-width: 0; padding: 2px 0 10px 16px; }\n.git-pr-head { min-width: 0; color: var(--c-fg-muted); font: 12px/1.5 var(--doc-mono); }\n.git-pr-head > summary { cursor: pointer; }\n.git-pr-head .git-full-sha { display: block; margin: 4px 0; color: var(--c-fg); overflow-wrap: anywhere; user-select: all; }\n.git-pr-checks { font-size: 12px; color: var(--c-fg-muted); overflow-wrap: anywhere; }\n.git-pr-body { grid-area: body; display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; padding: 2px 0 14px; }\n.git-description { max-height: 18em; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }\n.git-pr-body summary { min-height: 30px; color: var(--c-fg); font-size: 13px; font-weight: 500; cursor: pointer; }\n.git-pr-files, .git-pr-review, .git-pr-edit { min-width: 0; padding-block: 4px; border-top: 1px solid var(--c-line-soft); }\n.git-review-files { min-width: 0; }\n.git-review-file > summary { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: var(--c-bg1); }\n.git-review-file > summary::before { flex: none; }\n.git-review-file .git-filename { flex: 1; overflow-wrap: anywhere; }\n.git-added { color: color-mix(in srgb,var(--c-ok) 85%,var(--c-fg)); }\n.git-deleted { color: color-mix(in srgb,var(--c-danger) 85%,var(--c-fg)); }\n.git-merge { border-top: 1px solid var(--c-line-soft); padding-top: 10px; }\n.git-review-link { grid-area: link; display: inline-flex; align-items: center; justify-self: start; padding: 10px 0 2px; color: var(--c-info); font-size: 13px; text-underline-offset: 3px; overflow-wrap: anywhere; }\n.git-prs .git-checkbox { color: var(--c-fg-muted); font-size: 13px; }\n.git-feedback { position: sticky; top: 4px; z-index: 2; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 10px; border: 1px solid var(--c-line); border-radius: 5px; background: var(--c-bg1); }\n.git-notice, .git-error { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }\n.git-feedback[data-kind=error], .git-error { color: var(--c-danger); }\n.git-feedback[data-kind=success] { color: var(--c-ok); }\n@container git-console (max-width: 680px) {\n .git-page > #git-manager { padding-block: 16px; }\n .git-workspace { grid-template-columns: minmax(0,1fr); gap: 18px; }\n .git-tabs { margin-block: 13px 16px; }\n .git-page .git-commit-jump { display: inline-flex; margin-inline-start: auto; align-self: center; border-color: transparent; }\n .git-side { gap: 16px; }\n}\n@container git-console (max-width: 430px) {\n .git-header h1 { font-size: 20px; }\n .git-identity > .git-icon { width: 26px; height: 26px; }\n .git-section-head { gap: 8px; }\n .git-tabs { gap: 4px 14px; }\n .git-pr-filters select { field-sizing: content; }\n .git-search { order: 1; flex-basis: 100%; margin: 2px 0 8px; }\n .git-file-open { gap: 7px; padding-inline-start: 8px; }\n .git-file > .git-button { margin-inline-end: 4px; padding-inline: 6px; }\n .git-pr-row { grid-template: \"title\" auto \"meta\" auto \"link\" auto \"body\" auto / minmax(0,1fr); }\n .git-pr-meta { padding-bottom: 2px; }\n .git-review-link { margin-inline-start: 16px; padding-block: 3px 8px; }\n}\n@media (max-width: 820px) {\n body.edit:has(#preview-panes:not(.split) .preview-pane.active .git-page) { grid-template-rows: minmax(0,1fr) 0; }\n}\n@media (pointer: coarse) {\n .git-page :is(.git-button, .git-file-open, .git-pr-open, .git-review-link, summary, select, .git-tabs a) { min-height: 44px; }\n .git-page :is(input:not([type=checkbox]),textarea,select) { font-size: 16px; }\n .git-page .git-file > .git-button, .git-commit-options > summary { min-width: 44px; }\n}\n";
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
export const GIT_CSS = `
|
|
2
|
+
body.edit:has(#preview-panes:not(.split) .preview-pane.active .git-page) #panel { display: none; }
|
|
3
|
+
.preview-pane.resources-pane:has(.git-page) { background: var(--c-bg0); }
|
|
4
|
+
.git-page { container: git-console / inline-size; width: 100%; min-width: 0; color: var(--c-fg); font: 14px/1.5 var(--font-sans); }
|
|
5
|
+
.git-page > #git-manager { max-width: 1100px; min-width: 0; margin: 0 auto; padding: 28px 0; }
|
|
6
|
+
.git-page [hidden] { display: none !important; }
|
|
7
|
+
.git-page details > summary { opacity: 1; }
|
|
8
|
+
.git-controls { min-width: 0; margin: 0; padding: 0; border: 0; }
|
|
9
|
+
.git-header, .git-identity, .git-toolbar, .git-branches, .git-section-head, .git-section-title, .git-actions, .git-checkbox { display: flex; align-items: center; gap: 8px; }
|
|
10
|
+
.git-header, .git-section-head { flex-wrap: wrap; justify-content: space-between; gap: 12px 18px; }
|
|
11
|
+
.git-header { justify-content: flex-start; }
|
|
12
|
+
.git-header .git-toolbar { margin-inline-start: auto; }
|
|
13
|
+
.git-page :is(h1,h2,h3,p,pre) { margin: 0; }
|
|
14
|
+
.git-page h1, .git-page h2, .git-page h3 { padding: 0; border: 0; color: var(--c-fg); font-family: var(--font-sans); }
|
|
15
|
+
.git-identity { min-width: 0; gap: 10px; }
|
|
16
|
+
.git-header h1 { margin: 0; overflow-wrap: anywhere; font-size: 24px; line-height: 1.2; font-weight: 650; letter-spacing: -.025em; }
|
|
17
|
+
.git-page h2 { font-size: 16px; font-weight: 600; line-height: 1.4; }
|
|
18
|
+
.git-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; }
|
|
19
|
+
.git-identity > .git-icon { width: 34px; height: 34px; border-radius: 7px; background: var(--c-bg1); color: var(--c-fg-muted); }
|
|
20
|
+
.git-identity > .git-icon svg { width: 22px; height: 22px; }
|
|
21
|
+
.git-toolbar, .git-actions { flex-wrap: wrap; gap: 6px; }
|
|
22
|
+
.git-page .git-button, .git-new-branch > summary { display: inline-flex; box-sizing: border-box; align-items: center; justify-content: center; gap: 5px;
|
|
23
|
+
min-height: 32px; padding: 4px 10px; border: 1px solid var(--c-line); border-radius: 5px; color: var(--c-fg); background: var(--c-bg0); font: 500 12px/1.4 var(--font-sans); cursor: pointer; }
|
|
24
|
+
.git-page .git-button:not(:disabled):hover, .git-new-branch > summary:hover { background: var(--c-raised); }
|
|
25
|
+
.git-page .git-button:disabled { color: var(--c-fg-muted); background: var(--c-bg1); opacity: .65; cursor: default; }
|
|
26
|
+
.git-page :is(button,summary,a,input,textarea,select,pre):focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
|
|
27
|
+
.git-page :is(input:not([type=checkbox]),textarea,select) { box-sizing: border-box; min-width: 0; max-width: 100%; margin: 0; border: 1px solid var(--c-line);
|
|
28
|
+
border-radius: 5px; padding: 6px 9px; background: var(--c-bg0); color: var(--c-fg); font: 13px/1.5 var(--font-sans); }
|
|
29
|
+
.git-page :is(input,textarea)::placeholder { color: var(--c-fg-faint); opacity: 1; }
|
|
30
|
+
.git-page select option { background: var(--c-bg0); color: var(--c-fg); }
|
|
31
|
+
.git-branches { flex-wrap: wrap; gap: 6px 12px; min-width: 0; }
|
|
32
|
+
.git-branch-select { display: inline-flex; align-items: center; gap: 3px; min-width: 0; max-width: 100%; color: var(--c-fg-muted); }
|
|
33
|
+
.git-branch-select select { width: auto; max-width: min(48ch,100% - 22px); border-color: transparent; padding: 4px 2px; color: var(--c-fg); font: 13px var(--doc-mono); text-overflow: ellipsis; }
|
|
34
|
+
.git-revision { border-inline-start: 1px solid var(--c-line); padding-inline-start: 12px; color: var(--c-fg-muted); font: 12px var(--doc-mono); }
|
|
35
|
+
.git-new-branch { min-width: 0; max-width: 100%; }
|
|
36
|
+
.git-new-branch > summary { border-color: transparent; background: none; color: var(--c-fg-muted); list-style: none; }
|
|
37
|
+
.git-new-branch > summary::before { content: "+"; font: 16px var(--doc-mono); }
|
|
38
|
+
.git-new-branch[open] { flex-basis: 100%; }
|
|
39
|
+
.git-new-branch[open] > summary::before { content: "−"; }
|
|
40
|
+
.git-new-branch > summary::-webkit-details-marker { display: none; }
|
|
41
|
+
.git-new-branch form { margin: 6px 0 4px; }
|
|
42
|
+
.git-tabs { display: flex; flex-wrap: wrap; gap: 18px; margin: 19px 0 22px; border-bottom: 1px solid var(--c-line); }
|
|
43
|
+
.git-tabs a { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding-inline: 2px; border-bottom: 2px solid transparent; color: var(--c-fg-muted); text-decoration: none; font-size: 13px; }
|
|
44
|
+
.git-tabs a:hover { color: var(--c-fg); }
|
|
45
|
+
.git-tabs a[aria-current] { border-color: var(--c-accent); color: var(--c-fg); font-weight: 600; }
|
|
46
|
+
.git-pr-filters { align-self: center; justify-content: flex-end; max-width: 100%; margin: 0 0 4px auto; }
|
|
47
|
+
.git-pr-filters .git-button { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
|
|
48
|
+
.git-page .git-commit-jump { display: none; }
|
|
49
|
+
.git-count { display: inline-block; min-width: 1.6em; padding: 1px 5px; border-radius: 4px; background: var(--c-raised); color: var(--c-fg-muted); font: 500 11px/1.5 var(--font-sans); font-variant-numeric: tabular-nums; text-align: center; }
|
|
50
|
+
.git-workspace { display: grid; align-items: start; grid-template-columns: minmax(0,1fr) minmax(240px,30%); gap: 32px; }
|
|
51
|
+
.git-content, .git-side, .git-files, .git-group { min-width: 0; }
|
|
52
|
+
.git-side { display: grid; align-content: start; gap: 20px; }
|
|
53
|
+
.git-section-head { margin-bottom: 14px; }
|
|
54
|
+
.git-search { display: flex; align-items: center; align-self: center; gap: 6px; min-width: 0; width: min(190px,100%); margin: 0 0 4px auto; box-sizing: border-box; padding-inline: 8px; border: 1px solid var(--c-line); border-radius: 5px; color: var(--c-fg-muted); }
|
|
55
|
+
.git-search input[type=search] { width: 100%; min-height: 30px; padding: 4px 0; border: 0; background: transparent; }
|
|
56
|
+
.git-search:focus-within { outline: 2px solid var(--c-accent); outline-offset: 1px; }
|
|
57
|
+
.git-search input:focus-visible { outline: none; }
|
|
58
|
+
.git-groups { display: grid; gap: 16px; }
|
|
59
|
+
.git-group { border: 1px solid var(--c-line); border-radius: 6px; }
|
|
60
|
+
.git-page .git-group-title { display: flex; align-items: center; gap: 8px; min-height: 36px; padding-inline: 12px; border-radius: 5px 5px 0 0; background: var(--c-bg1); font: 600 13px var(--font-sans); }
|
|
61
|
+
.git-file { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 0 8px; border-top: 1px solid var(--c-line-soft); }
|
|
62
|
+
.git-file:has(.git-file-open[aria-expanded=true]) { background: var(--c-bg1); }
|
|
63
|
+
.git-file-open { display: grid; grid-template-columns: 6px minmax(0,1fr) auto; align-items: center; gap: 10px; min-width: 0; min-height: 40px; padding: 6px 0 6px 12px;
|
|
64
|
+
border: 0; border-radius: 3px; background: none; color: var(--c-fg); text-align: start; cursor: pointer; }
|
|
65
|
+
.git-file-open:hover .git-filename { text-decoration: underline; text-underline-offset: 3px; }
|
|
66
|
+
.git-file-open::before, .git-pr-open::before, .git-review-file > summary::before { content: ""; width: 5px; height: 5px; border-right: 1.5px solid var(--c-fg-muted); border-bottom: 1.5px solid var(--c-fg-muted); transform: rotate(-45deg); }
|
|
67
|
+
.git-file-open[aria-expanded=true]::before, .git-pr-open[aria-expanded=true]::before, .git-review-file[open] > summary::before { transform: rotate(45deg); }
|
|
68
|
+
.git-file-path { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 9px; min-width: 0; overflow-wrap: anywhere; }
|
|
69
|
+
.git-filename { font: 500 13px/1.4 var(--doc-mono); }
|
|
70
|
+
.git-directory, .git-upstream { color: var(--c-fg-muted); font: 12px/1.4 var(--doc-mono); }
|
|
71
|
+
.git-file-status { color: var(--c-fg-muted); font: 500 12px/1.4 var(--font-sans); }
|
|
72
|
+
.git-file-status:is([data-status=A],[data-status="?"]) { color: var(--c-ok); }
|
|
73
|
+
.git-file-status:is([data-status=M],[data-status=T]) { color: var(--c-warn); }
|
|
74
|
+
.git-file-status:is([data-status=D],[data-status=U]) { color: var(--c-danger); }
|
|
75
|
+
.git-file > .git-button { margin-inline-end: 8px; border-color: transparent; background: transparent; }
|
|
76
|
+
.git-file > .git-button:has(> .git-icon:only-child) { min-width: 32px; padding-inline: 0; }
|
|
77
|
+
.git-file > .git-button svg { width: 15px; height: 15px; }
|
|
78
|
+
.git-patch { grid-column: 1/-1; min-width: 0; padding: 0 8px 8px; }
|
|
79
|
+
.git-page .git-diff { max-height: 320px; overflow: auto; padding: 8px 0; border: 1px solid var(--c-line); border-radius: 4px; background: var(--c-bg0); color: var(--c-fg); font: 12px/1.6 var(--doc-mono); white-space: pre; tab-size: 4; }
|
|
80
|
+
.git-line { display: block; width: max-content; min-width: 100%; box-sizing: border-box; padding: 0 8px; }
|
|
81
|
+
.git-line.meta { color: var(--c-fg-muted); }
|
|
82
|
+
.git-line.hunk { background: color-mix(in srgb,var(--c-info) 10%,var(--c-bg0)); color: var(--c-info); }
|
|
83
|
+
.git-line.add { background: color-mix(in srgb,var(--c-ok) 13%,var(--c-bg0)); }
|
|
84
|
+
.git-line.del { background: color-mix(in srgb,var(--c-danger) 12%,var(--c-bg0)); }
|
|
85
|
+
.git-more { margin: 8px 12px; }
|
|
86
|
+
.git-page .git-clean { padding: 24px 16px; border-block: 1px solid var(--c-line); color: var(--c-ok); font-weight: 550; }
|
|
87
|
+
.git-page .git-hint, .git-page .git-tracking { margin: 0; color: var(--c-fg-muted); font: 12px/1.5 var(--font-sans); overflow-wrap: anywhere; }
|
|
88
|
+
.git-form { display: grid; gap: 10px; }
|
|
89
|
+
.git-commit { gap: 7px; }
|
|
90
|
+
.git-commit-actions { align-items: flex-start; gap: 4px; }
|
|
91
|
+
.git-commit-options > summary { display: grid; place-items: center; width: 32px; min-height: 36px; box-sizing: border-box; list-style: none; border: 1px solid var(--c-line); border-radius: 5px; color: var(--c-fg-muted); cursor: pointer; }
|
|
92
|
+
.git-commit-options > summary::-webkit-details-marker { display: none; }
|
|
93
|
+
.git-commit-options > summary::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
|
|
94
|
+
.git-commit-options[open] > summary::after { transform: rotate(225deg); }
|
|
95
|
+
.git-commit-options > button { margin-top: 4px; }
|
|
96
|
+
.git-section-title > .git-icon { color: var(--c-fg-muted); }
|
|
97
|
+
.git-provider { color: var(--c-fg-muted); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
|
|
98
|
+
.git-staged-total { margin: 9px 0 0 auto; color: var(--c-fg-muted); font: 500 12px var(--font-sans); font-variant-numeric: tabular-nums; }
|
|
99
|
+
.git-field { display: grid; gap: 5px; min-width: 0; color: var(--c-fg-muted); font: 500 12px/1.5 var(--font-sans); }
|
|
100
|
+
.git-field textarea { width: 100%; resize: vertical; }
|
|
101
|
+
.git-commit textarea { width: 100%; min-height: 60px; resize: vertical; }
|
|
102
|
+
.git-page .git-primary { min-height: 36px; }
|
|
103
|
+
.git-page .git-primary:not(:disabled) { color: var(--doc-accent-fg); border-color: transparent; background: color-mix(in srgb,var(--c-accent) 85%,black); }
|
|
104
|
+
.git-page .git-primary:not(:disabled):hover { background: color-mix(in srgb,var(--c-accent) 75%,black); }
|
|
105
|
+
.git-page .git-primary:disabled { background: var(--c-raised); opacity: 1; }
|
|
106
|
+
.git-sync, .git-stash { display: grid; justify-items: start; gap: 8px; padding: 0 1px; }
|
|
107
|
+
.git-stash .git-button { border-color: transparent; color: var(--c-fg-muted); }
|
|
108
|
+
.git-page .git-upstream { display: block; max-width: 100%; padding: 0; background: none; overflow-wrap: anywhere; }
|
|
109
|
+
.git-prs { display: grid; gap: 0; }
|
|
110
|
+
.git-prs > .git-button { justify-self: start; margin-top: 8px; }
|
|
111
|
+
.git-pr-create { margin-bottom: 18px; padding: 14px; border: 1px solid var(--c-line); border-radius: 6px; background: var(--c-bg1); }
|
|
112
|
+
.git-pr-create h3 { font-size: 15px; }
|
|
113
|
+
.git-pr-row { display: grid; grid-template: "title link" auto "meta meta" auto "body body" auto / minmax(0,1fr) auto; align-items: start; column-gap: 16px; min-width: 0; border-top: 1px solid var(--c-line); }
|
|
114
|
+
.git-pr-open { grid-area: title; display: grid; grid-template-columns: 6px auto minmax(0,1fr) auto; align-items: baseline; gap: 2px 8px; min-width: 0; padding: 10px 2px 2px; border: 0; color: inherit; background: none; font: inherit; text-align: start; cursor: pointer; }
|
|
115
|
+
.git-pr-open::before { align-self: start; margin-top: 7px; }
|
|
116
|
+
.git-pr-open:hover .git-pr-title { text-decoration: underline; text-underline-offset: 3px; }
|
|
117
|
+
.git-pr-number, .git-pr-route { font: 12px/1.5 var(--doc-mono); color: var(--c-fg-muted); overflow-wrap: anywhere; }
|
|
118
|
+
.git-pr-title { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
|
|
119
|
+
.git-pr-state { font-size: 12px; color: var(--c-fg-muted); }
|
|
120
|
+
.git-pr-state[data-state=open] { color: var(--c-ok); }
|
|
121
|
+
.git-pr-state[data-state=merged] { color: var(--c-info); }
|
|
122
|
+
.git-pr-meta { grid-area: meta; display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 14px; min-width: 0; padding: 2px 0 10px 16px; }
|
|
123
|
+
.git-pr-head { min-width: 0; color: var(--c-fg-muted); font: 12px/1.5 var(--doc-mono); }
|
|
124
|
+
.git-pr-head > summary { cursor: pointer; }
|
|
125
|
+
.git-pr-head .git-full-sha { display: block; margin: 4px 0; color: var(--c-fg); overflow-wrap: anywhere; user-select: all; }
|
|
126
|
+
.git-pr-checks { font-size: 12px; color: var(--c-fg-muted); overflow-wrap: anywhere; }
|
|
127
|
+
.git-pr-body { grid-area: body; display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; padding: 2px 0 14px; }
|
|
128
|
+
.git-description { max-height: 18em; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
129
|
+
.git-pr-body summary { min-height: 30px; color: var(--c-fg); font-size: 13px; font-weight: 500; cursor: pointer; }
|
|
130
|
+
.git-pr-files, .git-pr-review, .git-pr-edit { min-width: 0; padding-block: 4px; border-top: 1px solid var(--c-line-soft); }
|
|
131
|
+
.git-review-files { min-width: 0; }
|
|
132
|
+
.git-review-file > summary { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: var(--c-bg1); }
|
|
133
|
+
.git-review-file > summary::before { flex: none; }
|
|
134
|
+
.git-review-file .git-filename { flex: 1; overflow-wrap: anywhere; }
|
|
135
|
+
.git-added { color: color-mix(in srgb,var(--c-ok) 85%,var(--c-fg)); }
|
|
136
|
+
.git-deleted { color: color-mix(in srgb,var(--c-danger) 85%,var(--c-fg)); }
|
|
137
|
+
.git-merge { border-top: 1px solid var(--c-line-soft); padding-top: 10px; }
|
|
138
|
+
.git-review-link { grid-area: link; display: inline-flex; align-items: center; justify-self: start; padding: 10px 0 2px; color: var(--c-info); font-size: 13px; text-underline-offset: 3px; overflow-wrap: anywhere; }
|
|
139
|
+
.git-prs .git-checkbox { color: var(--c-fg-muted); font-size: 13px; }
|
|
140
|
+
.git-feedback { position: sticky; top: 4px; z-index: 2; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 10px; border: 1px solid var(--c-line); border-radius: 5px; background: var(--c-bg1); }
|
|
141
|
+
.git-notice, .git-error { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
|
|
142
|
+
.git-feedback[data-kind=error], .git-error { color: var(--c-danger); }
|
|
143
|
+
.git-feedback[data-kind=success] { color: var(--c-ok); }
|
|
144
|
+
@container git-console (max-width: 680px) {
|
|
145
|
+
.git-page > #git-manager { padding-block: 16px; }
|
|
146
|
+
.git-workspace { grid-template-columns: minmax(0,1fr); gap: 18px; }
|
|
147
|
+
.git-tabs { margin-block: 13px 16px; }
|
|
148
|
+
.git-page .git-commit-jump { display: inline-flex; margin-inline-start: auto; align-self: center; border-color: transparent; }
|
|
149
|
+
.git-side { gap: 16px; }
|
|
150
|
+
}
|
|
151
|
+
@container git-console (max-width: 430px) {
|
|
152
|
+
.git-header h1 { font-size: 20px; }
|
|
153
|
+
.git-identity > .git-icon { width: 26px; height: 26px; }
|
|
154
|
+
.git-section-head { gap: 8px; }
|
|
155
|
+
.git-tabs { gap: 4px 14px; }
|
|
156
|
+
.git-pr-filters select { field-sizing: content; }
|
|
157
|
+
.git-search { order: 1; flex-basis: 100%; margin: 2px 0 8px; }
|
|
158
|
+
.git-file-open { gap: 7px; padding-inline-start: 8px; }
|
|
159
|
+
.git-file > .git-button { margin-inline-end: 4px; padding-inline: 6px; }
|
|
160
|
+
.git-pr-row { grid-template: "title" auto "meta" auto "link" auto "body" auto / minmax(0,1fr); }
|
|
161
|
+
.git-pr-meta { padding-bottom: 2px; }
|
|
162
|
+
.git-review-link { margin-inline-start: 16px; padding-block: 3px 8px; }
|
|
163
|
+
}
|
|
164
|
+
@media (max-width: 820px) {
|
|
165
|
+
body.edit:has(#preview-panes:not(.split) .preview-pane.active .git-page) { grid-template-rows: minmax(0,1fr) 0; }
|
|
166
|
+
}
|
|
167
|
+
@media (pointer: coarse) {
|
|
168
|
+
.git-page :is(.git-button, .git-file-open, .git-pr-open, .git-review-link, summary, select, .git-tabs a) { min-height: 44px; }
|
|
169
|
+
.git-page :is(input:not([type=checkbox]),textarea,select) { font-size: 16px; }
|
|
170
|
+
.git-page .git-file > .git-button, .git-commit-options > summary { min-width: 44px; }
|
|
171
|
+
}
|
|
172
|
+
`;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
/** Keep the native select as the value and change-event source. */
|
|
2
|
-
export declare const mountSelectPickers: (t: (key: string) => string, selects?: Iterable<HTMLSelectElement
|
|
2
|
+
export declare const mountSelectPickers: (t: (key: string) => string, selects?: Iterable<HTMLSelectElement>, settings?: {
|
|
3
|
+
minWidth?: number;
|
|
4
|
+
renderOption?: (item: HTMLButtonElement, option: HTMLOptionElement) => void;
|
|
5
|
+
onAction?: () => void;
|
|
6
|
+
}) => (() => void);
|
|
@@ -15,7 +15,7 @@ const fitWorkspaceLabel = (input, label) => {
|
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
/** Keep the native select as the value and change-event source. */
|
|
18
|
-
export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-lang, #ui-language")) => {
|
|
18
|
+
export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-lang, #ui-language"), settings = {}) => {
|
|
19
19
|
const disposers = [];
|
|
20
20
|
for (const select of selects) {
|
|
21
21
|
const translations = select.id === "fm-lang";
|
|
@@ -48,6 +48,8 @@ export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-l
|
|
|
48
48
|
list.setAttribute("role", "listbox");
|
|
49
49
|
if (translations) {
|
|
50
50
|
list.setAttribute("aria-multiselectable", "true");
|
|
51
|
+
}
|
|
52
|
+
if (translations || settings.onAction) {
|
|
51
53
|
input.setAttribute("aria-keyshortcuts", "Control+Enter");
|
|
52
54
|
}
|
|
53
55
|
input.setAttribute("aria-controls", list.id);
|
|
@@ -70,14 +72,14 @@ export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-l
|
|
|
70
72
|
const selectedText = () => (versions ? select.selectedOptions[0]?.value : select.selectedOptions[0]?.text) ?? "";
|
|
71
73
|
const position = () => {
|
|
72
74
|
const rect = input.getBoundingClientRect();
|
|
73
|
-
const width = workspace || versions
|
|
74
|
-
? Math.min(Math.max(rect.width, workspace ? 280 : 180), innerWidth - 16)
|
|
75
|
+
const width = workspace || versions || settings.minWidth
|
|
76
|
+
? Math.min(Math.max(rect.width, settings.minWidth ?? (workspace ? 280 : 180)), innerWidth - 16)
|
|
75
77
|
: rect.width;
|
|
76
78
|
const below = innerHeight - rect.bottom;
|
|
77
79
|
const above = below < 240 && rect.top > below;
|
|
78
80
|
Object.assign(popup.style, {
|
|
79
81
|
width: `${width}px`,
|
|
80
|
-
left: `${workspace || versions ? Math.max(8, Math.min(workspace ? rect.left + (rect.width - width) / 2 : rect.left, innerWidth - width - 8)) : rect.left}px`,
|
|
82
|
+
left: `${workspace || versions || settings.minWidth ? Math.max(8, Math.min(workspace ? rect.left + (rect.width - width) / 2 : rect.left, innerWidth - width - 8)) : rect.left}px`,
|
|
81
83
|
maxHeight: `${Math.max(80, Math.min(360, (above ? rect.top : below) - 12))}px`,
|
|
82
84
|
top: above ? "auto" : `${rect.bottom + 4}px`,
|
|
83
85
|
bottom: above ? `${innerHeight - rect.top + 4}px` : "auto",
|
|
@@ -161,6 +163,7 @@ export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-l
|
|
|
161
163
|
item.prepend(marker);
|
|
162
164
|
item.setAttribute("aria-current", String(option.selected));
|
|
163
165
|
}
|
|
166
|
+
settings.renderOption?.(item, option);
|
|
164
167
|
if (option.selected)
|
|
165
168
|
selected = count;
|
|
166
169
|
if (option.value === highlighted)
|
|
@@ -200,6 +203,8 @@ export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-l
|
|
|
200
203
|
input.setAttribute("aria-label", select.getAttribute("aria-label") ?? t("Language"));
|
|
201
204
|
if (translations)
|
|
202
205
|
input.setAttribute("aria-description", t("Enter to edit; Ctrl+Enter to add or remove translation"));
|
|
206
|
+
if (settings.onAction)
|
|
207
|
+
input.setAttribute("aria-description", t("Enter to select; Ctrl+Enter to configure"));
|
|
203
208
|
if (!isOpen() || !query) {
|
|
204
209
|
if (workspace)
|
|
205
210
|
fitWorkspaceLabel(input, selectedText());
|
|
@@ -245,6 +250,12 @@ export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-l
|
|
|
245
250
|
return;
|
|
246
251
|
select.dispatchEvent(new CustomEvent("docs:toggle-language", { detail: item.dataset.value }));
|
|
247
252
|
};
|
|
253
|
+
const act = (item) => {
|
|
254
|
+
if (!item || select.disabled)
|
|
255
|
+
return;
|
|
256
|
+
choose(item);
|
|
257
|
+
settings.onAction?.();
|
|
258
|
+
};
|
|
248
259
|
const open = () => {
|
|
249
260
|
if (isOpen() || select.disabled)
|
|
250
261
|
return;
|
|
@@ -293,6 +304,8 @@ export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-l
|
|
|
293
304
|
const item = list.querySelector('[data-active="true"]');
|
|
294
305
|
if (translations && event.ctrlKey)
|
|
295
306
|
toggle(item);
|
|
307
|
+
else if (settings.onAction && event.ctrlKey)
|
|
308
|
+
act(item);
|
|
296
309
|
else
|
|
297
310
|
choose(item);
|
|
298
311
|
}
|
|
@@ -314,6 +327,8 @@ export const mountSelectPickers = (t, selects = document.querySelectorAll("#fm-l
|
|
|
314
327
|
const item = target.closest("button");
|
|
315
328
|
if (translations && target.closest(".language-toggle"))
|
|
316
329
|
toggle(item);
|
|
330
|
+
else if (settings.onAction && target.closest("[data-picker-action]"))
|
|
331
|
+
act(item);
|
|
317
332
|
else
|
|
318
333
|
choose(item);
|
|
319
334
|
});
|