hostlet 0.0.0-stage → 0.1.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +233 -2
- package/bin/hostlet.js +61 -0
- package/console/app/api.js +1223 -0
- package/console/app/boot.js +165 -0
- package/console/app/cards.js +222 -0
- package/console/app/compose-quote.js +127 -0
- package/console/app/config-form.js +727 -0
- package/console/app/document-drafts.js +62 -0
- package/console/app/document-tools.mjs +67 -0
- package/console/app/documents.js +106 -0
- package/console/app/pages.js +6483 -0
- package/console/app/plugins.js +509 -0
- package/console/app/preview-tools.js +172 -0
- package/console/app/reference-labels.js +118 -0
- package/console/app/selection.js +372 -0
- package/console/app/store.js +57 -0
- package/console/app/text-anchor.js +26 -0
- package/console/app/topic-local.js +322 -0
- package/console/app/topic-nav.js +414 -0
- package/console/app/topic-status.js +109 -0
- package/console/app/views.js +43 -0
- package/console/apple-touch-icon.png +0 -0
- package/console/avatars/agy.svg +34 -0
- package/console/avatars/alhena.svg +36 -0
- package/console/avatars/castor.svg +38 -0
- package/console/avatars/claude.svg +34 -0
- package/console/avatars/codex.svg +34 -0
- package/console/avatars/devin.svg +34 -0
- package/console/avatars/echo.svg +34 -0
- package/console/avatars/kimi.svg +33 -0
- package/console/avatars/opencode.svg +33 -0
- package/console/avatars/pinion.svg +34 -0
- package/console/avatars/sprocket.svg +34 -0
- package/console/avatars/vela.svg +44 -0
- package/console/avatars/wasat.svg +38 -0
- package/console/clients/agy.svg +1 -0
- package/console/clients/claude.svg +1 -0
- package/console/clients/codex.svg +1 -0
- package/console/clients/devin.svg +1 -0
- package/console/clients/kimi.svg +1 -0
- package/console/clients/opencode.svg +1 -0
- package/console/favicon.ico +0 -0
- package/console/favicon.svg +16 -0
- package/console/index.html +99 -0
- package/console/pdl/engine/README.md +13 -0
- package/console/pdl/engine/anchor.js +195 -0
- package/console/pdl/engine/core.js +1340 -0
- package/console/pdl/engine/frame.js +1252 -0
- package/console/pdl/engine/i18n.js +67 -0
- package/console/pdl/engine/pdl-check.js +102 -0
- package/console/pdl/engine/pdl-doc.js +353 -0
- package/console/pdl/engine/pdl-view.js +280 -0
- package/console/pdl/engine/pdl.js +1064 -0
- package/console/pdl/engine/platform.js +18 -0
- package/console/pdl/engine/proj.js +279 -0
- package/console/pdl/engine/theme.js +176 -0
- package/console/pdl/engine/tree.js +171 -0
- package/console/pdl/engine/units.js +546 -0
- package/console/pdl/library/README.md +28 -0
- package/console/pdl/library/blocks.js +1512 -0
- package/console/pdl/library/buttons.js +86 -0
- package/console/pdl/library/capsules.js +130 -0
- package/console/pdl/library/charts.js +287 -0
- package/console/pdl/library/code.js +98 -0
- package/console/pdl/library/css/base.css +12 -0
- package/console/pdl/library/css/blocks.css +98 -0
- package/console/pdl/library/css/capsules.css +42 -0
- package/console/pdl/library/css/catalog-page.css +24 -0
- package/console/pdl/library/css/chat.css +100 -0
- package/console/pdl/library/css/composer-top.css +145 -0
- package/console/pdl/library/css/controls.css +195 -0
- package/console/pdl/library/css/drag.css +29 -0
- package/console/pdl/library/css/edit-layout.css +93 -0
- package/console/pdl/library/css/floating-window.css +30 -0
- package/console/pdl/library/css/hover.css +50 -0
- package/console/pdl/library/css/label-search.css +37 -0
- package/console/pdl/library/css/layers.css +43 -0
- package/console/pdl/library/css/library-parts.css +33 -0
- package/console/pdl/library/css/library.css +117 -0
- package/console/pdl/library/css/member-select.css +34 -0
- package/console/pdl/library/css/message.css +72 -0
- package/console/pdl/library/css/page.css +104 -0
- package/console/pdl/library/css/parts.css +338 -0
- package/console/pdl/library/css/responsive.css +40 -0
- package/console/pdl/library/css/roles.css +28 -0
- package/console/pdl/library/css/rows.css +231 -0
- package/console/pdl/library/css/settings-rows.css +37 -0
- package/console/pdl/library/css/shell.css +59 -0
- package/console/pdl/library/css/stream.css +296 -0
- package/console/pdl/library/css/theme-calculator.css +18 -0
- package/console/pdl/library/css/thumb-choice.css +69 -0
- package/console/pdl/library/css/tweaks.css +16 -0
- package/console/pdl/library/css/widgets.css +211 -0
- package/console/pdl/library/css/workbench.css +59 -0
- package/console/pdl/library/feedback.js +83 -0
- package/console/pdl/library/floating-window.mjs +100 -0
- package/console/pdl/library/fold.js +238 -0
- package/console/pdl/library/format.js +53 -0
- package/console/pdl/library/frames.js +123 -0
- package/console/pdl/library/icons.js +165 -0
- package/console/pdl/library/identity.js +149 -0
- package/console/pdl/library/inputs.js +801 -0
- package/console/pdl/library/label-search.js +214 -0
- package/console/pdl/library/markdown-text.js +115 -0
- package/console/pdl/library/markdown.js +150 -0
- package/console/pdl/library/media-viewer.js +293 -0
- package/console/pdl/library/member-select.mjs +32 -0
- package/console/pdl/library/message.js +105 -0
- package/console/pdl/library/motion.js +56 -0
- package/console/pdl/library/overlays.js +165 -0
- package/console/pdl/library/page.js +142 -0
- package/console/pdl/library/plugin-form.js +154 -0
- package/console/pdl/library/registry.js +198 -0
- package/console/pdl/library/rows.js +523 -0
- package/console/pdl/library/shell.js +151 -0
- package/console/pdl/library/stream.js +58 -0
- package/console/pdl/library/tabs.js +259 -0
- package/console/pdl/library/theme-calculator.js +300 -0
- package/console/pdl/library/widgets.js +114 -0
- package/console/pdl/load-order.json +74 -0
- package/console/pdl/platform/README.md +3 -0
- package/console/pdl/platform/rich-markdown.mjs +17 -0
- package/console/pdl/platform/web-links.js +26 -0
- package/console/pdl/platform/web.js +80 -0
- package/console/sdk-browser/mentions.d.mts +16 -0
- package/console/sdk-browser/mentions.mjs +84 -0
- package/console/theme/assets.js +21 -0
- package/console/theme/theme.json +9417 -0
- package/console/theme/tokens.json +444 -0
- package/dist/core/a2a.d.ts +288 -0
- package/dist/core/a2a.js +2197 -0
- package/dist/core/address.d.ts +34 -0
- package/dist/core/address.js +33 -0
- package/dist/core/approval-inputs.d.ts +17 -0
- package/dist/core/approval-inputs.js +70 -0
- package/dist/core/archive.d.ts +19 -0
- package/dist/core/archive.js +135 -0
- package/dist/core/attachments.d.ts +17 -0
- package/dist/core/attachments.js +143 -0
- package/dist/core/blocked-handoffs.d.ts +132 -0
- package/dist/core/blocked-handoffs.js +349 -0
- package/dist/core/config-schema.d.ts +124 -0
- package/dist/core/config-schema.js +192 -0
- package/dist/core/config.d.ts +117 -0
- package/dist/core/config.js +638 -0
- package/dist/core/disk-usage.d.ts +26 -0
- package/dist/core/disk-usage.js +83 -0
- package/dist/core/documents.d.ts +9 -0
- package/dist/core/documents.js +48 -0
- package/dist/core/entry.d.ts +316 -0
- package/dist/core/entry.js +711 -0
- package/dist/core/home.d.ts +76 -0
- package/dist/core/home.js +449 -0
- package/dist/core/i18n.d.ts +36 -0
- package/dist/core/i18n.js +458 -0
- package/dist/core/instances.d.ts +224 -0
- package/dist/core/instances.js +1272 -0
- package/dist/core/members.d.ts +190 -0
- package/dist/core/members.js +358 -0
- package/dist/core/mentions.d.ts +12 -0
- package/dist/core/mentions.js +49 -0
- package/dist/core/messages.d.ts +876 -0
- package/dist/core/messages.js +916 -0
- package/dist/core/notices.d.ts +88 -0
- package/dist/core/notices.js +54 -0
- package/dist/core/ops.d.ts +117 -0
- package/dist/core/ops.js +146 -0
- package/dist/core/package.d.ts +2 -0
- package/dist/core/package.js +14 -0
- package/dist/core/parts.d.ts +25 -0
- package/dist/core/parts.js +119 -0
- package/dist/core/plugins/catalog.d.ts +14 -0
- package/dist/core/plugins/catalog.js +54 -0
- package/dist/core/plugins/external.d.ts +7 -0
- package/dist/core/plugins/external.js +921 -0
- package/dist/core/plugins/index.d.ts +5 -0
- package/dist/core/plugins/index.js +51 -0
- package/dist/core/plugins/npm.d.ts +12 -0
- package/dist/core/plugins/npm.js +99 -0
- package/dist/core/plugins/plugin-manifest.d.ts +12 -0
- package/dist/core/plugins/plugin-manifest.js +231 -0
- package/dist/core/push.d.ts +22 -0
- package/dist/core/push.js +63 -0
- package/dist/core/resource.d.ts +77 -0
- package/dist/core/resource.js +48 -0
- package/dist/core/spawn.d.ts +12 -0
- package/dist/core/spawn.js +30 -0
- package/dist/core/storage-inventory.d.ts +118 -0
- package/dist/core/storage-inventory.js +279 -0
- package/dist/core/storage.d.ts +45 -0
- package/dist/core/storage.js +602 -0
- package/dist/core/store.d.ts +15 -0
- package/dist/core/store.js +33 -0
- package/dist/core/topic-index.d.ts +19 -0
- package/dist/core/topic-index.js +70 -0
- package/dist/core/topic-ops.d.ts +139 -0
- package/dist/core/topic-ops.js +507 -0
- package/dist/core/topic-status.d.ts +32 -0
- package/dist/core/topic-status.js +105 -0
- package/dist/core/topics.d.ts +327 -0
- package/dist/core/topics.js +786 -0
- package/dist/core/turn-clients.d.ts +1 -0
- package/dist/core/turn-clients.js +5 -0
- package/dist/core/types.d.ts +2866 -0
- package/dist/core/types.js +166 -0
- package/dist/core/util.d.ts +10 -0
- package/dist/core/util.js +47 -0
- package/dist/main.d.ts +12 -0
- package/dist/main.js +82 -0
- package/dist/plugins/adapter-acp/index.d.ts +3 -0
- package/dist/plugins/adapter-acp/index.js +57 -0
- package/dist/plugins/adapter-acp/plugin.yaml +100 -0
- package/dist/plugins/adapter-agy/command.d.ts +9 -0
- package/dist/plugins/adapter-agy/command.js +34 -0
- package/dist/plugins/adapter-agy/index.d.ts +5 -0
- package/dist/plugins/adapter-agy/index.js +65 -0
- package/dist/plugins/adapter-agy/quota.d.ts +2 -0
- package/dist/plugins/adapter-agy/quota.js +155 -0
- package/dist/plugins/adapter-agy/terminal.d.ts +6 -0
- package/dist/plugins/adapter-agy/terminal.js +132 -0
- package/dist/plugins/adapter-agy/version.d.ts +9 -0
- package/dist/plugins/adapter-agy/version.js +17 -0
- package/dist/plugins/adapter-claude/index.d.ts +43 -0
- package/dist/plugins/adapter-claude/index.js +412 -0
- package/dist/plugins/adapter-claude/quota.d.ts +14 -0
- package/dist/plugins/adapter-claude/quota.js +103 -0
- package/dist/plugins/adapter-codex/index.d.ts +4 -0
- package/dist/plugins/adapter-codex/index.js +688 -0
- package/dist/plugins/adapter-codex/responses-model.d.ts +9 -0
- package/dist/plugins/adapter-codex/responses-model.js +82 -0
- package/dist/plugins/adapter-kimi/index.d.ts +4 -0
- package/dist/plugins/adapter-kimi/index.js +51 -0
- package/dist/plugins/adapter-kimi/quota.d.ts +3 -0
- package/dist/plugins/adapter-kimi/quota.js +171 -0
- package/dist/plugins/adapter-opencode/index.d.ts +12 -0
- package/dist/plugins/adapter-opencode/index.js +64 -0
- package/dist/plugins/annotations/console/cards.css +189 -0
- package/dist/plugins/annotations/console/cards.mjs +439 -0
- package/dist/plugins/annotations/console/pdl.json +52 -0
- package/dist/plugins/annotations/console/view.mjs +241 -0
- package/dist/plugins/annotations/console/window.mjs +219 -0
- package/dist/plugins/annotations/followups.d.ts +51 -0
- package/dist/plugins/annotations/followups.js +112 -0
- package/dist/plugins/annotations/index.d.ts +3 -0
- package/dist/plugins/annotations/index.js +298 -0
- package/dist/plugins/annotations/plugin.yaml +3 -0
- package/dist/plugins/ask-choice/index.d.ts +9 -0
- package/dist/plugins/ask-choice/index.js +24 -0
- package/dist/plugins/ask-choice/plugin.yaml +2 -0
- package/dist/plugins/background/index.d.ts +2 -0
- package/dist/plugins/background/index.js +398 -0
- package/dist/plugins/background/plugin.yaml +7 -0
- package/dist/plugins/builtin.json +37 -0
- package/dist/plugins/cards/console/pdl.json +516 -0
- package/dist/plugins/cards/console/view.mjs +67 -0
- package/dist/plugins/cards/index.d.ts +8 -0
- package/dist/plugins/cards/index.js +627 -0
- package/dist/plugins/cards/plugin.yaml +3 -0
- package/dist/plugins/console/browser.d.ts +2 -0
- package/dist/plugins/console/browser.js +115 -0
- package/dist/plugins/console/console/pdl.json +38 -0
- package/dist/plugins/console/console/view.mjs +26 -0
- package/dist/plugins/console/index.d.ts +4 -0
- package/dist/plugins/console/index.js +94 -0
- package/dist/plugins/console/picker.d.ts +2 -0
- package/dist/plugins/console/picker.js +48 -0
- package/dist/plugins/console/plugin.yaml +3 -0
- package/dist/plugins/console/topic-view.d.ts +3 -0
- package/dist/plugins/console/topic-view.js +388 -0
- package/dist/plugins/handoff/index.d.ts +2 -0
- package/dist/plugins/handoff/index.js +147 -0
- package/dist/plugins/handoff/plugin.yaml +8 -0
- package/dist/plugins/host-api/index.d.ts +7 -0
- package/dist/plugins/host-api/index.js +310 -0
- package/dist/plugins/host-api/plugin.yaml +2 -0
- package/dist/plugins/host-api/signing.d.ts +63 -0
- package/dist/plugins/host-api/signing.js +427 -0
- package/dist/plugins/host-api/skills/host-ops/SKILL.md +28 -0
- package/dist/plugins/host-api/skills/hostlet-plugin-dev/SKILL.md +38 -0
- package/dist/plugins/inbox/index.d.ts +15 -0
- package/dist/plugins/inbox/index.js +161 -0
- package/dist/plugins/inbox/plugin.yaml +2 -0
- package/dist/plugins/keys/account-directories.d.ts +18 -0
- package/dist/plugins/keys/account-directories.js +86 -0
- package/dist/plugins/keys/account-storage.d.ts +18 -0
- package/dist/plugins/keys/account-storage.js +112 -0
- package/dist/plugins/keys/console/pdl.json +710 -0
- package/dist/plugins/keys/console/view.mjs +619 -0
- package/dist/plugins/keys/index.d.ts +7 -0
- package/dist/plugins/keys/index.js +842 -0
- package/dist/plugins/keys/login-link.d.ts +2 -0
- package/dist/plugins/keys/login-link.js +15 -0
- package/dist/plugins/keys/plugin.yaml +3 -0
- package/dist/plugins/keys/quota-history.d.ts +91 -0
- package/dist/plugins/keys/quota-history.js +420 -0
- package/dist/plugins/mcp/console/pdl.json +412 -0
- package/dist/plugins/mcp/console/view.mjs +207 -0
- package/dist/plugins/mcp/index.d.ts +7 -0
- package/dist/plugins/mcp/index.js +494 -0
- package/dist/plugins/mcp/plugin.yaml +3 -0
- package/dist/plugins/member-health/index.d.ts +2 -0
- package/dist/plugins/member-health/index.js +478 -0
- package/dist/plugins/member-health/plugin.yaml +2 -0
- package/dist/plugins/memory/capabilities.d.ts +10 -0
- package/dist/plugins/memory/capabilities.js +70 -0
- package/dist/plugins/memory/console/pdl.json +459 -0
- package/dist/plugins/memory/console/view.mjs +254 -0
- package/dist/plugins/memory/corpus.d.ts +60 -0
- package/dist/plugins/memory/corpus.js +521 -0
- package/dist/plugins/memory/engines/fts-tree-diversity.d.ts +8 -0
- package/dist/plugins/memory/engines/fts-tree-diversity.js +49 -0
- package/dist/plugins/memory/engines/fts-tree-text.d.ts +12 -0
- package/dist/plugins/memory/engines/fts-tree-text.js +93 -0
- package/dist/plugins/memory/engines/fts-tree.d.ts +4 -0
- package/dist/plugins/memory/engines/fts-tree.js +387 -0
- package/dist/plugins/memory/engines/search.d.ts +9 -0
- package/dist/plugins/memory/engines/search.js +35 -0
- package/dist/plugins/memory/index.d.ts +3 -0
- package/dist/plugins/memory/index.js +465 -0
- package/dist/plugins/memory/notes.d.ts +22 -0
- package/dist/plugins/memory/notes.js +140 -0
- package/dist/plugins/memory/plugin.yaml +23 -0
- package/dist/plugins/model-profiles/index.d.ts +2 -0
- package/dist/plugins/model-profiles/index.js +919 -0
- package/dist/plugins/model-profiles/plugin.yaml +13 -0
- package/dist/plugins/model-profiles/review-source.d.ts +11 -0
- package/dist/plugins/model-profiles/review-source.js +640 -0
- package/dist/plugins/model-profiles/rules.d.ts +132 -0
- package/dist/plugins/model-profiles/rules.js +767 -0
- package/dist/plugins/model-profiles/skills/model-profile/SKILL.md +60 -0
- package/dist/plugins/model-profiles/sources.d.ts +61 -0
- package/dist/plugins/model-profiles/sources.js +375 -0
- package/dist/plugins/model-profiles/storage.d.ts +104 -0
- package/dist/plugins/model-profiles/storage.js +352 -0
- package/dist/plugins/model-profiles/types.d.ts +187 -0
- package/dist/plugins/model-profiles/types.js +12 -0
- package/dist/plugins/model-profiles/wakeup.d.ts +29 -0
- package/dist/plugins/model-profiles/wakeup.js +390 -0
- package/dist/plugins/models/index.d.ts +2 -0
- package/dist/plugins/models/index.js +63 -0
- package/dist/plugins/models/plugin.yaml +8 -0
- package/dist/plugins/ops/collector.d.ts +22 -0
- package/dist/plugins/ops/collector.js +48 -0
- package/dist/plugins/ops/config.d.ts +11 -0
- package/dist/plugins/ops/config.js +13 -0
- package/dist/plugins/ops/console/pdl.json +676 -0
- package/dist/plugins/ops/console/view.mjs +700 -0
- package/dist/plugins/ops/index.d.ts +3 -0
- package/dist/plugins/ops/index.js +20 -0
- package/dist/plugins/ops/journal.d.ts +7 -0
- package/dist/plugins/ops/journal.js +109 -0
- package/dist/plugins/ops/metrics.d.ts +3 -0
- package/dist/plugins/ops/metrics.js +81 -0
- package/dist/plugins/ops/plugin.yaml +63 -0
- package/dist/plugins/ops/samples.d.ts +54 -0
- package/dist/plugins/ops/samples.js +100 -0
- package/dist/plugins/ops/trace.d.ts +3 -0
- package/dist/plugins/ops/trace.js +104 -0
- package/dist/plugins/ops/usage.d.ts +2 -0
- package/dist/plugins/ops/usage.js +152 -0
- package/dist/plugins/plans/acceptance.d.ts +284 -0
- package/dist/plugins/plans/acceptance.js +247 -0
- package/dist/plugins/plans/blocked.d.ts +25 -0
- package/dist/plugins/plans/blocked.js +66 -0
- package/dist/plugins/plans/console/pdl.json +639 -0
- package/dist/plugins/plans/console/view.d.mts +2 -0
- package/dist/plugins/plans/console/view.mjs +855 -0
- package/dist/plugins/plans/dependencies.d.ts +5 -0
- package/dist/plugins/plans/dependencies.js +21 -0
- package/dist/plugins/plans/index.d.ts +72 -0
- package/dist/plugins/plans/index.js +2057 -0
- package/dist/plugins/plans/plugin.yaml +44 -0
- package/dist/plugins/plans/progress.d.ts +82 -0
- package/dist/plugins/plans/progress.js +516 -0
- package/dist/plugins/prompt/index.d.ts +8 -0
- package/dist/plugins/prompt/index.js +361 -0
- package/dist/plugins/prompt/plugin.yaml +2 -0
- package/dist/plugins/recovery/console/pdl.json +50 -0
- package/dist/plugins/recovery/console/view.mjs +46 -0
- package/dist/plugins/recovery/index.d.ts +9 -0
- package/dist/plugins/recovery/index.js +454 -0
- package/dist/plugins/recovery/plugin.yaml +9 -0
- package/dist/plugins/recovery/probe.d.ts +11 -0
- package/dist/plugins/recovery/probe.js +128 -0
- package/dist/plugins/restart/console/pdl.json +112 -0
- package/dist/plugins/restart/console/view.mjs +85 -0
- package/dist/plugins/restart/index.d.ts +10 -0
- package/dist/plugins/restart/index.js +669 -0
- package/dist/plugins/restart/plugin.yaml +9 -0
- package/dist/plugins/restart/scope.d.ts +6 -0
- package/dist/plugins/restart/scope.js +44 -0
- package/dist/plugins/schedule/console/pdl.json +696 -0
- package/dist/plugins/schedule/console/view.mjs +398 -0
- package/dist/plugins/schedule/events.d.ts +76 -0
- package/dist/plugins/schedule/events.js +158 -0
- package/dist/plugins/schedule/index.d.ts +32 -0
- package/dist/plugins/schedule/index.js +1199 -0
- package/dist/plugins/schedule/plugin.yaml +26 -0
- package/dist/plugins/schedule/when.d.ts +14 -0
- package/dist/plugins/schedule/when.js +83 -0
- package/dist/plugins/sessions/console/pdl.json +259 -0
- package/dist/plugins/sessions/console/view.mjs +355 -0
- package/dist/plugins/sessions/index.d.ts +3 -0
- package/dist/plugins/sessions/index.js +126 -0
- package/dist/plugins/sessions/participants.d.ts +28 -0
- package/dist/plugins/sessions/participants.js +83 -0
- package/dist/plugins/sessions/plugin.yaml +3 -0
- package/dist/plugins/signals/console/pdl.json +802 -0
- package/dist/plugins/signals/console/view.mjs +284 -0
- package/dist/plugins/signals/content.d.ts +31 -0
- package/dist/plugins/signals/content.js +151 -0
- package/dist/plugins/signals/index.d.ts +2 -0
- package/dist/plugins/signals/index.js +601 -0
- package/dist/plugins/signals/plugin.yaml +32 -0
- package/dist/plugins/signals/skills/signal-sources/SKILL.md +27 -0
- package/dist/plugins/skills/console/pdl.json +254 -0
- package/dist/plugins/skills/console/view.mjs +204 -0
- package/dist/plugins/skills/index.d.ts +11 -0
- package/dist/plugins/skills/index.js +567 -0
- package/dist/plugins/skills/install.d.ts +69 -0
- package/dist/plugins/skills/install.js +265 -0
- package/dist/plugins/skills/plugin.yaml +24 -0
- package/dist/plugins/skills/safety-scan.d.ts +17 -0
- package/dist/plugins/skills/safety-scan.js +78 -0
- package/dist/plugins/skills/skills/skill-ops/SKILL.md +29 -0
- package/dist/plugins/terminal/console/pdl.json +115 -0
- package/dist/plugins/terminal/console/view.mjs +178 -0
- package/dist/plugins/terminal/index.d.ts +3 -0
- package/dist/plugins/terminal/index.js +204 -0
- package/dist/plugins/terminal/plugin.yaml +2 -0
- package/dist/plugins/tools/index.d.ts +3 -0
- package/dist/plugins/tools/index.js +458 -0
- package/dist/plugins/tools/plugin.yaml +2 -0
- package/dist/plugins/tools/token.d.ts +61 -0
- package/dist/plugins/tools/token.js +179 -0
- package/dist/plugins/topic-tools/index.d.ts +9 -0
- package/dist/plugins/topic-tools/index.js +29 -0
- package/dist/plugins/topic-tools/plugin.yaml +2 -0
- package/dist/plugins/topic-tools/skills/topic-tidy/SKILL.md +108 -0
- package/dist/plugins/works/console/pdl.json +120 -0
- package/dist/plugins/works/console/view.mjs +91 -0
- package/dist/plugins/works/document-words.d.ts +50 -0
- package/dist/plugins/works/document-words.js +27 -0
- package/dist/plugins/works/editors.d.ts +3 -0
- package/dist/plugins/works/editors.js +162 -0
- package/dist/plugins/works/events.d.ts +58 -0
- package/dist/plugins/works/events.js +82 -0
- package/dist/plugins/works/files.d.ts +23 -0
- package/dist/plugins/works/files.js +53 -0
- package/dist/plugins/works/index.d.ts +9 -0
- package/dist/plugins/works/index.js +1088 -0
- package/dist/plugins/works/plugin.yaml +9 -0
- package/dist/plugins/works/preview.d.ts +10 -0
- package/dist/plugins/works/preview.js +30 -0
- package/dist/plugins/works/project.d.ts +3 -0
- package/dist/plugins/works/project.js +245 -0
- package/dist/plugins/works/resource.d.ts +28 -0
- package/dist/plugins/works/resource.js +71 -0
- package/dist/plugins/works/retention.d.ts +36 -0
- package/dist/plugins/works/retention.js +295 -0
- package/dist/plugins/works/skills/works-ops/SKILL.md +14 -0
- package/dist/plugins/works/viewers.d.ts +13 -0
- package/dist/plugins/works/viewers.js +87 -0
- package/dist/plugins/works/web/anchors.js +94 -0
- package/dist/plugins/works/web/document-edit.js +245 -0
- package/dist/plugins/works/web/preview-bridge.js +142 -0
- package/dist/plugins/works/web/reading-position.js +74 -0
- package/dist/plugins/works/web/view.html +1118 -0
- package/dist/runtime/runtime.d.ts +210 -0
- package/dist/runtime/runtime.js +338 -0
- package/dist/sdk/adapter-kit.d.ts +1 -0
- package/dist/sdk/adapter-kit.js +1 -0
- package/dist/sdk/client.d.ts +163 -0
- package/dist/sdk/client.js +43 -0
- package/dist/sdk/contracts.d.ts +1263 -0
- package/dist/sdk/contracts.js +1 -0
- package/dist/sdk/index.d.ts +57 -0
- package/dist/sdk/index.js +27 -0
- package/dist/sdk/source-choice.d.ts +40 -0
- package/dist/sdk/source-choice.js +217 -0
- package/dist/sdk/topic-text.d.ts +5 -0
- package/dist/sdk/topic-text.js +26 -0
- package/dist/sdk/transport.d.ts +12 -0
- package/dist/sdk/transport.js +34 -0
- package/node_modules/@hostlet/adapter-kit/dist/acp.d.ts +88 -0
- package/node_modules/@hostlet/adapter-kit/dist/acp.js +674 -0
- package/node_modules/@hostlet/adapter-kit/dist/command.d.ts +18 -0
- package/node_modules/@hostlet/adapter-kit/dist/command.js +39 -0
- package/node_modules/@hostlet/adapter-kit/dist/index.d.ts +8 -0
- package/node_modules/@hostlet/adapter-kit/dist/index.js +6 -0
- package/node_modules/@hostlet/adapter-kit/dist/models.d.ts +29 -0
- package/node_modules/@hostlet/adapter-kit/dist/models.js +108 -0
- package/node_modules/@hostlet/adapter-kit/dist/quota.d.ts +3 -0
- package/node_modules/@hostlet/adapter-kit/dist/quota.js +4 -0
- package/node_modules/@hostlet/adapter-kit/dist/rpc.d.ts +29 -0
- package/node_modules/@hostlet/adapter-kit/dist/rpc.js +84 -0
- package/node_modules/@hostlet/adapter-kit/dist/upstream-failure.d.ts +5 -0
- package/node_modules/@hostlet/adapter-kit/dist/upstream-failure.js +37 -0
- package/node_modules/@hostlet/adapter-kit/package.json +16 -0
- package/node_modules/@hostlet/platform/dist/desktop.d.ts +16 -0
- package/node_modules/@hostlet/platform/dist/desktop.js +276 -0
- package/node_modules/@hostlet/platform/dist/files.d.ts +24 -0
- package/node_modules/@hostlet/platform/dist/files.js +113 -0
- package/node_modules/@hostlet/platform/dist/index.d.ts +6 -0
- package/node_modules/@hostlet/platform/dist/index.js +4 -0
- package/node_modules/@hostlet/platform/dist/paths.d.ts +4 -0
- package/node_modules/@hostlet/platform/dist/paths.js +9 -0
- package/node_modules/@hostlet/platform/dist/process.d.ts +45 -0
- package/node_modules/@hostlet/platform/dist/process.js +297 -0
- package/node_modules/@hostlet/platform/package.json +14 -0
- package/package.json +60 -4
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/* 边界:一个含义一个组件、不为接口定制、不按位置推导样式 */
|
|
2
|
+
/* 组件库 · 复合组件的样式(code.js、media-viewer.js、charts.js、widgets.js):终端、差异、日志、媒体查看器、时间线播放器、关系图、柱状图、卡片网格。
|
|
3
|
+
只用 token;页面不再给这些组件写样式。 */
|
|
4
|
+
/* 终端 */
|
|
5
|
+
/* 日期网格:月 / 周共用日期单元格,容器宽度决定七列的宽度。 */
|
|
6
|
+
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--sp-xs); }
|
|
7
|
+
.calendar-weekdays { text-align: center; padding-block: var(--sp-s); }
|
|
8
|
+
.calendar-day { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: var(--row-h-1); padding: var(--sp-xs); background: transparent; border: 0; border-radius: var(--r-s); font-family: inherit; cursor: pointer; }
|
|
9
|
+
.calendar-day:hover { background: var(--btn-soft-hover); }
|
|
10
|
+
.calendar-day[aria-pressed="true"] { background: var(--btn-soft); }
|
|
11
|
+
.calendar-day[data-marked="true"] { background: color-mix(in srgb, var(--accent) 24%, transparent); }
|
|
12
|
+
.calendar-day[data-marked="true"]:hover { background: color-mix(in srgb, var(--accent) 32%, transparent); }
|
|
13
|
+
.calendar-day[data-marked="true"][aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 38%, transparent); box-shadow: inset 0 0 0 1.5px var(--accent); }
|
|
14
|
+
.calendar-day[data-marked="true"][data-span="start"] { border-radius: var(--r-s) var(--r-xs) var(--r-xs) var(--r-s); }
|
|
15
|
+
.calendar-day[data-marked="true"][data-span="mid"] { border-radius: var(--r-xs); }
|
|
16
|
+
.calendar-day[data-marked="true"][data-span="end"] { border-radius: var(--r-xs) var(--r-s) var(--r-s) var(--r-xs); }
|
|
17
|
+
.calendar-day[data-marked="true"] > span:first-child { font-weight: var(--fw-medium); }
|
|
18
|
+
.calendar-day[data-outside="true"] > span:first-child { color: var(--fg-faint); }
|
|
19
|
+
.calendar-day[data-today="true"] > span:first-child { text-decoration: underline; text-underline-offset: var(--sp-xs); }
|
|
20
|
+
.calendar-count { min-height: 1em; line-height: 1; }
|
|
21
|
+
.calendar-day:disabled { opacity: var(--op-disabled); cursor: default; }
|
|
22
|
+
.calendar-day:disabled:hover { background: transparent; }
|
|
23
|
+
.date-picker {
|
|
24
|
+
--u-w: calc(7 * var(--row-h-1) + 6 * var(--sp-xs) + 2 * var(--sp-s));
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
height: max-content;
|
|
28
|
+
max-height: calc(100dvh - 2 * var(--sp-s));
|
|
29
|
+
position-try-fallbacks: flip-inline, flip-block, flip-block flip-inline, --date-picker-fit;
|
|
30
|
+
}
|
|
31
|
+
@position-try --date-picker-fit {
|
|
32
|
+
position-area: none;
|
|
33
|
+
inset: var(--sp-s);
|
|
34
|
+
margin: auto;
|
|
35
|
+
}
|
|
36
|
+
.date-picker .float-body { min-height: 0; }
|
|
37
|
+
.date-picker .float-foot { display: flex; justify-content: space-between; flex: none; }
|
|
38
|
+
.date-month { text-align: center; }
|
|
39
|
+
.date-picker .calendar-count:empty { display: none; }
|
|
40
|
+
.tm { position: relative; flex: 1; min-height: calc(6 * var(--row-h-1)); display: flex; flex-direction: column; background: var(--term-bg); border-radius: 0 var(--r-m) var(--r-m) var(--r-m); }
|
|
41
|
+
.tm-screen { flex: 1; min-height: 0; contain: size; padding: var(--sp-s) var(--sp-m) var(--sp-m); font: var(--fs-s) var(--font-mono); color: var(--term-fg); }
|
|
42
|
+
.tm.ro .tm-screen { cursor: default; }
|
|
43
|
+
.tm.off .tm-screen { opacity: var(--op-disabled); }
|
|
44
|
+
/* 差异 */
|
|
45
|
+
.wc-diff { margin: var(--sp-hair) 0 var(--sp-xs); font: var(--fs-s)/1.6 var(--font-mono); background: var(--diff-bg); border-radius: var(--r-m); padding: var(--sp-xs) 0; }
|
|
46
|
+
.wc-diff.empty-diff { font-family: inherit; color: var(--fg-faint); padding: var(--sp-s) var(--sp-m); }
|
|
47
|
+
.wc-hunk { padding: var(--sp-hair) var(--sp-m); color: var(--fg-faint); grid-column: 1 / -1; }
|
|
48
|
+
.wc-dl { padding: 0 var(--sp-m) 0 0; white-space: pre; color: var(--fg-strong); }
|
|
49
|
+
.wc-sign { display: inline-block; width: var(--ctl-xs); text-align: center; color: var(--fg-faint); }
|
|
50
|
+
.wc-dl.add, .wc-sl.add { background: var(--ok-wash); }
|
|
51
|
+
.wc-dl.del, .wc-sl.del { background: var(--danger-wash); }
|
|
52
|
+
.wc-diff.split { display: grid; grid-template-columns: 1fr 1fr; }
|
|
53
|
+
.wc-sl { padding: 0 var(--sp-s); white-space: pre; overflow: clip; text-overflow: ellipsis; min-height: 1.6em; }
|
|
54
|
+
.wc-sl.gap { background: var(--bg-hover); }
|
|
55
|
+
/* 日志 */
|
|
56
|
+
.wpv-log { padding-bottom: var(--sp-xs); max-height: calc(8 * var(--row-h)); } /* 日志自己滚动:条目多了不把所在的页面往下推 */
|
|
57
|
+
.wpv-ce { display: flex; align-items: baseline; gap: var(--sp-s); padding: var(--sp-hair) var(--sp-m); font-size: var(--fs-s); }
|
|
58
|
+
.wpv-ce:hover { background: var(--bg-hover); }
|
|
59
|
+
.wpv-ce:is([data-tone="warn"], [data-tone="danger"]) { background: var(--tone-soft); } /* 留意 / 出错的一条:浅色调底(色点是共用的状态点 .dot) */
|
|
60
|
+
.wpv-ce[data-tone="danger"] { color: var(--tone-c); }
|
|
61
|
+
.wpv-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
|
|
62
|
+
.wpv-ce .num { width: calc(15 * var(--unit)); flex: none; text-align: right; }
|
|
63
|
+
/* 媒体本体与原始像素坐标上的标记;标题和操作不属于本体。 */
|
|
64
|
+
.media-content { position: relative; width: 100%; line-height: 0; }
|
|
65
|
+
.media-content > img, .media-content > video, .media-content > audio { display: block; width: 100%; height: auto; border-radius: var(--r-m); }
|
|
66
|
+
.media-content[data-pick] > img, .media-content[data-pick] > video { cursor: crosshair; touch-action: none; }
|
|
67
|
+
.media-marks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; fill: none; stroke: var(--fg-strong); stroke-width: 2; }
|
|
68
|
+
.media-marks > * { vector-effect: non-scaling-stroke; filter: drop-shadow(0 1px 1px var(--bg-page)); }
|
|
69
|
+
.media-mark { position: absolute; left: calc(var(--mark-x) / var(--media-w) * 100%); top: calc(var(--mark-y) / var(--media-h) * 100%); translate: -50% -50%; }
|
|
70
|
+
.annotation-quote { background: var(--accent-soft); color: inherit; border-radius: var(--r-xs); }
|
|
71
|
+
.annotation-mark { vertical-align: middle; }
|
|
72
|
+
/* 时间线播放器:只画控制条,正文共用消息流。 */
|
|
73
|
+
.rp { min-height: 0; }
|
|
74
|
+
/* 回放剧场:铺满的弹窗框架;中间是消息流(对话区同一个消息模板),底下是播放器的控制条 */
|
|
75
|
+
.rp-dock { flex: none; position: sticky; bottom: 0; margin: 0 calc(-1 * var(--sp-xs)); padding: var(--sp-s) var(--sp-m) var(--sp-s); border-radius: var(--r-full); background: var(--bg-raised); box-shadow: var(--shadow-dock); }
|
|
76
|
+
.rp-scrub { position: relative; height: var(--av-s); }
|
|
77
|
+
.rp-scrub svg { position: absolute; inset: 0; width: 100%; height: 100%; }
|
|
78
|
+
.rp-track { stroke: var(--line); }
|
|
79
|
+
.rp-done { stroke: var(--fg); }
|
|
80
|
+
.rp-scrub input { position: absolute; inset: 0; width: 100%; margin: 0; opacity: 0; cursor: pointer; }
|
|
81
|
+
.rp-skip { display: flex; align-items: center; gap: var(--sp-xs); margin: var(--sp-hair) 0 0; font-size: var(--fs-s); color: var(--fg-muted); }
|
|
82
|
+
.rp-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-xs); padding-top: var(--sp-xs); }
|
|
83
|
+
.rp-time { display: flex; flex-direction: column; font-size: var(--fs-s); line-height: 1.3; margin-left: var(--sp-xs); }
|
|
84
|
+
/* 关系图:card 节点(圆角块 + 状态点)、bubble 节点(圆 + 名字在下);可拖动平移的图手型光标 */
|
|
85
|
+
.g-wrap { padding: var(--sp-s); overflow: hidden; }
|
|
86
|
+
.g-wrap.g-scroll { max-block-size: 100dvh; overflow: auto; cursor: grab; }
|
|
87
|
+
@media (height < 540px) { .g-wrap.g-scroll { overscroll-behavior-y: auto; } }
|
|
88
|
+
.graph { width: 100%; height: auto; display: block; }
|
|
89
|
+
.g-scroll > .graph { width: var(--graph-width); max-width: 100%; min-width: calc(var(--graph-width) * .8); user-select: none; }
|
|
90
|
+
.graph.pan { cursor: grab; touch-action: none; }
|
|
91
|
+
.g-scroll.g-dragging, .g-scroll.g-dragging .g-node { cursor: grabbing; }
|
|
92
|
+
.graph :is(line, .g-arrow, .g-curve) { stroke: var(--line-strong); stroke-width: 1.5; fill: none; }
|
|
93
|
+
.graph text { fill: var(--fg); font: var(--fs-s) var(--font-text); }
|
|
94
|
+
.g-node { cursor: pointer; }
|
|
95
|
+
.g-node.card rect { fill: var(--bg-field); }
|
|
96
|
+
.g-node.card.on rect { fill: var(--bg-selected); stroke: var(--fg-strong); stroke-width: 1.5; }
|
|
97
|
+
.g-card-text { color: var(--fg-strong); font: var(--fs-s)/36px var(--font-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
98
|
+
.g-node.dim { opacity: var(--op-disabled); }
|
|
99
|
+
.g-st.warn { fill: var(--warn); }
|
|
100
|
+
.g-st.info { fill: var(--info); }
|
|
101
|
+
.g-st.ok { fill: var(--ok); }
|
|
102
|
+
.g-st.idle { fill: var(--fg-faint); }
|
|
103
|
+
.g-node.bubble circle { fill: var(--bg-field); stroke: var(--fg-muted); stroke-width: 1.5; }
|
|
104
|
+
.g-node.bubble.hub circle { fill: var(--bg-selected); stroke: var(--fg-strong); }
|
|
105
|
+
.g-node.bubble:hover circle { stroke: var(--fg-strong); }
|
|
106
|
+
.g-legend { white-space: normal; } /* 图例是一句话,窄的面板里换行,不伸出面板 */
|
|
107
|
+
.g-legend > span + span { margin-left: var(--sp-xs); }
|
|
108
|
+
.g-legend .dot { margin-right: var(--sp-hair); }
|
|
109
|
+
/* 柱状图 */
|
|
110
|
+
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--sp-s); align-items: end; height: calc(3 * var(--row-h-1)); padding: var(--sp-m) var(--sp-m) var(--sp-s); }
|
|
111
|
+
.bars > div { display: flex; flex-direction: column; align-items: center; gap: var(--sp-xs); height: 100%; justify-content: flex-end; }
|
|
112
|
+
.bars span { width: 100%; max-width: var(--ctl-s); background: var(--fg-muted); border-radius: var(--r-xs) var(--r-xs) 0 0; display: flex; flex-direction: column; }
|
|
113
|
+
.bars span i { display: block; background: var(--fg-faint); border-radius: var(--r-xs) var(--r-xs) 0 0; }
|
|
114
|
+
.bars em { max-inline-size: 100%; font-style: normal; }
|
|
115
|
+
/* 卡片网格 */
|
|
116
|
+
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--span-3)), 1fr)); gap: var(--sp-m); }
|
|
117
|
+
.cgrid-card { background: var(--bg-group); border-radius: var(--r-l); padding: var(--sp-xs); display: flex; flex-direction: column; gap: var(--sp-xs); min-width: 0; }
|
|
118
|
+
.cgrid-prev { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: var(--r-m); background: var(--bg-field); color: var(--fg-muted); display: grid; place-items: center; cursor: pointer; }
|
|
119
|
+
.cgrid-prev:hover { background: var(--bg-selected); color: var(--fg-strong); }
|
|
120
|
+
.cgrid-prev > :is(img, video) { width: 100%; height: 100%; object-fit: cover; pointer-events: none; border-radius: inherit; }
|
|
121
|
+
.cgrid-meta { padding: var(--sp-hair) var(--sp-xs) var(--sp-xs); display: flex; flex-direction: column; gap: var(--sp-hairline); min-width: 0; flex: 1; }
|
|
122
|
+
.cgrid-t { overflow: clip; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2lh; }
|
|
123
|
+
.cgrid-foot { margin-top: auto; display: flex; align-items: center; gap: var(--sp-s); }
|
|
124
|
+
.cgrid-foot > .cgrid-s { flex: 1; min-width: 0; }
|
|
125
|
+
.cgrid-s { overflow: clip; white-space: nowrap; text-overflow: ellipsis; }
|
|
126
|
+
/* 选一项的格子(tiles 控件):小卡 / 色块头像;上传按钮里的文件框藏起来 */
|
|
127
|
+
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(50 * var(--unit)), 1fr)); gap: var(--sp-s); }
|
|
128
|
+
.tpl { display: flex; gap: var(--sp-s); align-items: flex-start; text-align: left; padding: var(--sp-m); border: 0; border-radius: var(--r-l); background: var(--bg-group); cursor: pointer; color: var(--fg-strong); min-width: 0; }
|
|
129
|
+
.tpl:hover { background: var(--bg-hover); }
|
|
130
|
+
.tpl[aria-pressed="true"] { background: var(--bg-selected); }
|
|
131
|
+
.tpl-t { display: flex; flex-direction: column; gap: var(--sp-hairline); min-width: 0; }
|
|
132
|
+
@media (max-width: 640px) { .tpl-grid { grid-template-columns: minmax(0, 1fr); } }
|
|
133
|
+
/* 组件库的修饰类:静态的是档位修饰;随数据变的值由脚本只写成自定义属性 --u-*,画法在这里。
|
|
134
|
+
放在最后加载的组件库文件里,压过所在组件的默认值 */
|
|
135
|
+
.u-m0 { margin: 0; } .u-p0 { padding: 0; } .u-pt0 { padding-top: 0; } .u-p-xs { padding: var(--sp-xs); } .u-p-m { padding: var(--sp-m); }
|
|
136
|
+
.u-p-empty { padding: var(--sp-l) var(--sp-s); } .u-p-foot { padding: 0 var(--sp-m) var(--sp-m); } .u-mt-s { margin-top: var(--sp-s); } .u-m-chip { margin: 0 var(--sp-xs) var(--sp-s); }
|
|
137
|
+
.t-s { font-size: var(--fs-s); } .t-m { font-size: var(--fs-m); } .t-title { font-size: var(--fs-title); }
|
|
138
|
+
.u-w-normal { font-weight: 400; } .u-strong { font-weight: 500; color: var(--fg-strong); } .u-nowrap { white-space: nowrap; } .u-mw-none { max-width: none; } .u-disabled { opacity: var(--op-disabled); pointer-events: none; }
|
|
139
|
+
.u-v-width { width: var(--u-width); } .u-v-height { height: var(--u-height); } .u-v-background { background: var(--u-background); }
|
|
140
|
+
.tile-av { border: 0; padding: 0; background: none; border-radius: var(--r-full); cursor: pointer; }
|
|
141
|
+
.tile-av[aria-pressed="true"] .avatar { box-shadow: 0 0 0 2px var(--bg-raised), 0 0 0 3.5px var(--fg-strong); } /* 选中:和色调选择同一个选中环 */
|
|
142
|
+
|
|
143
|
+
/* 选择时命中标绘;绘画时把手势交给底下的媒体。文字和线条保持媒体像素尺寸。 */
|
|
144
|
+
.media-marks [data-markup-id] { vector-effect: none; }
|
|
145
|
+
.media-content[data-markup-mode="select"] [data-markup-id] { pointer-events: visiblePainted; cursor: pointer; }
|
|
146
|
+
.media-marks [data-selected="true"] { filter: drop-shadow(0 0 var(--sp-xs) var(--fg-strong)); }
|
|
147
|
+
.media-marks text { font-family: var(--font-text); }
|
|
148
|
+
|
|
149
|
+
/* How full a member's context or quota is: avatar-sized ring with percentage inside. */
|
|
150
|
+
.lr .theme-dot { display: inline-block; vertical-align: middle; margin-inline-end: var(--sp-xs); box-shadow: none; }
|
|
151
|
+
[data-view="ws.run"] .lr > .lr-head > .lr-aside { align-items: center; }
|
|
152
|
+
[data-view="ws.run"] .lr > .lr-head > .lr-aside .lr-aside-t { display: inline-flex; align-items: center; }
|
|
153
|
+
[data-view="ws.run"] .lr > .lr-head > .lr-end { align-items: center; }
|
|
154
|
+
[data-view="ws.run"] .lr > .lr-head .lr-col.lr-ctl { align-self: center; padding-inline-start: var(--sp-hair); }
|
|
155
|
+
[data-view="ws.run"] .lr > .lr-head .lr-col.lr-ctl > .btn { margin-inline: 0; }
|
|
156
|
+
[data-view="ws.run"] .lr-more > .kvg { grid-template-columns: calc(16 * var(--unit)) minmax(0, 1fr); }
|
|
157
|
+
.hl-ring { position: relative; display: inline-grid; place-items: center; vertical-align: middle; width: var(--av-m); height: var(--av-m); flex: none; }
|
|
158
|
+
.hl-ring-svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
|
|
159
|
+
.hl-ring-track { fill: none; stroke: var(--line-strong); stroke-width: 2.6; }
|
|
160
|
+
.hl-ring-arc { fill: none; stroke-width: 2.6; stroke-linecap: round; }
|
|
161
|
+
.hl-ring-v { position: absolute; font-size: 10px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; color: var(--fg-strong); pointer-events: none; }
|
|
162
|
+
.hl-ring[data-full] .hl-ring-v { font-size: 9px; letter-spacing: -0.04em; }
|
|
163
|
+
.hl-ring[data-empty] .hl-ring-v { color: var(--fg-faint); }
|
|
164
|
+
.hl-ring[data-empty] .hl-ring-track { stroke: var(--fg-faint); opacity: .75; }
|
|
165
|
+
.hl-member-quotas { display: inline-flex; align-items: center; gap: var(--sp-xs); max-inline-size: 100%; overflow-x: auto; scrollbar-width: none; vertical-align: middle; cursor: default; }
|
|
166
|
+
.hl-member-quotas .hl-ring:focus-visible { outline-offset: -2px; border-radius: var(--r-full); }
|
|
167
|
+
@media (max-width: 480px) { .hl-member-quotas .hl-ring { width: var(--ctl-xs); height: var(--ctl-xs); } }
|
|
168
|
+
[data-view="page.members"] .lr-inline .lr-col[data-w="state"] { text-align: start; }
|
|
169
|
+
.field .ws-range { max-width: 100%; }
|
|
170
|
+
[data-view="ws.overview"] .field-add > .ifield { width: calc(44 * var(--unit)); height: var(--ctl-s); }
|
|
171
|
+
.hl-quotas { margin-top: var(--sp-xs); align-items: start; }
|
|
172
|
+
.hl-quotas:not(:has(.hl-quota-gtitle)) { align-items: center; }
|
|
173
|
+
.hl-quota-list { display: flex; flex-direction: column; gap: var(--sp-s); }
|
|
174
|
+
.hl-quota-group { display: flex; flex-direction: column; gap: var(--sp-xs); }
|
|
175
|
+
.hl-quota-gtitle { font-size: var(--fs-xs); font-weight: 500; color: var(--fg-muted); }
|
|
176
|
+
.hl-quota-items { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-s) var(--sp-l); }
|
|
177
|
+
.hl-quota-item { display: inline-flex; align-items: center; gap: var(--sp-s); min-width: 0; }
|
|
178
|
+
.hl-quota-reset { font-size: var(--fs-s); color: var(--fg-muted); white-space: nowrap; }
|
|
179
|
+
|
|
180
|
+
/* A picture shown large is shown whole: as large as the window allows and no larger than it is. */
|
|
181
|
+
.media-content[data-zoom] { height: 100%; overflow: hidden; touch-action: none; }
|
|
182
|
+
.media-zoom-view { position: absolute; inset: 0; overflow: hidden; }
|
|
183
|
+
.media-zoom-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
|
|
184
|
+
.media-zoom-stage > img { display: block; width: 100%; height: 100%; border-radius: 0; user-select: none; }
|
|
185
|
+
.media-content[data-zoom][data-zoom-pan] .media-zoom-view { cursor: grab; }
|
|
186
|
+
.media-content[data-zoom].media-zoom-dragging .media-zoom-view { cursor: grabbing; }
|
|
187
|
+
.media-zoom-bar { position: absolute; z-index: 2; left: 50%; bottom: var(--sp-l); transform: translateX(-50%); line-height: normal; }
|
|
188
|
+
|
|
189
|
+
/* Terminal: the power button is green when it opens and red when it closes; a closed terminal is a grey dot. */
|
|
190
|
+
.btn.term-open:hover, .btn.term-open:focus-visible { color: var(--ok); }
|
|
191
|
+
.btn.term-close:hover, .btn.term-close:focus-visible { color: var(--danger); }
|
|
192
|
+
[data-view="ws.terminal"] .status:not([data-tone])::before { content: ""; width: var(--dot); height: var(--dot); border-radius: 50%; background: var(--fg-faint); flex: none; }
|
|
193
|
+
|
|
194
|
+
.waterfall { list-style: none; margin: 0; padding: 0; }
|
|
195
|
+
.waterfall li { display: grid; grid-template-columns: minmax(8em, 2fr) minmax(4em, 3fr) max-content; align-items: center; gap: var(--sp-m); min-height: var(--row-h-1); border-bottom: 1px solid var(--line); }
|
|
196
|
+
.waterfall-label { padding-inline-start: calc(var(--depth) * var(--sp-s)); }
|
|
197
|
+
.waterfall-track { position: relative; height: var(--sp-s); background: var(--surf-secondary); overflow: hidden; border-radius: var(--r-xs); }
|
|
198
|
+
.waterfall-track i { position: absolute; height: 100%; min-width: 2px; background: var(--fg-muted); border-radius: inherit; }
|
|
199
|
+
.waterfall-track i.failed { background: var(--danger); }
|
|
200
|
+
|
|
201
|
+
/* Line chart: token-only responsive SVG chart */
|
|
202
|
+
.lchart { display: grid; gap: var(--sp-xs); min-inline-size: 0; }
|
|
203
|
+
.lchart-svg { display: block; inline-size: 100%; block-size: auto; max-block-size: calc(44 * var(--unit)); overflow: visible; }
|
|
204
|
+
.lchart-grid { stroke: var(--line); stroke-width: 1; }
|
|
205
|
+
.lchart-axis { fill: var(--fg-muted); font-size: calc(2.5 * var(--unit)); }
|
|
206
|
+
.lchart-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
207
|
+
.lchart-reset { stroke: var(--fg-faint); stroke-width: 1.5; stroke-dasharray: 4 4; }
|
|
208
|
+
.lchart-dot { stroke: var(--bg-raised); stroke-width: 1; }
|
|
209
|
+
.lchart-legend { display: flex; flex-wrap: wrap; gap: var(--sp-xs) var(--sp-m); color: var(--fg-muted); font-size: var(--fs-s); }
|
|
210
|
+
.lchart-legend > span { display: inline-flex; align-items: center; gap: var(--sp-xs); min-inline-size: 0; }
|
|
211
|
+
.lchart-swatch { inline-size: var(--ic-s); block-size: var(--sp-xs); border-radius: var(--r-full); flex: none; }
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* 边界:一个含义一个组件、不为接口定制、不按位置推导样式 */
|
|
2
|
+
/* 工作台面板:竖条、拉手、菜单条、铺开、插件嵌入位、键值 */
|
|
3
|
+
/* ── 主页右侧的工作台面板 ── */
|
|
4
|
+
.main.split-host { overflow: hidden; }
|
|
5
|
+
.split { display: grid; grid-template-columns: minmax(0, 1fr); height: 100%; overflow: clip; position: relative; }
|
|
6
|
+
.split.has-panel { grid-template-columns: minmax(0, 1fr) min(var(--span-7), 44%); }
|
|
7
|
+
.split.has-panel.panel-first { grid-template-columns: min(var(--span-7), 44%) minmax(0, 1fr); }
|
|
8
|
+
/* 标签式区域收起时的竖条(组件库):不是一列,是浮在主窗口右边缘上的一条(和消息导航一样不占布局宽度、没有底板),在消息导航的左边。
|
|
9
|
+
网格位置:消息导航占最右一个网格单位(--g-mod),竖条在它左边那一列(右边让出一个网格单位),两者不重叠。显示与否只看菜单固定没有,不看工作台开没开、旁边空不空。
|
|
10
|
+
每一项 = 图标 + 约两个字宽的名字(横向滚动原件:溢出那边渐隐);悬停不展开,全名是普通的提示。整条可上下拖:--u-dy 是相对声明位置的偏移 */
|
|
11
|
+
/* 抽屉拉手:对话主窗口右边缘线上、上下居中的一个小凸起,没有图标;大半在边缘外(被主窗口裁掉),只露出一窄条能点;悬停微微拉出。
|
|
12
|
+
位置只相对主窗口的边(right / top 50%),露出的那一窄条在最右网格单位的边上,不压消息导航居中的刻度,也不碰菜单条 */
|
|
13
|
+
/* 抽屉拉手:侧边抽屉标签——浮层的面(和菜单条同一种面、阴影),外侧圆角、贴边那侧齐平;只占刻度右边那一窄条,不压刻度。
|
|
14
|
+
图标是普通的小图标(墨色,悬停强调色);悬停 / 聚焦向左展出(变宽),右边一直贴着窗口边 */
|
|
15
|
+
/* 菜单项 + 末尾的操作:一整行是一项——和输入框里末尾的 ✓ 一样,操作在行里面;悬停整行高亮(项和操作一起),操作图标悬停时自己变色 */
|
|
16
|
+
.menu-row { display: flex; align-items: center; border-radius: var(--r-s); }
|
|
17
|
+
.menu-row:hover { background: var(--bg-hover); }
|
|
18
|
+
.menu-row > [role="menuitem"] { flex: 1; min-width: 0; background: none; }
|
|
19
|
+
.menu-row > .help-q { flex: none; margin-inline: var(--sp-s); }
|
|
20
|
+
.menu .menu-row > button:hover { background: none; }
|
|
21
|
+
.menu-row > .btn-icon { flex: none; width: var(--ctl-m); justify-content: center; padding: 0; }
|
|
22
|
+
.rt-handle { position: absolute; z-index: var(--z-raised); right: 0; top: 50%; translate: 0 -50%; width: calc(3 * var(--unit)); height: calc(10 * var(--unit)); padding: 0; border: 0; border-radius: var(--r-m) 0 0 var(--r-m); background: var(--surf-float); box-shadow: var(--shadow-float); color: var(--fg-muted); cursor: pointer; overflow: hidden; transition: width var(--dur-fast) ease, color var(--dur-fast) ease; }
|
|
23
|
+
.rt-handle .ic { position: absolute; left: 50%; top: 50%; translate: -50% -50%; } /* 高箭头 12px 高(标签里留出空白) */
|
|
24
|
+
.rt-handle:hover, .rt-handle:focus-visible { width: calc(5 * var(--unit)); color: var(--accent); }
|
|
25
|
+
/* 铺开的工作台是盖在主区上的投影:主区留在原位(被盖住、点不到),挂在主区的弹层和被聚光灯抬起的输入框照样按主区的位置出现 */
|
|
26
|
+
.split.wide > .panel { position: absolute; inset: 0; }
|
|
27
|
+
.split.wide > .main-col { visibility: hidden; } /* 工作台铺满:主窗口还在(滚动、草稿、状态都留着),只是不画;要用到的部分(批注时的输入框)靠聚光单独露出来 */
|
|
28
|
+
.main-col { min-width: 0; min-height: 0; position: relative; } /* 主窗口是网格容器(data-grid):页里的部件按主窗口的网格排 */
|
|
29
|
+
.panel-head { height: var(--row-h); display: flex; align-items: center; gap: var(--sp-xs); padding: 0 var(--sp-s) 0 var(--sp-s); flex-shrink: 0; }
|
|
30
|
+
.panel-head .grow { flex: 1; }
|
|
31
|
+
.panel-body { flex: 1; min-height: 0; padding: var(--sp-xs) var(--gutter-panel) calc(24 * var(--unit)); display: flex; flex-direction: column; gap: var(--sp-l); }
|
|
32
|
+
.split.wide .panel-body > :not(.vw-page-split, .vw-page-full, .vw-split, .frame.tall, .vw-widget[src].tall, .page:has(> .vw-split), .page:has(> .frame.tall), .page:has(> .vw-widget[src].tall), .pdl-inpanel:has(> .vw-page-full)) { inline-size: 100%; max-inline-size: var(--g-w); margin-inline: auto; } /* 铺开的工作台:阅读内容占满工作台的网格(和主窗口一样的模数)居中;分栏与整页框按自身规则铺满 */
|
|
33
|
+
.menu button[aria-current="true"] { font-weight: var(--fw-medium); color: var(--fg-strong); } /* 当前的那一项:字重标出,不默认铺底(底色只给悬停) */
|
|
34
|
+
/* 插件嵌入位:插件提供界面,控制台只给一个框 */
|
|
35
|
+
.frame { border-radius: var(--r-l); background: var(--bg-field); min-height: calc(7 * var(--row-h-1)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-s); color: var(--fg-muted); text-align: center; padding: var(--sp-xl); box-shadow: inset 0 0 0 1px var(--line-strong); }
|
|
36
|
+
.frame.tall, .vw-widget[src].tall { min-height: round(down, 100vh - 5 * var(--row-h-1), var(--row-h-1)); } /* 插件的整页空间:占位和插件自己的界面同一个高度 */
|
|
37
|
+
.panel-body:has(> .vw-widget[src].tall, > .vw-view > .vw-widget[src].tall) { padding: 0; gap: 0; overflow: hidden; } /* 工作台整页框贴边,内容在框内滚动 */
|
|
38
|
+
.panel-body > .page:has(> .vw-widget[src].tall) { flex: 1; min-block-size: 0; padding: 0; }
|
|
39
|
+
:is(.panel-body, .panel-body > .vw-view) > .vw-widget[src].tall { flex: 1 1 0; min-height: 0; height: 100%; border-radius: 0; }
|
|
40
|
+
:is(.panel-body, .panel-body > .vw-view) > .toolbar:has(~ .vw-widget[src].tall) { flex: none; padding: var(--sp-xs) var(--gutter-panel); }
|
|
41
|
+
:is(.panel-body, .panel-body > .vw-view) > .toolbar:has(~ .vw-widget[src].tall) > .input { flex: 1; min-width: 0; }
|
|
42
|
+
.plugin-float .frame { min-height: calc(6 * var(--row-h-1)); }
|
|
43
|
+
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--tile-min), 1fr)); gap: var(--sp-s); } /* 数字块:格宽、数字字号是区域 token(工作台里更紧) */
|
|
44
|
+
.kv > div { background: var(--tile-bg); border-radius: var(--r-l); padding: var(--tile-pad); display: flex; flex-direction: var(--tile-dir); align-items: baseline; gap: var(--tile-gap); }
|
|
45
|
+
.kv b { font: 500 var(--tile-num)/1.2 var(--font-text); color: var(--fg-strong); font-variant-numeric: tabular-nums; }
|
|
46
|
+
/* 键值(page.js 的 kvGrid):一块一列标签,宽度按这块最宽的标签取档;值左对齐、可换行 */
|
|
47
|
+
.kvg { display: grid; grid-template-columns: fit-content(var(--kv-k-max)) minmax(0, 1fr); gap: var(--sp-xs) var(--sp-m); margin: 0; font-size: var(--fs-m); line-height: 1.5; align-items: baseline; }
|
|
48
|
+
/* 标签列按这一块里最宽的标签取宽(网格的 fit-content,不估算字数),最多 --kv-k-max,更长的省略 */
|
|
49
|
+
.kvg dt { min-width: 0; overflow: clip; text-overflow: ellipsis; white-space: nowrap; }
|
|
50
|
+
.kvg dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
|
|
51
|
+
/* 独立键值块默认套用分组底板(与 settings/list 的 .group 一致);嵌在已有底板或展开容器内时保持透明,不套双层壳 */
|
|
52
|
+
.kvg { padding: var(--sp-m); border-radius: var(--r-l); background: var(--surf-group); }
|
|
53
|
+
:is(.vw-card, .dialog, .dialog-body, .lr-more, .ws-fold-b, .vw-expand, .group, .notice, .letter, .pop) .kvg:not(.kvg-group) { padding: 0; border-radius: 0; background: none; }
|
|
54
|
+
.prose { max-width: 66ch; }
|
|
55
|
+
.prose p { margin: 0 0 var(--sp-m); }
|
|
56
|
+
.panel { background: var(--bg-nav); display: flex; flex-direction: column; min-width: 0; min-height: 0; } /* 工作台只是一个容器:里面的组件和别处同一个尺寸(不按所在区域换密度) */
|
|
57
|
+
|
|
58
|
+
/* The workbench's first tab is what the topic is; what was opened lately is already the tabs above it. */
|
|
59
|
+
.ws-recent { display: none; }
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* 边界:一个含义一个组件、不为接口定制、不按位置推导样式 */
|
|
2
|
+
/* 状态与提示:状态、提示条、数量、徽标、进度、提示(toast)、撤销条、读取状态(骨架 / 出错 / 空)、提示轮换 */
|
|
3
|
+
'use strict';
|
|
4
|
+
/* 数量:唯一的画法(分段、分类、组头、工具入口、提示翻页里的“几个”)。弱色小字,不是要你看的计数徽标(那是 badge) */
|
|
5
|
+
function qty(n, warn) { return '<span class="c num' + (warn ? ' warn' : '') + '">' + h(n) + '</span>'; }
|
|
6
|
+
/* 状态:圆点 + 文字;地方不够时文字省略(全文由外层的提示给出) */
|
|
7
|
+
/* 严重度(tone):组件库唯一的一套四档——info 提示 / ok 正常 / warn 留意 / danger 出错。所有带严重度的组件都只写 data-tone,颜色由 [data-tone] → --tone-c 给出;
|
|
8
|
+
严重度不是“多显眼”(那是注意力层级,暂缓),也不是计数(计数徽标是中性的) */
|
|
9
|
+
const TONES = ['info', 'ok', 'warn', 'danger'];
|
|
10
|
+
function toneAttr(t) { return TONES.indexOf(t) >= 0 ? ' data-tone="' + t + '"' : ''; }
|
|
11
|
+
function status(kind, text, strong) { return '<span class="status"' + toneAttr(kind) + '>' + (strong ? '<b>' + h(strong) + '</b>' : '') + '<span class="status-t">' + h(text) + '</span></span>'; } /* 放不下时省略(被截断的字悬停看全文:引擎的通用规则) */
|
|
12
|
+
const TONE_ICON = { info: 'info', ok: 'check', warn: 'alert', danger: 'alert' };
|
|
13
|
+
function notice(o) { return '<div class="notice"' + toneAttr(o.tone) + (o.note ? ' data-note="' + o.note + '"' : '') + '>' + icon(TONE_ICON[o.tone] || 'info', 18) + '<div class="grow">' + o.text + '</div>' + (o.action || '') + '</div>'; }
|
|
14
|
+
/* 一句提示(可带一个操作) */
|
|
15
|
+
/* 轻提示:唯一的画法。a 是一个或几个操作 { label, act, data(属性串或参数对象) },操作是文字按钮 */
|
|
16
|
+
function toastHtml(t, a, o) { o = o || {}; const acts = [].concat(a || []).map(function (x) { return btn(x.label, { link: true, act: x.act, data: typeof x.data === 'string' ? x.data : argAttrs(x.data) }); }).join(''); return '<div class="toast' + (o.cls ? ' ' + o.cls : '') + '"' + toneAttr(o.tone) + (o.attrs || '') + ' role="status"><span>' + h(t) + '</span>' + acts + '</div>'; }
|
|
17
|
+
/* 色调点:标签颜色这类 */
|
|
18
|
+
function tintDot(n) { return lrDot('id', '', typeof n === 'string' && n.charAt(0) === '#' ? n : 'var(--tint-' + (+n || 1) + ')'); } /* 色调点:主题色调槽位(1–6),或者取色器选的固定值(#hex) */
|
|
19
|
+
/* 徽标(组件库):两种形态,由数据决定——有数就是计数胶囊(超过 99 写 99+),只有“有变化”没有数就是小圆点。
|
|
20
|
+
计数(未读、待处理、@你)不是严重度:所有计数徽标同一个强调色胶囊(“等你来看”);只有真正带严重度的指示才传 tone(warn / danger …),走同一套 data-tone */
|
|
21
|
+
function badge(n, o) {
|
|
22
|
+
o = o || {};
|
|
23
|
+
const a = toneAttr(o.tone) + (o.tip ? ' data-tip="' + h(o.tip) + '"' : '');
|
|
24
|
+
const cn = o.corner ? ' corner' : ''; /* corner:贴宿主右上角(摆放是徽标自己的选项) */
|
|
25
|
+
if (n === true && !o.at) return '<span class="badge dot' + cn + '"' + a + '></span>';
|
|
26
|
+
if (!n) return '';
|
|
27
|
+
return '<span class="badge count num' + cn + '"' + a + '>' + (o.at ? h(WHO_DATA.me().handle) + (n === true ? '' : ' ') : '') + (n === true ? '' : n > 99 ? '99+' : n) + '</span>'; /* at:有人提到你——同一个计数胶囊,前面写你的提及名(用户身份数据里的 mentionPatterns[0],如 @lang),改了提及名这里跟着变 */
|
|
28
|
+
}
|
|
29
|
+
/* 撤销条:一句话 + 几个操作(acts: [{ label, act, data: {k: v} }]) */
|
|
30
|
+
function undoBar(text, acts) { return toastHtml(text, acts, { cls: 'raised', attrs: ' data-undo' }); } /* 撤销条就是轻提示(带操作),抬高一档让开底部的轻提示 */
|
|
31
|
+
function progBar(pct, tone) { return '<span class="ws-prog' + (tone ? ' ' + tone : '') + '"><i style="--u-width:' + Math.max(0, Math.min(100, pct)) + '%" class="u-v-width"></i></span>'; }
|
|
32
|
+
|
|
33
|
+
/* 视图和块的读取状态(组件库,唯一一处):加载中 = 骨架(可带一行淡字);出错 = 一行危险色调的提示;
|
|
34
|
+
数据过期 = 一行留意色调的提示(内容照常画在下面);空 = 空状态。视图 / 块声明文字(loading / error / stale / empty);
|
|
35
|
+
只有声明了 retry 并且这个状态下有动作,才带一个重试(没有默认的原位重试) */
|
|
36
|
+
function viewState(kind, o) {
|
|
37
|
+
o = o || {};
|
|
38
|
+
const again = function (label) { return o.retry && o.retry.act ? btn(label, { sm: true, act: o.retry.act, data: o.retry.data || '' }) : ''; };
|
|
39
|
+
if (kind === 'loading') return skel(o.count || 3, o.shape) + (o.text ? '<div class="vw-label below">' + h(o.text) + '</div>' : '');
|
|
40
|
+
if (kind === 'error') return notice({ tone: 'danger', text: h(o.text || tc('frame.loadError')), action: again(tc('common.retry')) });
|
|
41
|
+
if (kind === 'stale') return notice({ tone: 'warn', text: h(o.text || tc('frame.stale')), action: again(tc('frame.reload')) });
|
|
42
|
+
return emptyState(o.text || tc('list.emptyState'));
|
|
43
|
+
}
|
|
44
|
+
/* 空状态(组件库统一的样子):一句话 + 弱色补充 + 操作。e 可以是字符串,或 { text, sub, actions: [btn 参数…] } */
|
|
45
|
+
/* 空状态:唯一的画法。e 是文字,或 { text | html, sub, actions | acts(已渲染的操作), help, icon("选一项"的占位:大图标) }。侧栏里小一号是区域的 token(--empty-*),不是参数 */
|
|
46
|
+
function emptyState(e) {
|
|
47
|
+
if (e == null) e = tc('list.emptyState');
|
|
48
|
+
if (typeof e === 'string') e = { text: e };
|
|
49
|
+
const acts = e.acts || (e.actions || []).map(function (a) { return btn(a.label, { sm: true, primary: !!a.primary, icon: a.icon, act: a.act, data: argAttrs(a.data) }); }).join('');
|
|
50
|
+
return '<div class="empty' + (e.icon ? ' lead' : '') + '">' + (e.icon ? icon(e.icon, 28) : '') + '<span>' + (e.html != null ? e.html : h(e.text || '')) + (e.help || '') + '</span>' + (e.sub ? '<span class="faint">' + h(e.sub) + '</span>' : '') + (acts ? '<span class="ws-inline">' + acts + '</span>' : '') + '</div>';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* 轮换(组件库的通用行为):data-rot 的元素同一时刻只露一个子项,多于一个时按节拍轮换(每项 8 拍),悬停暂停。
|
|
54
|
+
纯 CSS:显示哪一项是时间的函数(--rot-t 按 steps(n) 随动画走,子项在 --rot-t 等于自己的 --i 时露出),不存游标、不用计时器;
|
|
55
|
+
诞生时和其它循环一样对齐到大拍(motion.js 的 animationstart)。rotHtml 给出容器和每项的序号 */
|
|
56
|
+
function rotHtml(tag, cls, items, attrs) {
|
|
57
|
+
const n = items.length;
|
|
58
|
+
return '<' + tag + ' class="' + cls + '"' + (n > 1 ? ' data-rot style="--n:' + n + '"' : '') + (attrs || '') + '>' + items.map(function (x, i) { return x.replace(/^<(\w+)/, '<$1 style="--i:' + i + '"'); }).join('') + '</' + tag + '>';
|
|
59
|
+
}
|
|
60
|
+
/* 展开区里的小标题和一行说明,也只有一种写法 */
|
|
61
|
+
/* 加载中:骨架行(列表、弹窗里的列表都用它) */
|
|
62
|
+
/* 骨架:唯一的画法。shape 'row'(默认,列表行)或 'card'(卡片网格:预览 + 两行字);每一块是同一个骨架块、同一个背景档的节拍 */
|
|
63
|
+
function skelBar(k) { return '<div class="skel ' + k + '" aria-hidden="true"></div>'; }
|
|
64
|
+
function skel(n, shape) {
|
|
65
|
+
const a = []; for (let i = 0; i < n; i++) a.push(shape === 'card' ? '<div class="cgrid-card">' + skelBar('prev') + '<div class="cgrid-meta">' + skelBar('line') + skelBar('line short') + '</div></div>' : skelBar('row'));
|
|
66
|
+
return '<div class="' + (shape === 'card' ? 'cgrid' : 'group') + '" aria-busy="true">' + a.join('') + '</div>';
|
|
67
|
+
}
|
|
68
|
+
/* ───────── 目录登记:这个文件里的组件 ───────── */
|
|
69
|
+
Object.assign(LIB_CATALOG, {
|
|
70
|
+
tooltip: { g: 'structure', inline: true, via: ['prop:tip', 'prop:help'], ex: function (s) { return btn(s.more, { act: 'noop', data: ' data-tip="' + h(s.sub) + '"' }) + helpTip(s.sub); } },
|
|
71
|
+
toast: { g: 'alerts', inline: true, via: ['act:toast'], ex: function (s) { return toastHtml(s.toneText.ok, { label: tc('common.undo'), act: 'noop', data: '' }, { cls: 'cat-static' }); },
|
|
72
|
+
tones: function (t, s) { return toastHtml(s.toneText[t], null, { cls: 'cat-static', tone: t }); } },
|
|
73
|
+
badge: { g: 'alerts', inline: true, via: ['type:threads', 'shell'], ex: function () { return badge(8) + badge(true) + badge(3, { at: true }) + badge(2, { tone: 'warn' }); },
|
|
74
|
+
tones: function (t) { return badge(3, { tone: t }) + badge(true, { tone: t }); },
|
|
75
|
+
count: function () { return badge(4) + badge(120) + badge(true) + badge(2, { at: true }); } }
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
function loadingGlyph(kind) {
|
|
79
|
+
return kind === 'spin' ? icon('refresh', 13, 'hl-spin') : '<span class="hl-dots" aria-hidden="true"><i></i><i></i><i></i></span>';
|
|
80
|
+
}
|
|
81
|
+
PDL_COMPONENTS.loadingStatus = function (text) {
|
|
82
|
+
return '<div class="hl-loading" role="status">' + loadingGlyph('wait') + '<span>' + h(text) + '</span></div>';
|
|
83
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// A top-layer window for DOM-rendered views, including standalone viewers.
|
|
2
|
+
const stack = [];
|
|
3
|
+
const pad = 8;
|
|
4
|
+
const clamp = (value, min, max) => Math.min(Math.max(value, min), Math.max(min, max));
|
|
5
|
+
|
|
6
|
+
export function floatingWindow(frame, heading, { signal, dismiss }) {
|
|
7
|
+
frame.setAttribute('popover', 'manual');
|
|
8
|
+
frame.setAttribute('role', 'dialog');
|
|
9
|
+
frame.tabIndex = -1;
|
|
10
|
+
frame.classList.add('floating-window');
|
|
11
|
+
heading.classList.add('floating-window-handle');
|
|
12
|
+
const corners = ['nw', 'ne', 'sw', 'se'].map((corner) => {
|
|
13
|
+
const grip = document.createElement('span');
|
|
14
|
+
grip.className = 'floating-window-grip';
|
|
15
|
+
grip.dataset.corner = corner;
|
|
16
|
+
grip.setAttribute('aria-hidden', 'true');
|
|
17
|
+
frame.append(grip);
|
|
18
|
+
return grip;
|
|
19
|
+
});
|
|
20
|
+
const viewport = () => ({ width: document.documentElement.clientWidth, height: document.documentElement.clientHeight });
|
|
21
|
+
const rect = () => frame.getBoundingClientRect();
|
|
22
|
+
const restoreWidth = frame.style.width;
|
|
23
|
+
let drag, adjusted = false;
|
|
24
|
+
|
|
25
|
+
function position(left, top, width = rect().width, height = rect().height) {
|
|
26
|
+
const view = viewport();
|
|
27
|
+
frame.style.left = clamp(left, pad, view.width - width - pad) + 'px';
|
|
28
|
+
frame.style.top = clamp(top, pad, view.height - height - pad) + 'px';
|
|
29
|
+
}
|
|
30
|
+
function place(anchor, align) {
|
|
31
|
+
if (adjusted || !frame.matches(':popover-open')) return;
|
|
32
|
+
const { width, height } = rect(), view = viewport();
|
|
33
|
+
const below = anchor.bottom + 6;
|
|
34
|
+
const top = below + height <= view.height - pad || view.height - below > anchor.top
|
|
35
|
+
? below : anchor.top - height - 6;
|
|
36
|
+
position(align === 'start' ? anchor.left : anchor.right - width, top, width, height);
|
|
37
|
+
}
|
|
38
|
+
function hide() {
|
|
39
|
+
const at = stack.indexOf(frame);
|
|
40
|
+
if (at >= 0) stack.splice(at, 1);
|
|
41
|
+
if (frame.matches(':popover-open')) frame.hidePopover();
|
|
42
|
+
drag = undefined;
|
|
43
|
+
}
|
|
44
|
+
function show(anchor, align) {
|
|
45
|
+
if (!frame.matches(':popover-open')) {
|
|
46
|
+
adjusted = false;
|
|
47
|
+
frame.style.width = restoreWidth;
|
|
48
|
+
frame.style.height = '';
|
|
49
|
+
frame.style.maxHeight = '';
|
|
50
|
+
frame.showPopover();
|
|
51
|
+
stack.push(frame);
|
|
52
|
+
}
|
|
53
|
+
if (anchor) place(anchor, align);
|
|
54
|
+
else if (!adjusted) {
|
|
55
|
+
const view = viewport(), { width, height } = rect();
|
|
56
|
+
position((view.width - width) / 2, (view.height - height) / 3, width, height);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
for (const target of [heading, ...corners]) target.addEventListener('pointerdown', (event) => {
|
|
60
|
+
if (event.button !== 0 || event.target.closest('button, a, input, select, textarea')) return;
|
|
61
|
+
drag = { id: event.pointerId, x: event.clientX, y: event.clientY, box: rect(), corner: target.dataset.corner };
|
|
62
|
+
target.setPointerCapture(event.pointerId);
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
}, { signal });
|
|
65
|
+
frame.addEventListener('pointermove', (event) => {
|
|
66
|
+
if (drag?.id !== event.pointerId) return;
|
|
67
|
+
const { box, corner, x, y } = drag, dx = event.clientX - x, dy = event.clientY - y;
|
|
68
|
+
if (!adjusted && !dx && !dy) return;
|
|
69
|
+
adjusted = true;
|
|
70
|
+
if (!corner) {
|
|
71
|
+
position(box.left + dx, box.top + dy, box.width, box.height);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const view = viewport(), west = corner.endsWith('w'), north = corner.startsWith('n');
|
|
75
|
+
const minWidth = Math.min(224, box.width), minHeight = Math.min(112, box.height);
|
|
76
|
+
const left = west ? clamp(box.left + dx, pad, box.right - minWidth) : box.left;
|
|
77
|
+
const top = north ? clamp(box.top + dy, pad, box.bottom - minHeight) : box.top;
|
|
78
|
+
const right = west ? box.right : clamp(box.right + dx, box.left + minWidth, view.width - pad);
|
|
79
|
+
const bottom = north ? box.bottom : clamp(box.bottom + dy, box.top + minHeight, view.height - pad);
|
|
80
|
+
frame.style.width = right - left + 'px';
|
|
81
|
+
frame.style.height = bottom - top + 'px';
|
|
82
|
+
frame.style.maxHeight = 'calc(100dvh - 16px)';
|
|
83
|
+
position(left, top, right - left, bottom - top);
|
|
84
|
+
}, { signal });
|
|
85
|
+
frame.addEventListener('lostpointercapture', () => { drag = undefined; }, { signal });
|
|
86
|
+
document.addEventListener('keydown', (event) => {
|
|
87
|
+
if (stack.at(-1) !== frame || event.key !== 'Escape' || event.isComposing) return;
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
event.stopImmediatePropagation();
|
|
90
|
+
dismiss();
|
|
91
|
+
}, { signal, capture: true });
|
|
92
|
+
window.addEventListener('resize', () => {
|
|
93
|
+
if (frame.matches(':popover-open') && adjusted) {
|
|
94
|
+
const box = rect();
|
|
95
|
+
position(box.left, box.top, box.width, box.height);
|
|
96
|
+
}
|
|
97
|
+
}, { signal });
|
|
98
|
+
signal.addEventListener('abort', hide, { once: true });
|
|
99
|
+
return { show, hide, place, get adjusted() { return adjusted; } };
|
|
100
|
+
}
|