dsh-plugin-core 0.2.14 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +52 -83
- package/dist/design/tokens-css.d.ts +1 -1
- package/dist/design/tokens-css.d.ts.map +1 -1
- package/dist/design/tokens-css.generated.d.ts +2 -0
- package/dist/design/tokens-css.generated.d.ts.map +1 -0
- package/dist/design/tokens-css.generated.js +4 -0
- package/dist/design/tokens-css.generated.js.map +1 -0
- package/dist/design/tokens-css.js +1 -252
- package/dist/design/tokens-css.js.map +1 -1
- package/dist/explorer/FileBrowser.d.ts +41 -0
- package/dist/explorer/FileBrowser.d.ts.map +1 -0
- package/dist/explorer/FileBrowser.js +659 -0
- package/dist/explorer/FileBrowser.js.map +1 -0
- package/dist/explorer/explorer-css.d.ts +1 -1
- package/dist/explorer/explorer-css.d.ts.map +1 -1
- package/dist/explorer/explorer-css.generated.d.ts +2 -0
- package/dist/explorer/explorer-css.generated.d.ts.map +1 -0
- package/dist/explorer/explorer-css.generated.js +4 -0
- package/dist/explorer/explorer-css.generated.js.map +1 -0
- package/dist/explorer/explorer-css.js +1 -31
- package/dist/explorer/explorer-css.js.map +1 -1
- package/dist/explorer/index.d.ts +4 -2
- package/dist/explorer/index.d.ts.map +1 -1
- package/dist/explorer/index.js +4 -2
- package/dist/explorer/index.js.map +1 -1
- package/dist/explorer/open.d.ts +103 -0
- package/dist/explorer/open.d.ts.map +1 -0
- package/dist/explorer/open.js +282 -0
- package/dist/explorer/open.js.map +1 -0
- package/dist/explorer/preview/BytesPreview.d.ts +13 -0
- package/dist/explorer/preview/BytesPreview.d.ts.map +1 -0
- package/dist/explorer/preview/BytesPreview.js +56 -0
- package/dist/explorer/preview/BytesPreview.js.map +1 -0
- package/dist/explorer/preview/HtmlPreview.d.ts +18 -0
- package/dist/explorer/preview/HtmlPreview.d.ts.map +1 -0
- package/dist/explorer/preview/HtmlPreview.js +112 -0
- package/dist/explorer/preview/HtmlPreview.js.map +1 -0
- package/dist/explorer/preview/OfficePreview.d.ts +11 -0
- package/dist/explorer/preview/OfficePreview.d.ts.map +1 -0
- package/dist/explorer/preview/OfficePreview.js +53 -0
- package/dist/explorer/preview/OfficePreview.js.map +1 -0
- package/dist/explorer/preview/TextPreview.d.ts +17 -0
- package/dist/explorer/preview/TextPreview.d.ts.map +1 -0
- package/dist/explorer/preview/TextPreview.js +95 -0
- package/dist/explorer/preview/TextPreview.js.map +1 -0
- package/dist/explorer/preview/index.d.ts +10 -3
- package/dist/explorer/preview/index.d.ts.map +1 -1
- package/dist/explorer/preview/index.js +52 -55
- package/dist/explorer/preview/index.js.map +1 -1
- package/dist/explorer/preview/md-labels.d.ts +3 -0
- package/dist/explorer/preview/md-labels.d.ts.map +1 -0
- package/dist/explorer/preview/md-labels.js +12 -0
- package/dist/explorer/preview/md-labels.js.map +1 -0
- package/dist/explorer/types.d.ts +186 -4
- package/dist/explorer/types.d.ts.map +1 -1
- package/dist/explorer/types.js +401 -14
- package/dist/explorer/types.js.map +1 -1
- package/dist/host/index.d.ts +66 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.js +60 -0
- package/dist/host/index.js.map +1 -0
- package/dist/session/SessionViewModal.d.ts +42 -0
- package/dist/session/SessionViewModal.d.ts.map +1 -0
- package/dist/session/SessionViewModal.js +997 -0
- package/dist/session/SessionViewModal.js.map +1 -0
- package/dist/session/changes.d.ts +73 -0
- package/dist/session/changes.d.ts.map +1 -0
- package/dist/session/changes.js +134 -0
- package/dist/session/changes.js.map +1 -0
- package/dist/session/faces.d.ts +198 -0
- package/dist/session/faces.d.ts.map +1 -0
- package/dist/session/faces.js +17 -0
- package/dist/session/faces.js.map +1 -0
- package/dist/session/index.d.ts +5 -23
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +25 -70
- package/dist/session/index.js.map +1 -1
- package/dist/session/mirror/ChangedFileDiff.d.ts +22 -0
- package/dist/session/mirror/ChangedFileDiff.d.ts.map +1 -0
- package/dist/session/mirror/ChangedFileDiff.js +157 -0
- package/dist/session/mirror/ChangedFileDiff.js.map +1 -0
- package/dist/session/mirror/ChangedFilesCard.d.ts +18 -0
- package/dist/session/mirror/ChangedFilesCard.d.ts.map +1 -0
- package/dist/session/mirror/ChangedFilesCard.js +158 -0
- package/dist/session/mirror/ChangedFilesCard.js.map +1 -0
- package/dist/session/mirror/ChatGroupSeat.d.ts +24 -0
- package/dist/session/mirror/ChatGroupSeat.d.ts.map +1 -0
- package/dist/session/mirror/ChatGroupSeat.js +134 -0
- package/dist/session/mirror/ChatGroupSeat.js.map +1 -0
- package/dist/session/mirror/ChatNodeSeat.d.ts +43 -0
- package/dist/session/mirror/ChatNodeSeat.d.ts.map +1 -0
- package/dist/session/mirror/ChatNodeSeat.js +133 -0
- package/dist/session/mirror/ChatNodeSeat.js.map +1 -0
- package/dist/session/mirror/ChatView.d.ts +47 -0
- package/dist/session/mirror/ChatView.d.ts.map +1 -0
- package/dist/session/mirror/ChatView.js +127 -0
- package/dist/session/mirror/ChatView.js.map +1 -0
- package/dist/session/mirror/CommandCard.d.ts +20 -0
- package/dist/session/mirror/CommandCard.d.ts.map +1 -0
- package/dist/session/mirror/CommandCard.js +69 -0
- package/dist/session/mirror/CommandCard.js.map +1 -0
- package/dist/session/mirror/Deliverables.d.ts +24 -0
- package/dist/session/mirror/Deliverables.d.ts.map +1 -0
- package/dist/session/mirror/Deliverables.js +134 -0
- package/dist/session/mirror/Deliverables.js.map +1 -0
- package/dist/session/mirror/GenericCommandCard.d.ts +25 -0
- package/dist/session/mirror/GenericCommandCard.d.ts.map +1 -0
- package/dist/session/mirror/GenericCommandCard.js +567 -0
- package/dist/session/mirror/GenericCommandCard.js.map +1 -0
- package/dist/session/mirror/MessageIconActions.d.ts +16 -0
- package/dist/session/mirror/MessageIconActions.d.ts.map +1 -0
- package/dist/session/mirror/MessageIconActions.js +71 -0
- package/dist/session/mirror/MessageIconActions.js.map +1 -0
- package/dist/session/mirror/MessageItem.d.ts +66 -0
- package/dist/session/mirror/MessageItem.d.ts.map +1 -0
- package/dist/session/mirror/MessageItem.js +135 -0
- package/dist/session/mirror/MessageItem.js.map +1 -0
- package/dist/session/mirror/ReasoningRow.d.ts +11 -0
- package/dist/session/mirror/ReasoningRow.d.ts.map +1 -0
- package/dist/session/mirror/ReasoningRow.js +49 -0
- package/dist/session/mirror/ReasoningRow.js.map +1 -0
- package/dist/session/mirror/StatDialog.d.ts +20 -0
- package/dist/session/mirror/StatDialog.d.ts.map +1 -0
- package/dist/session/mirror/StatDialog.js +36 -0
- package/dist/session/mirror/StatDialog.js.map +1 -0
- package/dist/session/mirror/TurnProcessNodeView.d.ts +10 -0
- package/dist/session/mirror/TurnProcessNodeView.d.ts.map +1 -0
- package/dist/session/mirror/TurnProcessNodeView.js +68 -0
- package/dist/session/mirror/TurnProcessNodeView.js.map +1 -0
- package/dist/session/mirror/TurnTailNodeView.d.ts +32 -0
- package/dist/session/mirror/TurnTailNodeView.d.ts.map +1 -0
- package/dist/session/mirror/TurnTailNodeView.js +48 -0
- package/dist/session/mirror/TurnTailNodeView.js.map +1 -0
- package/dist/session/mirror/TurnTriggerNodeView.d.ts +14 -0
- package/dist/session/mirror/TurnTriggerNodeView.d.ts.map +1 -0
- package/dist/session/mirror/TurnTriggerNodeView.js +87 -0
- package/dist/session/mirror/TurnTriggerNodeView.js.map +1 -0
- package/dist/session/mirror/TurnUsagePanel.d.ts +21 -0
- package/dist/session/mirror/TurnUsagePanel.d.ts.map +1 -0
- package/dist/session/mirror/TurnUsagePanel.js +41 -0
- package/dist/session/mirror/TurnUsagePanel.js.map +1 -0
- package/dist/session/mirror/message-chrome.d.ts +33 -0
- package/dist/session/mirror/message-chrome.d.ts.map +1 -0
- package/dist/session/mirror/message-chrome.js +158 -0
- package/dist/session/mirror/message-chrome.js.map +1 -0
- package/dist/session/mirror/process-groups.d.ts +56 -0
- package/dist/session/mirror/process-groups.d.ts.map +1 -0
- package/dist/session/mirror/process-groups.js +202 -0
- package/dist/session/mirror/process-groups.js.map +1 -0
- package/dist/session/official-classes.d.ts +28 -0
- package/dist/session/official-classes.d.ts.map +1 -0
- package/dist/session/official-classes.js +146 -0
- package/dist/session/official-classes.js.map +1 -0
- package/dist/session/open-session-view.d.ts +17 -0
- package/dist/session/open-session-view.d.ts.map +1 -0
- package/dist/session/open-session-view.js +136 -0
- package/dist/session/open-session-view.js.map +1 -0
- package/dist/session/session-css.d.ts +1 -1
- package/dist/session/session-css.d.ts.map +1 -1
- package/dist/session/session-css.generated.d.ts +2 -0
- package/dist/session/session-css.generated.d.ts.map +1 -0
- package/dist/session/session-css.generated.js +4 -0
- package/dist/session/session-css.generated.js.map +1 -0
- package/dist/session/session-css.js +1 -17
- package/dist/session/session-css.js.map +1 -1
- package/dist/ui/AlertModal.d.ts +28 -0
- package/dist/ui/AlertModal.d.ts.map +1 -0
- package/dist/ui/AlertModal.js +29 -0
- package/dist/ui/AlertModal.js.map +1 -0
- package/dist/ui/Button.d.ts.map +1 -1
- package/dist/ui/Button.js +14 -1
- package/dist/ui/Button.js.map +1 -1
- package/dist/ui/Card.d.ts +4 -2
- package/dist/ui/Card.d.ts.map +1 -1
- package/dist/ui/Card.js +12 -6
- package/dist/ui/Card.js.map +1 -1
- package/dist/ui/Chip.d.ts +9 -1
- package/dist/ui/Chip.d.ts.map +1 -1
- package/dist/ui/Chip.js +8 -2
- package/dist/ui/Chip.js.map +1 -1
- package/dist/ui/CodeViewer.d.ts +36 -0
- package/dist/ui/CodeViewer.d.ts.map +1 -0
- package/dist/ui/CodeViewer.js +90 -0
- package/dist/ui/CodeViewer.js.map +1 -0
- package/dist/ui/ConfirmModal.d.ts +30 -0
- package/dist/ui/ConfirmModal.d.ts.map +1 -0
- package/dist/ui/ConfirmModal.js +23 -0
- package/dist/ui/ConfirmModal.js.map +1 -0
- package/dist/ui/DateTimePicker.d.ts +45 -0
- package/dist/ui/DateTimePicker.d.ts.map +1 -0
- package/dist/ui/DateTimePicker.js +447 -0
- package/dist/ui/DateTimePicker.js.map +1 -0
- package/dist/ui/Field.d.ts +11 -2
- package/dist/ui/Field.d.ts.map +1 -1
- package/dist/ui/Field.js +15 -5
- package/dist/ui/Field.js.map +1 -1
- package/dist/ui/MarqueeText.d.ts.map +1 -1
- package/dist/ui/MarqueeText.js +3 -1
- package/dist/ui/MarqueeText.js.map +1 -1
- package/dist/ui/Modal.d.ts +25 -3
- package/dist/ui/Modal.d.ts.map +1 -1
- package/dist/ui/Modal.js +41 -7
- package/dist/ui/Modal.js.map +1 -1
- package/dist/ui/ModelPicker.d.ts +25 -12
- package/dist/ui/ModelPicker.d.ts.map +1 -1
- package/dist/ui/ModelPicker.js +67 -19
- package/dist/ui/ModelPicker.js.map +1 -1
- package/dist/ui/PanelDock.d.ts +127 -0
- package/dist/ui/PanelDock.d.ts.map +1 -0
- package/dist/ui/PanelDock.js +297 -0
- package/dist/ui/PanelDock.js.map +1 -0
- package/dist/ui/Picker.d.ts +8 -2
- package/dist/ui/Picker.d.ts.map +1 -1
- package/dist/ui/Picker.js +86 -18
- package/dist/ui/Picker.js.map +1 -1
- package/dist/ui/SectionHead.d.ts +3 -3
- package/dist/ui/SectionHead.d.ts.map +1 -1
- package/dist/ui/SectionHead.js +4 -4
- package/dist/ui/SectionHead.js.map +1 -1
- package/dist/ui/Segmented.d.ts +4 -0
- package/dist/ui/Segmented.d.ts.map +1 -1
- package/dist/ui/Segmented.js +88 -31
- package/dist/ui/Segmented.js.map +1 -1
- package/dist/ui/Textarea.d.ts +2 -0
- package/dist/ui/Textarea.d.ts.map +1 -1
- package/dist/ui/Textarea.js +6 -1
- package/dist/ui/Textarea.js.map +1 -1
- package/dist/ui/Toast.d.ts +41 -8
- package/dist/ui/Toast.d.ts.map +1 -1
- package/dist/ui/Toast.js +216 -28
- package/dist/ui/Toast.js.map +1 -1
- package/dist/ui/WorkspacePicker.d.ts +15 -28
- package/dist/ui/WorkspacePicker.d.ts.map +1 -1
- package/dist/ui/WorkspacePicker.js +18 -27
- package/dist/ui/WorkspacePicker.js.map +1 -1
- package/dist/ui/card-css.d.ts +1 -1
- package/dist/ui/card-css.d.ts.map +1 -1
- package/dist/ui/card-css.generated.d.ts +2 -0
- package/dist/ui/card-css.generated.d.ts.map +1 -0
- package/dist/ui/card-css.generated.js +4 -0
- package/dist/ui/card-css.generated.js.map +1 -0
- package/dist/ui/card-css.js +1 -35
- package/dist/ui/card-css.js.map +1 -1
- package/dist/ui/chip-css.d.ts +1 -1
- package/dist/ui/chip-css.d.ts.map +1 -1
- package/dist/ui/chip-css.generated.d.ts +2 -0
- package/dist/ui/chip-css.generated.d.ts.map +1 -0
- package/dist/ui/chip-css.generated.js +4 -0
- package/dist/ui/chip-css.generated.js.map +1 -0
- package/dist/ui/chip-css.js +1 -17
- package/dist/ui/chip-css.js.map +1 -1
- package/dist/ui/code-viewer-css.d.ts +2 -0
- package/dist/ui/code-viewer-css.d.ts.map +1 -0
- package/dist/ui/code-viewer-css.generated.d.ts +2 -0
- package/dist/ui/code-viewer-css.generated.d.ts.map +1 -0
- package/dist/ui/code-viewer-css.generated.js +4 -0
- package/dist/ui/code-viewer-css.generated.js.map +1 -0
- package/dist/ui/code-viewer-css.js +3 -0
- package/dist/ui/code-viewer-css.js.map +1 -0
- package/dist/ui/code-viewer-lang.d.ts +15 -0
- package/dist/ui/code-viewer-lang.d.ts.map +1 -0
- package/dist/ui/code-viewer-lang.js +190 -0
- package/dist/ui/code-viewer-lang.js.map +1 -0
- package/dist/ui/code-viewer-theme.d.ts +5 -0
- package/dist/ui/code-viewer-theme.d.ts.map +1 -0
- package/dist/ui/code-viewer-theme.js +138 -0
- package/dist/ui/code-viewer-theme.js.map +1 -0
- package/dist/ui/controls/back-to-top-css.generated.d.ts +2 -0
- package/dist/ui/controls/back-to-top-css.generated.d.ts.map +1 -0
- package/dist/ui/controls/back-to-top-css.generated.js +4 -0
- package/dist/ui/controls/back-to-top-css.generated.js.map +1 -0
- package/dist/ui/controls/button-css.generated.d.ts +2 -0
- package/dist/ui/controls/button-css.generated.d.ts.map +1 -0
- package/dist/ui/controls/button-css.generated.js +4 -0
- package/dist/ui/controls/button-css.generated.js.map +1 -0
- package/dist/ui/controls/datetime-css.generated.d.ts +2 -0
- package/dist/ui/controls/datetime-css.generated.d.ts.map +1 -0
- package/dist/ui/controls/datetime-css.generated.js +4 -0
- package/dist/ui/controls/datetime-css.generated.js.map +1 -0
- package/dist/ui/controls/field-css.generated.d.ts +2 -0
- package/dist/ui/controls/field-css.generated.d.ts.map +1 -0
- package/dist/ui/controls/field-css.generated.js +4 -0
- package/dist/ui/controls/field-css.generated.js.map +1 -0
- package/dist/ui/controls/hint-css.generated.d.ts +2 -0
- package/dist/ui/controls/hint-css.generated.d.ts.map +1 -0
- package/dist/ui/controls/hint-css.generated.js +4 -0
- package/dist/ui/controls/hint-css.generated.js.map +1 -0
- package/dist/ui/controls/loading-css.generated.d.ts +2 -0
- package/dist/ui/controls/loading-css.generated.d.ts.map +1 -0
- package/dist/ui/controls/loading-css.generated.js +4 -0
- package/dist/ui/controls/loading-css.generated.js.map +1 -0
- package/dist/ui/controls/segmented-css.generated.d.ts +2 -0
- package/dist/ui/controls/segmented-css.generated.d.ts.map +1 -0
- package/dist/ui/controls/segmented-css.generated.js +4 -0
- package/dist/ui/controls/segmented-css.generated.js.map +1 -0
- package/dist/ui/controls-css.d.ts +7 -8
- package/dist/ui/controls-css.d.ts.map +1 -1
- package/dist/ui/controls-css.js +13 -11
- package/dist/ui/controls-css.js.map +1 -1
- package/dist/ui/css.d.ts +5 -0
- package/dist/ui/css.d.ts.map +1 -1
- package/dist/ui/css.js +13 -4
- package/dist/ui/css.js.map +1 -1
- package/dist/ui/datetime-logic.d.ts +100 -0
- package/dist/ui/datetime-logic.d.ts.map +1 -0
- package/dist/ui/datetime-logic.js +193 -0
- package/dist/ui/datetime-logic.js.map +1 -0
- package/dist/ui/feedback-css.d.ts +1 -1
- package/dist/ui/feedback-css.d.ts.map +1 -1
- package/dist/ui/feedback-css.generated.d.ts +2 -0
- package/dist/ui/feedback-css.generated.d.ts.map +1 -0
- package/dist/ui/feedback-css.generated.js +4 -0
- package/dist/ui/feedback-css.generated.js.map +1 -0
- package/dist/ui/feedback-css.js +1 -53
- package/dist/ui/feedback-css.js.map +1 -1
- package/dist/ui/host-data.d.ts +103 -0
- package/dist/ui/host-data.d.ts.map +1 -0
- package/dist/ui/host-data.js +106 -0
- package/dist/ui/host-data.js.map +1 -0
- package/dist/ui/host-toast.d.ts +23 -0
- package/dist/ui/host-toast.d.ts.map +1 -0
- package/dist/ui/host-toast.js +34 -0
- package/dist/ui/host-toast.js.map +1 -0
- package/dist/ui/index.d.ts +12 -6
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +10 -4
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/marquee-css.d.ts +2 -0
- package/dist/ui/marquee-css.d.ts.map +1 -0
- package/dist/ui/marquee-css.generated.d.ts +2 -0
- package/dist/ui/marquee-css.generated.d.ts.map +1 -0
- package/dist/ui/marquee-css.generated.js +4 -0
- package/dist/ui/marquee-css.generated.js.map +1 -0
- package/dist/ui/marquee-css.js +4 -0
- package/dist/ui/marquee-css.js.map +1 -0
- package/dist/ui/modal-host.d.ts +30 -0
- package/dist/ui/modal-host.d.ts.map +1 -0
- package/dist/ui/modal-host.js +101 -0
- package/dist/ui/modal-host.js.map +1 -0
- package/dist/ui/official.d.ts.map +1 -1
- package/dist/ui/official.js +45 -1
- package/dist/ui/official.js.map +1 -1
- package/dist/ui/panel-dock-css.d.ts +2 -0
- package/dist/ui/panel-dock-css.d.ts.map +1 -0
- package/dist/ui/panel-dock-css.generated.d.ts +2 -0
- package/dist/ui/panel-dock-css.generated.d.ts.map +1 -0
- package/dist/ui/panel-dock-css.generated.js +4 -0
- package/dist/ui/panel-dock-css.generated.js.map +1 -0
- package/dist/ui/panel-dock-css.js +4 -0
- package/dist/ui/panel-dock-css.js.map +1 -0
- package/dist/ui/panel-dock-logic.d.ts +50 -0
- package/dist/ui/panel-dock-logic.d.ts.map +1 -0
- package/dist/ui/panel-dock-logic.js +64 -0
- package/dist/ui/panel-dock-logic.js.map +1 -0
- package/dist/ui/picker-css.d.ts +1 -1
- package/dist/ui/picker-css.d.ts.map +1 -1
- package/dist/ui/picker-css.generated.d.ts +2 -0
- package/dist/ui/picker-css.generated.d.ts.map +1 -0
- package/dist/ui/picker-css.generated.js +4 -0
- package/dist/ui/picker-css.generated.js.map +1 -0
- package/dist/ui/picker-css.js +1 -48
- package/dist/ui/picker-css.js.map +1 -1
- package/dist/ui/picker-icons.d.ts +12 -0
- package/dist/ui/picker-icons.d.ts.map +1 -0
- package/dist/ui/picker-icons.js +29 -0
- package/dist/ui/picker-icons.js.map +1 -0
- package/dist/ui/picker-logic.d.ts +4 -1
- package/dist/ui/picker-logic.d.ts.map +1 -1
- package/dist/ui/picker-logic.js +1 -2
- package/dist/ui/picker-logic.js.map +1 -1
- package/dist/ui/resizer.d.ts +3 -1
- package/dist/ui/resizer.d.ts.map +1 -1
- package/dist/ui/resizer.js +1 -1
- package/dist/ui/resizer.js.map +1 -1
- package/dist/ui/toast-host.d.ts +24 -0
- package/dist/ui/toast-host.d.ts.map +1 -0
- package/dist/ui/toast-host.js +20 -0
- package/dist/ui/toast-host.js.map +1 -0
- package/dist/utils/date.d.ts +8 -0
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +16 -0
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/i18n.d.ts +1 -1
- package/dist/utils/i18n.d.ts.map +1 -1
- package/dist/utils/i18n.js +437 -18
- package/dist/utils/i18n.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/path.d.ts.map +1 -1
- package/dist/utils/path.js +1 -0
- package/dist/utils/path.js.map +1 -1
- package/docs/README.md +12 -5
- package/docs/design/architecture.md +38 -8
- package/docs/design/copywriting.md +95 -0
- package/docs/design/doc-format.md +80 -0
- package/docs/design/doc-format.ts +39 -0
- package/docs/design/external/dsh-host.md +150 -1
- package/docs/design/features.md +4 -17
- package/docs/design/methods.md +13 -34
- package/docs/design/structure.md +25 -22
- package/docs/design/style.md +24 -50
- package/docs/help/design.doc.ts +112 -0
- package/docs/help/design.md +88 -0
- package/docs/help/explorer.doc.ts +136 -0
- package/docs/help/explorer.md +68 -0
- package/docs/help/index.doc.ts +79 -0
- package/docs/help/index.md +28 -0
- package/docs/help/integration.doc.ts +114 -0
- package/docs/help/integration.md +127 -0
- package/docs/help/methods.md +58 -0
- package/docs/help/session.doc.ts +154 -0
- package/docs/help/session.md +91 -0
- package/docs/help/style.md +80 -0
- package/docs/help/ui.doc.ts +404 -0
- package/docs/help/ui.md +342 -0
- package/docs/help/utils.doc.ts +133 -0
- package/docs/help/utils.md +96 -0
- package/docs/requirements.md +33 -12
- package/package.json +44 -3
- package/dist/ui/ErrorBoundary.d.ts +0 -22
- package/dist/ui/ErrorBoundary.d.ts.map +0 -1
- package/dist/ui/ErrorBoundary.js +0 -30
- package/dist/ui/ErrorBoundary.js.map +0 -1
- package/docs/design/features/design.md +0 -55
- package/docs/design/features/explorer.md +0 -73
- package/docs/design/features/session.md +0 -70
- package/docs/design/features/ui.md +0 -225
- package/docs/design/features/utils.md +0 -64
- package/docs/examples/integration.md +0 -103
package/docs/design/structure.md
CHANGED
|
@@ -38,16 +38,18 @@ dsh-plugin-core/
|
|
|
38
38
|
├── ui/ ② 基础控件 —— 纯零件 + 可复用基础能力(依赖 design)
|
|
39
39
|
│ ├── official.ts ✅ 全仓唯一 import 官方 primitives 的入口(L1)
|
|
40
40
|
│ ├── 表单 ✅ Input / NumberInput / PrefixedInput / Textarea /
|
|
41
|
-
│ │ Checkbox / Segmented / Picker
|
|
41
|
+
│ │ Checkbox / Segmented / Picker(下拉选择)/
|
|
42
|
+
│ │ DateTimePicker(日期时间:单值 / 时间段 × 精度到秒)
|
|
42
43
|
│ ├── 动作 ✅ Button / IconButton
|
|
43
|
-
│ ├── 反馈 ✅ Modal / Toast
|
|
44
|
+
│ ├── 反馈 ✅ Modal / Toast
|
|
44
45
|
│ │ └── Loading ⚪ 暂缓
|
|
45
46
|
│ ├── 展示 ✅ Card / StripCard / Chip / MarqueeText /
|
|
46
47
|
│ │ SectionHead / FieldHint / LiveText / BackToTop
|
|
47
|
-
│ ├── 选择 ✅ WorkspacePicker
|
|
48
|
-
│ │
|
|
49
|
-
│ └── 布局
|
|
50
|
-
│
|
|
48
|
+
│ ├── 选择 ✅ WorkspacePicker(选工作区,自取宿主快照)
|
|
49
|
+
│ │ 通用 Picker 是纯零件;领域选择器经 connectHost 自取数(2026-10-20)
|
|
50
|
+
│ └── 布局 ✅ PanelDock / createPanelDock(可停靠分栏:多面板 + 拖拽拉栏)
|
|
51
|
+
│ 组名 = 窗口一对一、同名覆盖、默认上限 3 超限拒绝;
|
|
52
|
+
│ 不做 tab 切换 / 自动淘汰 / 浮动层(用户 2026-10-20 定案)
|
|
51
53
|
│
|
|
52
54
|
├── utils/ ③ 纯方法 —— 零 React / 零 DOM(谁都能用,它不依赖谁)
|
|
53
55
|
│ ├── date ✅ 日期 / 相对时间 / 时间区间
|
|
@@ -55,13 +57,14 @@ dsh-plugin-core/
|
|
|
55
57
|
│ ├── string ⚪ 暂缓
|
|
56
58
|
│ ├── number ⚪ 暂缓(注:formatBytes 已被 adv.session 附件卡使用,只「不对外承诺」,不删)
|
|
57
59
|
│ ├── http ⚪ 暂缓
|
|
58
|
-
│ └── path
|
|
59
|
-
│
|
|
60
|
+
│ └── path ✅ 纯路径方法(无 UI):joinPath / parentOf / crumbsOf / extOf / mimeOf
|
|
61
|
+
│ (已从 explorer/types.ts 迁入,2026-10-20)
|
|
60
62
|
│
|
|
61
63
|
├── adv.explorer/ ④ 高级空间①:文件浏览(依赖 ui + utils)
|
|
62
|
-
│
|
|
63
|
-
│
|
|
64
|
-
│
|
|
64
|
+
│ ├── FileBrowser ✅ 面板本体:面包屑(▾ 选层)+ 内联展开树 + 预览(+ picker 形态)
|
|
65
|
+
│ ├── open ✅ 两命令式能力:openFilePreview(侧边栏预览)/ pickWorkspaceFile(锚定弹窗选文件)
|
|
66
|
+
│ ├── types ✅ 纯逻辑层(零 React / 零官方件):预览分发 / 错误码 / 根反推 / 过滤
|
|
67
|
+
│ └── preview ✅ 预览体家族:md / 代码 / HTML / PDF / Office / 图片
|
|
65
68
|
│
|
|
66
69
|
└── adv.session/ ⑤ 高级空间②:会话记录(依赖 ui + utils)
|
|
67
70
|
└── SessionPreview ✅ 成品:ui.Modal 承载会话消息(modal / sidebar / page)
|
|
@@ -72,7 +75,7 @@ dsh-plugin-core/
|
|
|
72
75
|
| 成品 | 用到的 `ui` 基础能力 | 定制了什么 |
|
|
73
76
|
|---|---|---|
|
|
74
77
|
| `adv.session` · `SessionPreview` | `Modal` | 把会话消息放进弹窗 |
|
|
75
|
-
| `adv.explorer` · `
|
|
78
|
+
| `adv.explorer` · `FileBrowser` | `Button`(面包屑 ghost / 行尾 outline)/ `IconButton` / `Segmented` / `MarqueeText` / `PanelDock`(浏览态外壳与拖宽)+ 官方件(`FileTypeIcon` / `MarkdownText` / `CodeBlock`,经 `ui/official`) | 面包屑 + 内联展开树 + 预览体家族 + 两命令式能力 |
|
|
76
79
|
|
|
77
80
|
`adv.*` 只做「拼装 + 业务定制」,不重新实现按钮 / 下拉 / 弹窗 / 侧栏。
|
|
78
81
|
|
|
@@ -105,14 +108,14 @@ utils(谁都不依赖,谁都可以用)
|
|
|
105
108
|
│ (只摆值,不点交互)
|
|
106
109
|
│
|
|
107
110
|
├─ ② 基础控件
|
|
108
|
-
│ ├─ 表单 Input / NumberInput / PrefixedInput / Textarea / Checkbox / Segmented / Picker
|
|
111
|
+
│ ├─ 表单 Input / NumberInput / PrefixedInput / Textarea / Checkbox / Segmented / Picker / DateTimePicker
|
|
109
112
|
│ ├─ 动作 Button / IconButton
|
|
110
|
-
│ ├─ 反馈 Modal / Toast
|
|
113
|
+
│ ├─ 反馈 Modal / Toast
|
|
111
114
|
│ ├─ 展示 Card / StripCard / Chip / MarqueeText / SectionHead / FieldHint / LiveText / BackToTop
|
|
112
|
-
│ └─ 布局
|
|
115
|
+
│ └─ 布局 PanelDock / 拉栏
|
|
113
116
|
│
|
|
114
117
|
├─ ③ 高级空间
|
|
115
|
-
│ ├─ 文件浏览
|
|
118
|
+
│ ├─ 文件浏览 FileBrowser + openFilePreview / pickWorkspaceFile(点文件夹、点文件看预览)
|
|
116
119
|
│ └─ 会话预览 SessionPreview(弹窗里放会话记录)
|
|
117
120
|
│
|
|
118
121
|
└─ ④ 工具方法
|
|
@@ -139,12 +142,12 @@ utils(谁都不依赖,谁都可以用)
|
|
|
139
142
|
- **目录改名**:`src/explorer` → `src/adv.explorer`、`src/session` → `src/adv.session`;同步改
|
|
140
143
|
`package.json` 的 `exports`、各 `index.ts`、`packages/demo` 的 import、`docs/design/architecture.md` 的树。
|
|
141
144
|
代码现在仍是旧名。
|
|
142
|
-
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
-
|
|
147
|
-
|
|
145
|
+
- ~~**收窄导出**:`adv.explorer` 只暴露 `ExplorerPanel`~~ → 已定(2026-10-20):暴露 `FileBrowser` 面板 +
|
|
146
|
+
`openFilePreview` / `pickWorkspaceFile` 两命令式能力 + 纯逻辑层;`WorkspacePicker` 留在 `ui`。
|
|
147
|
+
- ~~**路径方法归基础**~~ → **已落地**(2026-10-20):`joinPath` / `parentOf` / `crumbsOf` / `extOf` / `mimeOf`
|
|
148
|
+
在 `utils/path`;`previewInfoOf` 等业务判断留 `explorer/types.ts`(纯逻辑层,node 单测直接引)。
|
|
149
|
+
- ~~**补基础组件**:`ui` 需补 `SidebarLayout` / `SplitPane`~~ → **已落地为 `PanelDock`**(2026-10-20),
|
|
150
|
+
`resizer` 保留为它的底层函数。
|
|
148
151
|
- **暂缓项**:`utils/string`、`utils/number`、`utils/http`、`ui/feedback/Loading` —— 只标注,未删代码。
|
|
149
152
|
- **库里没有的**:
|
|
150
153
|
- 表格 Table —— 待真实需求再定,不预造;
|
package/docs/design/style.md
CHANGED
|
@@ -1,77 +1,51 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 样式规范(本仓内部)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> EN: Style conventions (internal)
|
|
4
|
+
|
|
5
|
+
使用侧内容(token 清单、明暗判据、定制边界)在帮助文档区 `docs/help/`。
|
|
6
|
+
本文件只留**改动本仓样式时要守的东西**。
|
|
7
|
+
EN: The caller-facing material (token inventory, dark predicate, customization surface) lives in `docs/help/`.
|
|
8
|
+
What stays here is what you must honour when **changing styles in this repo**.
|
|
4
9
|
|
|
5
10
|
## 为什么样式只能运行时注入
|
|
6
11
|
|
|
12
|
+
> EN: Why styles can only be injected at runtime
|
|
13
|
+
|
|
7
14
|
客户端产物是 `window.__ModuleLoader__.load({ id, factory })` 的 CJS 闭包,
|
|
8
15
|
`import './x.css'` 只会产出独立 css 资源、**内核不加载它** ⇒ CSS 只能以 TS 字符串在运行时打进 `<style>`。
|
|
9
16
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
变量与类名**全生态统一 `dshpc`**,代码里直接写死,不存在按插件替换这回事。
|
|
13
|
-
|
|
14
|
-
| 名称 | 规则 |
|
|
15
|
-
|---|---|
|
|
16
|
-
| 变量 `--dshpc-*` | 直接使用;token 定义与控件样式都写这个前缀 |
|
|
17
|
-
| 类名 `dshpc-*` | 必须与控件里硬编码的 className 逐字一致,改一处就得全改 |
|
|
18
|
-
|
|
19
|
-
> **已知限制**:两个插件若引的 core 版本不同,`.dshpc-*` 规则会互相覆盖(同版本内容一致、无害)。
|
|
20
|
-
> 隔离靠 style 标签 id(`createStyleKit({ id })`)。
|
|
21
|
-
|
|
22
|
-
## 明暗判据(硬约束)
|
|
23
|
-
|
|
24
|
-
```ts
|
|
25
|
-
export const DARK_THEME_SELECTOR = 'body[data-ds-dark-theme]'
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
- 由**宿主启动脚本** `toggleAttribute` 写入 body,反映的是**用户在客户端里的选择**。
|
|
29
|
-
- **禁止用 `prefers-color-scheme`**:它跟的是系统,不是用户在宿主里的选择。
|
|
30
|
-
两者会分叉——系统亮色 + 用户在 DSH 里选暗色时,跟 `prefers-color-scheme` 会显示成亮色,与宿主不一致。
|
|
31
|
-
|
|
32
|
-
## token 清单
|
|
33
|
-
|
|
34
|
-
token 原文提取自 `dsh-task-dispatch-table/src/client/ui/tokens.ts`,含深色覆盖段。
|
|
35
|
-
分类(命名口径保持原样,只换前缀):
|
|
36
|
-
|
|
37
|
-
| 类别 | 例 |
|
|
38
|
-
|---|---|
|
|
39
|
-
| 前景 / 背景面 | `--dshpc-fg` `--dshpc-fg-3` `--dshpc-fg-4` `--dshpc-surface-1` `--dshpc-surface-2` `--dshpc-surface-sunken` `--dshpc-surface-menu` `--dshpc-surface-base` |
|
|
40
|
-
| 边框 | `--dshpc-border` `--dshpc-border-faint` |
|
|
41
|
-
| 间距 | `--dshpc-space-1` … `--dshpc-space-3` |
|
|
42
|
-
| 字号 / 行高 | `--dshpc-font-sm` `--dshpc-font-lg` `--dshpc-line-sm` `--dshpc-line-md` `--dshpc-line-lg` |
|
|
43
|
-
| 语义色 | `--dshpc-business` `--dshpc-success` `--dshpc-danger` `--dshpc-warning` `--dshpc-link` |
|
|
44
|
-
| 语义面 | `--dshpc-open-bg` `--dshpc-open-bg-soft` `--dshpc-chip-bg` `--dshpc-chip-bg-hover` |
|
|
45
|
-
| 代码 | `--dshpc-code-surface` `--dshpc-code-font` |
|
|
46
|
-
|
|
47
|
-
完整清单以 `src/design/tokens-css.ts` 为准(**真源在代码,不在这里抄第二份**)。
|
|
48
|
-
消费方查某个变量叫什么:`kit.cssVar('fg')` 或直接 grep `tokens-css.ts`。
|
|
17
|
+
EN: The client bundle is a CJS closure loaded by `window.__ModuleLoader__.load`, so `import './x.css'` produces a
|
|
18
|
+
separate asset the kernel never loads — CSS must be injected at runtime as a TS string.
|
|
49
19
|
|
|
50
20
|
## 交互态颜色(hover / active)
|
|
51
21
|
|
|
52
|
-
|
|
53
|
-
完全感觉不到颜色变了」)。压 10% opacity 与底色无关,几乎不可见。
|
|
22
|
+
> EN: Interaction colors (hover / active)
|
|
54
23
|
|
|
24
|
+
**实心控件不用 `opacity` 表达 hover**:压 10% opacity 与底色无关,几乎不可见。
|
|
55
25
|
改用 token 层的**派生色**(`--dshpc-{accent,danger,success,warning,business}-hover / -active`):
|
|
56
26
|
|
|
27
|
+
EN: Solid controls never use `opacity` for hover — it barely reads against the base color. Use the derived
|
|
28
|
+
token colors instead.
|
|
29
|
+
|
|
57
30
|
| 主题 | 黑底(accent) | 红 / 绿 / 黄 / 蓝底 |
|
|
58
31
|
|---|---|---|
|
|
59
32
|
| 亮色 | 掺白提亮(黑 → 灰) | 掺黑压深(红 → 暗红) |
|
|
60
33
|
| 暗色 | 掺黑压深(近白 → 灰) | 掺白提亮 |
|
|
61
34
|
|
|
62
35
|
- 幅度 22% / 36%(hover / active),两种主题下都「一眼看出变了」。
|
|
63
|
-
- 混色对象写成**固定中性色字面量** `#fff` / `#000
|
|
36
|
+
- 混色对象写成**固定中性色字面量** `#fff` / `#000`,不依赖宿主静态中性色是否存在。
|
|
64
37
|
- 旧内核不认 `color-mix` 时整条声明作废 ⇒ 回落该档原色(仍有基本可用性,只是没有 hover 反馈)。
|
|
65
38
|
|
|
39
|
+
EN: 22% / 36% for hover / active. Mix against literal `#fff` / `#000`, not host-provided neutrals. If an old
|
|
40
|
+
core ignores `color-mix`, the declaration drops and falls back to the base tier.
|
|
41
|
+
|
|
66
42
|
## 三条硬规矩
|
|
67
43
|
|
|
44
|
+
> EN: Three hard rules
|
|
45
|
+
|
|
68
46
|
1. 不许再有第二处 `document.createElement('style')` —— 一律走 kit。
|
|
69
47
|
2. 不许再出现第二套 style 标签 id —— 一个插件一套 kit。
|
|
70
48
|
3. 域内的规则只能消费 `var(--dshpc-*)`,颜色 / 尺寸 / 字号一律来自 token 层,不写死值。
|
|
71
49
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
- **换肤**:给同一批变量名赋新值(在插件自己的样式域里覆盖),不需要 fork。
|
|
75
|
-
- **加域**:`kit.registerStyle('widget', css)`,同一域重复登记 = 覆盖。
|
|
76
|
-
- **`tokens` 域恒排最前**(变量定义必须先于消费它的规则),kit 内部已保证。
|
|
77
|
-
- 皮肤写在调用方自己的样式域里;组件只认 token,不认调用方的具体颜色。
|
|
50
|
+
EN: No second `document.createElement('style')` — always go through the kit. No second style tag id — one kit
|
|
51
|
+
per plugin. Rules inside a domain consume `var(--dshpc-*)` only; never hard-code colors, sizes or fonts.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// design 子包的使用帮助 —— 真源(TS 数据模块)。内容全在此一处,demo 与 md 都从这份派生。
|
|
2
|
+
import type { DocTopic } from '../design/doc-format.js'
|
|
3
|
+
|
|
4
|
+
const minimal = `import { createStyleKit } from 'dsh-plugin-core/design'
|
|
5
|
+
|
|
6
|
+
const kit = createStyleKit({ id: 'dsh-task-reminder-ui' })
|
|
7
|
+
kit.applyStyle('tokens', kit.tokensCss)
|
|
8
|
+
// 之后自己的样式域:
|
|
9
|
+
kit.applyStyle('widget', '.widget{color:var(--dshpc-fg)}')`
|
|
10
|
+
|
|
11
|
+
const doc: DocTopic = {
|
|
12
|
+
title: { zh: 'design —— 样式层', en: 'design — styling layer' },
|
|
13
|
+
exports: ['createStyleKit', 'DARK_THEME_SELECTOR', 'StyleKit', 'StyleKitOptions'],
|
|
14
|
+
sections: [
|
|
15
|
+
{
|
|
16
|
+
id: 'foundation',
|
|
17
|
+
heading: { zh: '概览', en: 'Overview' },
|
|
18
|
+
prose: [
|
|
19
|
+
{
|
|
20
|
+
zh: '零 React、无组件。装的是「值 + 注入机制」:token 变量表、注入器工厂、主题判据。',
|
|
21
|
+
en: 'Zero React, no components. It ships values plus an injection mechanism: the token variable table, the injector factory, and the theme predicate.',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
zh: '只想统一配色/尺寸但自己写组件的插件,只引这一个就够。',
|
|
25
|
+
en: 'A plugin that wants unified color/size but writes its own components needs only this subpath.',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'foundation-exports',
|
|
31
|
+
heading: { zh: '导出', en: 'Exports' },
|
|
32
|
+
api: [
|
|
33
|
+
{
|
|
34
|
+
id: 'design-exports',
|
|
35
|
+
rows: [
|
|
36
|
+
{ name: 'createStyleKit(options)', type: '', def: '', desc: { zh: '领一套本插件专属的样式设施(必调)', en: 'Acquire a plugin-scoped styling kit (must call)' } },
|
|
37
|
+
{ name: 'DARK_THEME_SELECTOR', type: '', def: '', desc: { zh: '明暗判据选择器常量 `body[data-ds-dark-theme]`', en: 'Dark-mode predicate selector constant `body[data-ds-dark-theme]`' } },
|
|
38
|
+
{ name: 'type StyleKit / StyleKitOptions', type: '', def: '', desc: { zh: '类型', en: 'Types' } },
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'foundation-createStyleKit',
|
|
45
|
+
heading: { zh: 'createStyleKit(options)', en: 'createStyleKit(options)' },
|
|
46
|
+
api: [
|
|
47
|
+
{
|
|
48
|
+
id: 'createStyleKit-params',
|
|
49
|
+
rows: [
|
|
50
|
+
{
|
|
51
|
+
name: 'id',
|
|
52
|
+
type: 'string',
|
|
53
|
+
required: '是',
|
|
54
|
+
def: '—',
|
|
55
|
+
desc: {
|
|
56
|
+
zh: '`<style>` 标签 id,多插件同页靠它互不覆盖,必须插件内唯一。空串抛错',
|
|
57
|
+
en: 'The `<style>` tag id; on a page with multiple plugins it prevents overlaps and must be unique within the plugin. Empty string throws',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 'foundation-styleKit',
|
|
66
|
+
heading: { zh: '返回的 StyleKit', en: 'Returned StyleKit' },
|
|
67
|
+
api: [
|
|
68
|
+
{
|
|
69
|
+
id: 'styleKit-members',
|
|
70
|
+
rows: [
|
|
71
|
+
{ name: 'id', type: 'string', def: '—', desc: { zh: '回显', en: 'Echoed back' } },
|
|
72
|
+
{ name: 'tokensCss', type: 'string', def: '—', desc: { zh: '已替换前缀的 token CSS 文本', en: 'Token CSS text with the prefix already substituted' } },
|
|
73
|
+
{ name: 'cssVar(name)', type: '(name: string) => string', def: '—', desc: { zh: '拼变量名:`cssVar(\'fg\')` ⇒ `--acme-fg`', en: 'Build a var name: `cssVar(\'fg\')` ⇒ `--acme-fg`' } },
|
|
74
|
+
{ name: 'registerStyle(domain, css)', type: '(domain: string, css: string) => void', def: '—', desc: { zh: '登记一个域的 CSS;同名重复登记 = 覆盖', en: 'Register a domain’s CSS; re-registering the same domain overwrites' } },
|
|
75
|
+
{ name: 'ensureStyles()', type: '() => void', def: '—', desc: { zh: '确保标签已挂载且内容最新(幂等;无 document 静默跳过)', en: 'Ensure the tag is mounted and current (idempotent; silently skips without document)' } },
|
|
76
|
+
{ name: 'applyStyle(domain, css)', type: '(domain: string, css: string) => void', def: '—', desc: { zh: '登记 + 立刻挂载', en: 'Register and mount immediately' } },
|
|
77
|
+
{ name: 'dispose()', type: '() => void', def: '—', desc: { zh: '撤掉标签并清空登记域(插件卸载 / HMR 时用)', en: 'Remove the tag and clear registered domains (on plugin unload / HMR)' } },
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: 'foundation-minimal',
|
|
84
|
+
heading: { zh: '最小可用', en: 'Minimal usage' },
|
|
85
|
+
code: [{ id: 'design-minimal', lang: 'ts', src: minimal }],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: 'foundation-tokens',
|
|
89
|
+
heading: { zh: 'token 口径', en: 'Token conventions' },
|
|
90
|
+
prose: [
|
|
91
|
+
{
|
|
92
|
+
zh: 'token 覆盖颜色 / 尺寸 / 字号 / 层级,**含深色覆盖段**。取值一律走 `var(--dshpc-*)`,不在规则里写死颜色值。',
|
|
93
|
+
en: 'Tokens cover color / size / font-size / elevation, **including the dark-mode override block**. Always read values via `var(--dshpc-*)`, never hard-code colors in rules.',
|
|
94
|
+
},
|
|
95
|
+
{ zh: '完整清单与命名口径:前景 / 背景 / 边框 / 间距 / 字号 / 语义色七类,`--dshpc-` 前缀,含深色覆盖段。', en: 'Full inventory and naming: seven families (foreground / surface / border / spacing / font / semantic color / semantic surface), all `--dshpc-` prefixed, with a dark-mode override block.' },
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: 'foundation-customize',
|
|
100
|
+
heading: { zh: '定制边界', en: 'Customization boundary' },
|
|
101
|
+
prose: [
|
|
102
|
+
{
|
|
103
|
+
zh: 'token 的**前缀固定 `dshpc`**(不参数化、不按插件改名);token 的**内容**(有哪些变量、值是什么)是本包定的审美标准,消费方通过覆盖变量值来适配,不要改本包源码。',
|
|
104
|
+
en: 'The token **prefix is fixed to `dshpc`** (not parameterized, not renamed per plugin); the token **content** (which variables exist, what values) is this package’s aesthetic standard — consumers adapt by overriding variable values, not by editing this package’s source.',
|
|
105
|
+
},
|
|
106
|
+
{ zh: '要整套换肤:给同一批变量名赋新值即可,不需要 fork。', en: 'To reskin entirely: assign new values to the same variable names; no fork needed.' },
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export default doc
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<!-- 本文件由 scripts/gen-docs.mjs 自动生成,请勿手改;改对应的 .doc.ts 后重跑 node scripts/gen-docs.mjs -->
|
|
2
|
+
|
|
3
|
+
# design —— 样式层
|
|
4
|
+
|
|
5
|
+
> EN: design — styling layer
|
|
6
|
+
|
|
7
|
+
导出:createStyleKit、DARK_THEME_SELECTOR、StyleKit、StyleKitOptions
|
|
8
|
+
|
|
9
|
+
## 概览
|
|
10
|
+
|
|
11
|
+
> EN: Overview
|
|
12
|
+
|
|
13
|
+
零 React、无组件。装的是「值 + 注入机制」:token 变量表、注入器工厂、主题判据。
|
|
14
|
+
|
|
15
|
+
> EN: Zero React, no components. It ships values plus an injection mechanism: the token variable table, the injector factory, and the theme predicate.
|
|
16
|
+
|
|
17
|
+
只想统一配色/尺寸但自己写组件的插件,只引这一个就够。
|
|
18
|
+
|
|
19
|
+
> EN: A plugin that wants unified color/size but writes its own components needs only this subpath.
|
|
20
|
+
|
|
21
|
+
## 导出
|
|
22
|
+
|
|
23
|
+
> EN: Exports
|
|
24
|
+
|
|
25
|
+
| 参数 | 类型 | 默认 | 说明(zh) | 说明(en) |
|
|
26
|
+
|---|---|---|---|---|
|
|
27
|
+
| `createStyleKit(options)` | `` | | 领一套本插件专属的样式设施(必调) | Acquire a plugin-scoped styling kit (must call) |
|
|
28
|
+
| `DARK_THEME_SELECTOR` | `` | | 明暗判据选择器常量 `body[data-ds-dark-theme]` | Dark-mode predicate selector constant `body[data-ds-dark-theme]` |
|
|
29
|
+
| `type StyleKit / StyleKitOptions` | `` | | 类型 | Types |
|
|
30
|
+
|
|
31
|
+
## createStyleKit(options)
|
|
32
|
+
|
|
33
|
+
> EN: createStyleKit(options)
|
|
34
|
+
|
|
35
|
+
| 参数 | 类型 | 必填 | 默认 | 说明(zh) | 说明(en) |
|
|
36
|
+
|---|---|---|---|---|---|
|
|
37
|
+
| `id` | `string` | 是 | — | `<style>` 标签 id,多插件同页靠它互不覆盖,必须插件内唯一。空串抛错 | The `<style>` tag id; on a page with multiple plugins it prevents overlaps and must be unique within the plugin. Empty string throws |
|
|
38
|
+
|
|
39
|
+
## 返回的 StyleKit
|
|
40
|
+
|
|
41
|
+
> EN: Returned StyleKit
|
|
42
|
+
|
|
43
|
+
| 参数 | 类型 | 默认 | 说明(zh) | 说明(en) |
|
|
44
|
+
|---|---|---|---|---|
|
|
45
|
+
| `id` | `string` | — | 回显 | Echoed back |
|
|
46
|
+
| `tokensCss` | `string` | — | 已替换前缀的 token CSS 文本 | Token CSS text with the prefix already substituted |
|
|
47
|
+
| `cssVar(name)` | `(name: string) => string` | — | 拼变量名:`cssVar('fg')` ⇒ `--acme-fg` | Build a var name: `cssVar('fg')` ⇒ `--acme-fg` |
|
|
48
|
+
| `registerStyle(domain, css)` | `(domain: string, css: string) => void` | — | 登记一个域的 CSS;同名重复登记 = 覆盖 | Register a domain’s CSS; re-registering the same domain overwrites |
|
|
49
|
+
| `ensureStyles()` | `() => void` | — | 确保标签已挂载且内容最新(幂等;无 document 静默跳过) | Ensure the tag is mounted and current (idempotent; silently skips without document) |
|
|
50
|
+
| `applyStyle(domain, css)` | `(domain: string, css: string) => void` | — | 登记 + 立刻挂载 | Register and mount immediately |
|
|
51
|
+
| `dispose()` | `() => void` | — | 撤掉标签并清空登记域(插件卸载 / HMR 时用) | Remove the tag and clear registered domains (on plugin unload / HMR) |
|
|
52
|
+
|
|
53
|
+
## 最小可用
|
|
54
|
+
|
|
55
|
+
> EN: Minimal usage
|
|
56
|
+
|
|
57
|
+
```ts id="design-minimal"
|
|
58
|
+
import { createStyleKit } from 'dsh-plugin-core/design'
|
|
59
|
+
|
|
60
|
+
const kit = createStyleKit({ id: 'dsh-task-reminder-ui' })
|
|
61
|
+
kit.applyStyle('tokens', kit.tokensCss)
|
|
62
|
+
// 之后自己的样式域:
|
|
63
|
+
kit.applyStyle('widget', '.widget{color:var(--dshpc-fg)}')
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## token 口径
|
|
67
|
+
|
|
68
|
+
> EN: Token conventions
|
|
69
|
+
|
|
70
|
+
token 覆盖颜色 / 尺寸 / 字号 / 层级,**含深色覆盖段**。取值一律走 `var(--dshpc-*)`,不在规则里写死颜色值。
|
|
71
|
+
|
|
72
|
+
> EN: Tokens cover color / size / font-size / elevation, **including the dark-mode override block**. Always read values via `var(--dshpc-*)`, never hard-code colors in rules.
|
|
73
|
+
|
|
74
|
+
完整清单与命名口径:前景 / 背景 / 边框 / 间距 / 字号 / 语义色七类,`--dshpc-` 前缀,含深色覆盖段。
|
|
75
|
+
|
|
76
|
+
> EN: Full inventory and naming: seven families (foreground / surface / border / spacing / font / semantic color / semantic surface), all `--dshpc-` prefixed, with a dark-mode override block.
|
|
77
|
+
|
|
78
|
+
## 定制边界
|
|
79
|
+
|
|
80
|
+
> EN: Customization boundary
|
|
81
|
+
|
|
82
|
+
token 的**前缀固定 `dshpc`**(不参数化、不按插件改名);token 的**内容**(有哪些变量、值是什么)是本包定的审美标准,消费方通过覆盖变量值来适配,不要改本包源码。
|
|
83
|
+
|
|
84
|
+
> EN: The token **prefix is fixed to `dshpc`** (not parameterized, not renamed per plugin); the token **content** (which variables exist, what values) is this package’s aesthetic standard — consumers adapt by overriding variable values, not by editing this package’s source.
|
|
85
|
+
|
|
86
|
+
要整套换肤:给同一批变量名赋新值即可,不需要 fork。
|
|
87
|
+
|
|
88
|
+
> EN: To reskin entirely: assign new values to the same variable names; no fork needed.
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// explorer 子包的使用帮助 —— 真源(TS 数据模块)。内容全在此一处,demo 与 md 都从这份派生。
|
|
2
|
+
import type { DocTopic } from '../design/doc-format.js'
|
|
3
|
+
|
|
4
|
+
const explorerUsage = `import { openFilePreview, pickWorkspaceFile } from 'dsh-plugin-core/explorer'
|
|
5
|
+
|
|
6
|
+
// 右侧分栏预览(占宽度、挤窄主区)
|
|
7
|
+
openFilePreview({ mount, workspaceFiles, officeToPdf, sessionId, path, rootName })
|
|
8
|
+
|
|
9
|
+
// path 传绝对路径时:按最长前缀匹配所属工作区,面包屑 / 目录树与 ▾「切工作区」自动可用
|
|
10
|
+
openFilePreview({ mount, workspaceFiles, sessionId, path: '/abs/path.md' })
|
|
11
|
+
// 要覆盖宿主快照才显式传 workspaceAnchors(带 path + sessionIds)
|
|
12
|
+
openFilePreview({ mount, workspaceFiles, sessionId, path: '/abs/path.md', workspaceAnchors })
|
|
13
|
+
|
|
14
|
+
// 锚定弹窗选文件(Promise 返回路径,不自己挂 dock)
|
|
15
|
+
const r = await pickWorkspaceFile({ workspaceFiles, sessionId, anchor, rootName })`
|
|
16
|
+
|
|
17
|
+
const doc: DocTopic = {
|
|
18
|
+
title: { zh: 'explorer —— 工作区浏览', en: 'explorer — Workspace browsing' },
|
|
19
|
+
exports: ['openFilePreview', 'pickWorkspaceFile', 'FileBrowser', 'FilePreview'],
|
|
20
|
+
sections: [
|
|
21
|
+
{
|
|
22
|
+
id: 'explorer',
|
|
23
|
+
heading: { zh: '概览', en: 'Overview' },
|
|
24
|
+
prose: [
|
|
25
|
+
{
|
|
26
|
+
zh: '提供工作区文件浏览与选择,数据来自宿主提供的工作区文件快照。',
|
|
27
|
+
en: 'Workspace file browsing and picking, driven by the host-provided workspace file snapshot.',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
zh: '浏览态停靠是布局成员(占宽度、挤窄主区),不要挂 `document.body` 再自己套 fixed。',
|
|
31
|
+
en: 'The browse dock is a layout member (takes width, narrows the main area); never mount it on `document.body` with your own fixed positioning.',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'explorer-install',
|
|
37
|
+
heading: { zh: '0. 装包', en: '0. Install' },
|
|
38
|
+
code: [{ id: 'explorer-install-code', lang: 'bash', src: 'pnpm add dsh-plugin-core' }],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'explorer-usage',
|
|
42
|
+
heading: { zh: '1. 接入示例', en: '1. Usage' },
|
|
43
|
+
prose: [
|
|
44
|
+
{
|
|
45
|
+
zh: '从 ctx 取出工作区快照再传给能力接口,不要传整个 ctx。',
|
|
46
|
+
en: 'Pull the workspace snapshot out of ctx and hand it to the capability APIs; do not pass the whole ctx.',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
code: [{ id: 'explorer-usage-code', lang: 'tsx', src: explorerUsage }],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: 'explorer-api',
|
|
53
|
+
heading: { zh: 'API', en: 'API' },
|
|
54
|
+
api: [
|
|
55
|
+
{
|
|
56
|
+
id: 'explorer-api-table',
|
|
57
|
+
rows: [
|
|
58
|
+
{
|
|
59
|
+
name: 'openFilePreview(opts)',
|
|
60
|
+
type: 'OpenFilePreviewOptions => FilePreviewHandle',
|
|
61
|
+
def: '—',
|
|
62
|
+
desc: {
|
|
63
|
+
zh: '在右侧分栏打开文件 / 文件夹预览,返回可关闭它的句柄。预览内容二选一:`path`(核心解析并渲染)或 `content`(由调用方给内容)',
|
|
64
|
+
en: 'Opens a file/folder preview in the right-side dock and returns a handle to close it. Body is one of two: `path` (resolved and rendered by core) or `content` (rendered from your own node)',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'opts.mount',
|
|
69
|
+
type: 'HTMLElement',
|
|
70
|
+
def: '—',
|
|
71
|
+
required: '是',
|
|
72
|
+
desc: { zh: '页面里的 flex 行;预览靠它占宽而不是浮在页面上方', en: 'The page’s flex row; the preview takes width there instead of floating' },
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'opts.workspaceFiles',
|
|
76
|
+
type: 'WorkspaceFilesFace',
|
|
77
|
+
def: '—',
|
|
78
|
+
desc: { zh: '从 ctx 取出的工作区文件服务;传 `content` 时可省', en: 'Workspace file service taken from ctx; optional when passing `content`' },
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'opts.sessionId',
|
|
82
|
+
type: 'string',
|
|
83
|
+
def: '—',
|
|
84
|
+
desc: { zh: '该工作区的真实会话 id(服务是会话作用域的);传 `content` 时可省', en: 'A real session id of that workspace (the service is session-scoped); optional when passing `content`' },
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'opts.path',
|
|
88
|
+
type: 'string',
|
|
89
|
+
def: '—',
|
|
90
|
+
desc: { zh: '工作区相对路径;绝对路径会自动按最长前缀匹配所属工作区。与 `content` 二选一', en: 'Workspace-relative path; absolute paths are matched to their workspace by longest prefix. Mutually exclusive with `content`' },
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'opts.content',
|
|
94
|
+
type: '() => ReactNode',
|
|
95
|
+
def: '—',
|
|
96
|
+
desc: { zh: '自定义预览内容,塞进同一个右侧 dock;传它时不需要 `path`', en: 'Custom preview body rendered in the same dock; no `path` needed when set' },
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'opts.officeToPdf',
|
|
100
|
+
type: 'OfficeToPdfFace',
|
|
101
|
+
def: '—',
|
|
102
|
+
desc: { zh: 'Office 转 PDF 能力;缺失则该格式走「不支持」而不是报错', en: 'Office→PDF capability; without it that format shows "unsupported" instead of erroring' },
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'opts.rootName',
|
|
106
|
+
type: 'string',
|
|
107
|
+
def: '—',
|
|
108
|
+
desc: { zh: '兜底显示名(路径匹配不出工作区时用)', en: 'Fallback display name, used when no workspace matches the path' },
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'pickWorkspaceFile(opts)',
|
|
112
|
+
type: 'PickWorkspaceFileOptions => Promise<PickedFile>',
|
|
113
|
+
def: '—',
|
|
114
|
+
desc: { zh: '锚定按钮弹出模态选文件,解析出 `{ path, isDir }`', en: 'Anchored modal picker that resolves `{ path, isDir }`' },
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: 'opts.anchor',
|
|
118
|
+
type: 'HTMLElement',
|
|
119
|
+
def: '—',
|
|
120
|
+
required: '是',
|
|
121
|
+
desc: { zh: '模态贴着它弹', en: 'The modal anchors next to it' },
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: 'opts.filter',
|
|
125
|
+
type: 'PickFilter',
|
|
126
|
+
def: '—',
|
|
127
|
+
desc: { zh: '按扩展名过滤 `{ exts: [\'md\'] }`;`dirs: true` 则只允许选文件夹', en: 'Filter by extension `{ exts: [\'md\'] }`; `dirs: true` restricts picking to folders' },
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export default doc
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<!-- 本文件由 scripts/gen-docs.mjs 自动生成,请勿手改;改对应的 .doc.ts 后重跑 node scripts/gen-docs.mjs -->
|
|
2
|
+
|
|
3
|
+
# explorer —— 工作区浏览
|
|
4
|
+
|
|
5
|
+
> EN: explorer — Workspace browsing
|
|
6
|
+
|
|
7
|
+
导出:openFilePreview、pickWorkspaceFile、FileBrowser、FilePreview
|
|
8
|
+
|
|
9
|
+
## 概览
|
|
10
|
+
|
|
11
|
+
> EN: Overview
|
|
12
|
+
|
|
13
|
+
提供工作区文件浏览与选择,数据来自宿主提供的工作区文件快照。
|
|
14
|
+
|
|
15
|
+
> EN: Workspace file browsing and picking, driven by the host-provided workspace file snapshot.
|
|
16
|
+
|
|
17
|
+
浏览态停靠是布局成员(占宽度、挤窄主区),不要挂 `document.body` 再自己套 fixed。
|
|
18
|
+
|
|
19
|
+
> EN: The browse dock is a layout member (takes width, narrows the main area); never mount it on `document.body` with your own fixed positioning.
|
|
20
|
+
|
|
21
|
+
## 0. 装包
|
|
22
|
+
|
|
23
|
+
> EN: 0. Install
|
|
24
|
+
|
|
25
|
+
```bash id="explorer-install-code"
|
|
26
|
+
pnpm add dsh-plugin-core
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 1. 接入示例
|
|
30
|
+
|
|
31
|
+
> EN: 1. Usage
|
|
32
|
+
|
|
33
|
+
从 ctx 取出工作区快照再传给能力接口,不要传整个 ctx。
|
|
34
|
+
|
|
35
|
+
> EN: Pull the workspace snapshot out of ctx and hand it to the capability APIs; do not pass the whole ctx.
|
|
36
|
+
|
|
37
|
+
```tsx id="explorer-usage-code"
|
|
38
|
+
import { openFilePreview, pickWorkspaceFile } from 'dsh-plugin-core/explorer'
|
|
39
|
+
|
|
40
|
+
// 右侧分栏预览(占宽度、挤窄主区)
|
|
41
|
+
openFilePreview({ mount, workspaceFiles, officeToPdf, sessionId, path, rootName })
|
|
42
|
+
|
|
43
|
+
// path 传绝对路径时:按最长前缀匹配所属工作区,面包屑 / 目录树与 ▾「切工作区」自动可用
|
|
44
|
+
openFilePreview({ mount, workspaceFiles, sessionId, path: '/abs/path.md' })
|
|
45
|
+
// 要覆盖宿主快照才显式传 workspaceAnchors(带 path + sessionIds)
|
|
46
|
+
openFilePreview({ mount, workspaceFiles, sessionId, path: '/abs/path.md', workspaceAnchors })
|
|
47
|
+
|
|
48
|
+
// 锚定弹窗选文件(Promise 返回路径,不自己挂 dock)
|
|
49
|
+
const r = await pickWorkspaceFile({ workspaceFiles, sessionId, anchor, rootName })
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## API
|
|
53
|
+
|
|
54
|
+
> EN: API
|
|
55
|
+
|
|
56
|
+
| 参数 | 类型 | 必填 | 默认 | 说明(zh) | 说明(en) |
|
|
57
|
+
|---|---|---|---|---|---|
|
|
58
|
+
| `openFilePreview(opts)` | `OpenFilePreviewOptions => FilePreviewHandle` | — | — | 在右侧分栏打开文件 / 文件夹预览,返回可关闭它的句柄。预览内容二选一:`path`(核心解析并渲染)或 `content`(由调用方给内容) | Opens a file/folder preview in the right-side dock and returns a handle to close it. Body is one of two: `path` (resolved and rendered by core) or `content` (rendered from your own node) |
|
|
59
|
+
| `opts.mount` | `HTMLElement` | 是 | — | 页面里的 flex 行;预览靠它占宽而不是浮在页面上方 | The page’s flex row; the preview takes width there instead of floating |
|
|
60
|
+
| `opts.workspaceFiles` | `WorkspaceFilesFace` | — | — | 从 ctx 取出的工作区文件服务;传 `content` 时可省 | Workspace file service taken from ctx; optional when passing `content` |
|
|
61
|
+
| `opts.sessionId` | `string` | — | — | 该工作区的真实会话 id(服务是会话作用域的);传 `content` 时可省 | A real session id of that workspace (the service is session-scoped); optional when passing `content` |
|
|
62
|
+
| `opts.path` | `string` | — | — | 工作区相对路径;绝对路径会自动按最长前缀匹配所属工作区。与 `content` 二选一 | Workspace-relative path; absolute paths are matched to their workspace by longest prefix. Mutually exclusive with `content` |
|
|
63
|
+
| `opts.content` | `() => ReactNode` | — | — | 自定义预览内容,塞进同一个右侧 dock;传它时不需要 `path` | Custom preview body rendered in the same dock; no `path` needed when set |
|
|
64
|
+
| `opts.officeToPdf` | `OfficeToPdfFace` | — | — | Office 转 PDF 能力;缺失则该格式走「不支持」而不是报错 | Office→PDF capability; without it that format shows "unsupported" instead of erroring |
|
|
65
|
+
| `opts.rootName` | `string` | — | — | 兜底显示名(路径匹配不出工作区时用) | Fallback display name, used when no workspace matches the path |
|
|
66
|
+
| `pickWorkspaceFile(opts)` | `PickWorkspaceFileOptions => Promise<PickedFile>` | — | — | 锚定按钮弹出模态选文件,解析出 `{ path, isDir }` | Anchored modal picker that resolves `{ path, isDir }` |
|
|
67
|
+
| `opts.anchor` | `HTMLElement` | 是 | — | 模态贴着它弹 | The modal anchors next to it |
|
|
68
|
+
| `opts.filter` | `PickFilter` | — | — | 按扩展名过滤 `{ exts: ['md'] }`;`dirs: true` 则只允许选文件夹 | Filter by extension `{ exts: ['md'] }`; `dirs: true` restricts picking to folders |
|