@lapismd/design-core 0.1.0 → 0.2.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/CHANGELOG.md +44 -0
- package/LICENSE.md +3 -3
- package/README.md +21 -1
- package/package.json +34 -15
- package/spec/src/styling-and-themes.md +11 -9
- package/src/shared/ai/chat.css +25 -1
- package/src/shared/ai/chat.ts +12 -0
- package/src/shared/ai/composer-input/ComposerInput.svelte +3 -2
- package/src/shared/ai/context.svelte.ts +2 -0
- package/src/shared/ai/experimental/reaction-bar/ReactionBar.svelte +1 -1
- package/src/shared/ai/layout/Layout.svelte +116 -10
- package/src/shared/ai/message-list/MessageList.svelte +123 -43
- package/src/shared/ai/message-list/MessageListHistoryFixture.svelte +112 -0
- package/src/shared/ai/message-list/MessageListLegacyFixture.svelte +52 -0
- package/src/shared/ai/message-list/VirtualizedMessageRows.svelte +299 -0
- package/src/shared/ai/message-list/position.ts +7 -0
- package/src/shared/ai/new-messages.svelte.ts +24 -5
- package/src/shared/ai/stream-scroll.svelte.ts +135 -6
- package/src/shared/ai/tool-call-detail/ToolCallDetail.svelte +71 -0
- package/src/shared/ai/tool-call-detail/tool-call-detail.ts +209 -0
- package/src/shared/ai/tool-calls/ToolCalls.svelte +1 -1
- package/src/shared/ai/trigger-menu.ts +2 -3
- package/src/shared/diff/core/merge/actions.ts +4 -3
- package/src/shared/diff/core/merge/render-model.ts +14 -10
- package/src/shared/diff/file-diff/FileDiff.css +68 -1
- package/src/shared/diff/file-diff/FileDiff.svelte +27 -14
- package/src/shared/diff/file-diff/FileDiffComposer.svelte +98 -16
- package/src/shared/diff/file-diff/index.ts +2 -0
- package/src/shared/diff/file-diff/types.ts +13 -0
- package/src/shared/diff/file-listing/FileListingViewModeToggle.css +42 -5
- package/src/shared/diff/index.ts +2 -0
- package/src/shared/diff/merge-editor/MergeEditor.svelte +2 -7
- package/src/shared/filter/filter-query/filters.ts +2 -2
- package/src/shared/filter/filter-query/parser.ts +9 -8
- package/src/shared/filter/power-search/PowerSearch.svelte +1 -1
- package/src/shared/filter/search-filter-bar/SearchFilterBar.svelte +2 -2
- package/src/shared/filter/search-filter-bar/SearchFilterInput.svelte +1 -1
- package/src/shared/filter/search-filter-bar/SearchFilterPredicateEditor.svelte +1 -1
- package/src/shared/filter/search-filter-bar/search-filter-syntax.ts +1 -1
- package/src/shared/forms/autocomplete-input/AutocompleteInput.svelte +19 -7
- package/src/shared/forms/confirm-button/ConfirmButton.svelte +38 -0
- package/src/shared/forms/confirm-button/ConfirmButtonExample.svelte +14 -0
- package/src/shared/forms/confirm-button/index.ts +1 -0
- package/src/shared/forms/confirm-dialog/ConfirmDialog.css +21 -0
- package/src/shared/forms/confirm-dialog/ConfirmDialog.svelte +116 -0
- package/src/shared/forms/confirm-dialog/ConfirmDialogExample.svelte +17 -0
- package/src/shared/forms/confirm-dialog/index.ts +2 -0
- package/src/shared/forms/dialog-frame/DialogFrame.css +130 -0
- package/src/shared/forms/dialog-frame/DialogFrame.svelte +108 -0
- package/src/shared/forms/dialog-frame/DialogFrameExample.svelte +37 -0
- package/src/shared/forms/dialog-frame/index.ts +6 -0
- package/src/shared/forms/dialog.ts +8 -0
- package/src/shared/forms/index.ts +11 -0
- package/src/shared/shadcn/button/button.svelte +4 -0
- package/src/shared/shadcn/code-block/highlightRanges.ts +10 -6
- package/src/shared/shadcn/code-block/syntax/defineSyntaxTheme.ts +4 -2
- package/src/shared/shadcn/code-block/tokenizer.ts +3 -3
- package/src/shared/shadcn/command/command-dialog.svelte +1 -1
- package/src/shared/shadcn/command/command-group.svelte +3 -1
- package/src/shared/shadcn/command-view/command-view.svelte +1 -6
- package/src/shared/shadcn/dialog/dialog-content.svelte +3 -4
- package/src/shared/shadcn/dialog/dialog-portal.svelte +10 -2
- package/src/shared/shadcn/dropdown-menu/dropdown-menu-checkbox-item.svelte +0 -691
- package/src/shared/shadcn/dropdown-menu/dropdown-menu-content.svelte +691 -0
- package/src/shared/shadcn/dropdown-menu/dropdown-menu-radio-group.svelte +1 -1
- package/src/shared/shadcn/scroll-area/scroll-area.svelte +2 -0
- package/src/shared/shadcn/spinner/spinner.svelte +3 -3
- package/src/shared/shadcn/tooltip/tooltip-content.svelte +10 -4
- package/src/shared/shadcn/tooltip/tooltip.tokens.ts +4 -0
- package/src/shared/shell/app-shell/AppShell.css +112 -32
- package/src/shared/shell/app-shell/AppShell.demo.css +37 -0
- package/src/shared/shell/app-shell/AppShellBodyContent.svelte +5 -1
- package/src/shared/shell/app-shell/AppShellBodySidebar.svelte +5 -1
- package/src/shared/shell/app-shell/AppShellMain.svelte +12 -1
- package/src/shared/shell/app-shell/AppShellMobilePanelSelector.svelte +1 -1
- package/src/shared/shell/app-shell/AppShellRoot.svelte +27 -13
- package/src/shared/shell/app-shell/AppShellSidebar.svelte +121 -19
- package/src/shared/shell/app-shell/AppShellSidebarClose.svelte +17 -17
- package/src/shared/shell/app-shell/AppShellSidebarToggle.svelte +38 -58
- package/src/shared/shell/app-shell/AppShellSurfaceLayer.svelte +173 -0
- package/src/shared/shell/app-shell/AppShellSurfaceLayerBody.svelte +32 -0
- package/src/shared/shell/app-shell/AppShellSurfaceLayerHeader.svelte +26 -0
- package/src/shared/shell/app-shell/app-shell-context.svelte.ts +6 -3
- package/src/shared/shell/app-shell/app-shell-controller.svelte.ts +269 -11
- package/src/shared/shell/app-shell/app-shell-sidebar-context.svelte.ts +1 -0
- package/src/shared/shell/app-shell/examples/AppShellBodyDemo.svelte +4 -0
- package/src/shared/shell/app-shell/examples/AppShellCompleteDemo.svelte +1 -0
- package/src/shared/shell/app-shell/examples/AppShellConversationDemo.svelte +1 -0
- package/src/shared/shell/app-shell/examples/AppShellExamples.css +624 -0
- package/src/shared/shell/app-shell/examples/AppShellFilesSidebarDemo.svelte +1 -0
- package/src/shared/shell/app-shell/examples/AppShellMarkdownDocumentDemo.svelte +6 -1
- package/src/shared/shell/app-shell/examples/AppShellMarkdownFilesDemo.svelte +1 -0
- package/src/shared/shell/app-shell/examples/AppShellModeSwitchDemo.svelte +1 -0
- package/src/shared/shell/app-shell/examples/AppShellMultiPanelDemo.svelte +187 -0
- package/src/shared/shell/app-shell/examples/AppShellProjectSidebarDemo.svelte +1 -0
- package/src/shared/shell/app-shell/examples/AppShellSidebarDemo.svelte +1 -0
- package/src/shared/shell/app-shell/examples/AppShellToolbarDemo.svelte +1 -0
- package/src/shared/shell/app-shell/index.ts +14 -0
- package/src/shared/shell/shell.tokens.css +2 -0
- package/src/shared/shell/shell.tokens.ts +5 -0
- package/src/shared/workspace/menu/WorkspaceContextMenuItems.svelte +2 -1
- package/src/shared/workspace/menu/WorkspaceMenuItems.svelte +2 -1
- package/src/shared/workspace/problems/ProblemsQuickFix.svelte +1 -4
- package/src/shared/workspace/settings/AppSettingsContent.svelte +6 -0
- package/src/shared/workspace/settings/AppSettingsNavigation.svelte +7 -0
- package/src/shared/workspace/settings/CopyableValue.svelte +81 -0
- package/src/shared/workspace/settings/DeclarativeSettingsSection.svelte +20 -0
- package/src/shared/workspace/settings/WorkspaceSettingField.svelte +110 -41
- package/src/shared/workspace/settings/WorkspaceSettingMultiSelect.svelte +7 -6
- package/src/shared/workspace/settings/WorkspaceSettingObjectTable.svelte +187 -23
- package/src/shared/workspace/settings/WorkspaceSettingSelect.svelte +29 -29
- package/src/shared/workspace/settings/WorkspaceSettings.css +190 -4
- package/src/shared/workspace/settings/WorkspaceSettingsStoryCustomField.svelte +2 -2
- package/src/shared/workspace/settings/WorkspaceSettingsStoryCustomPage.svelte +13 -0
- package/src/shared/workspace/settings/WorkspaceSettingsSurface.svelte +50 -0
- package/src/shared/workspace/settings/configuration.ts +5 -0
- package/src/shared/workspace/settings/copyable-value.ts +10 -0
- package/src/shared/workspace/settings/index.ts +5 -0
- package/src/shared/workspace/settings/settings-controller.svelte.ts +349 -15
- package/src/shared/workspace/settings/types.ts +90 -8
- package/src/storybook/app-shell-reference/AppShellTwoExpandedSidebarsReference.css +25 -0
- package/src/storybook/app-shell-reference/AppShellTwoExpandedSidebarsReference.svelte +48 -0
- package/src/storybook/app-shell-reference/index.ts +1 -0
- package/src/theme.css +10 -0
|
@@ -87,34 +87,34 @@
|
|
|
87
87
|
onValueChange={onValueChange as ((next: string[]) => void) | undefined}
|
|
88
88
|
/>
|
|
89
89
|
{:else}
|
|
90
|
-
<SelectRoot
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
>
|
|
97
|
-
<Select.Trigger
|
|
98
|
-
{id}
|
|
99
|
-
role="combobox"
|
|
100
|
-
aria-label={ariaLabel}
|
|
101
|
-
aria-controls={optionsId}
|
|
102
|
-
>
|
|
103
|
-
<span class="ui-workspace-setting-select__value">{triggerContent}</span>
|
|
104
|
-
</Select.Trigger>
|
|
105
|
-
<Select.Content
|
|
106
|
-
id={optionsId}
|
|
107
|
-
aria-label={ariaLabel ? `${ariaLabel} options` : undefined}
|
|
90
|
+
<SelectRoot
|
|
91
|
+
{...rest}
|
|
92
|
+
type="single"
|
|
93
|
+
{disabled}
|
|
94
|
+
bind:value={selectedValue}
|
|
95
|
+
onValueChange={onValueChange as ((next: string) => void) | undefined}
|
|
108
96
|
>
|
|
109
|
-
<Select.
|
|
110
|
-
{
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
97
|
+
<Select.Trigger
|
|
98
|
+
{id}
|
|
99
|
+
role="combobox"
|
|
100
|
+
aria-label={ariaLabel}
|
|
101
|
+
aria-controls={optionsId}
|
|
102
|
+
>
|
|
103
|
+
<span class="ui-workspace-setting-select__value">{triggerContent}</span>
|
|
104
|
+
</Select.Trigger>
|
|
105
|
+
<Select.Content
|
|
106
|
+
id={optionsId}
|
|
107
|
+
aria-label={ariaLabel ? `${ariaLabel} options` : undefined}
|
|
108
|
+
>
|
|
109
|
+
<Select.Group>
|
|
110
|
+
{#each items as item (item.value)}
|
|
111
|
+
<Select.Item
|
|
112
|
+
value={item.value}
|
|
113
|
+
label={item.label}
|
|
114
|
+
disabled={item.disabled}
|
|
115
|
+
/>
|
|
116
|
+
{/each}
|
|
117
|
+
</Select.Group>
|
|
118
|
+
</Select.Content>
|
|
119
|
+
</SelectRoot>
|
|
120
120
|
{/if}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
.ui-workspace-settings {
|
|
2
|
+
position: relative;
|
|
2
3
|
display: flex;
|
|
3
4
|
width: 100%;
|
|
4
5
|
height: 100%;
|
|
@@ -8,6 +9,12 @@
|
|
|
8
9
|
color: var(--ui-workspace-foreground);
|
|
9
10
|
background: var(--ui-workspace-background);
|
|
10
11
|
font-size: 1rem;
|
|
12
|
+
container-name: workspace-settings;
|
|
13
|
+
container-type: inline-size;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.ui-workspace-settings__mobile-toolbar {
|
|
17
|
+
display: none;
|
|
11
18
|
}
|
|
12
19
|
|
|
13
20
|
.ui-workspace-settings__sidebar {
|
|
@@ -667,6 +674,138 @@
|
|
|
667
674
|
text-align: right;
|
|
668
675
|
}
|
|
669
676
|
|
|
677
|
+
.ui-workspace-setting-object-actions {
|
|
678
|
+
display: inline-flex;
|
|
679
|
+
align-items: center;
|
|
680
|
+
justify-content: flex-end;
|
|
681
|
+
gap: 0.2rem;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.ui-workspace-setting-object-code,
|
|
685
|
+
.ui-workspace-setting-object-value,
|
|
686
|
+
.ui-workspace-setting-object-status {
|
|
687
|
+
display: inline-block;
|
|
688
|
+
max-width: 20rem;
|
|
689
|
+
color: var(--ui-workspace-foreground);
|
|
690
|
+
font-size: 0.8125rem;
|
|
691
|
+
overflow-wrap: anywhere;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
.ui-workspace-setting-object-code {
|
|
695
|
+
font-family: var(--ui-font-mono, monospace);
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
.ui-workspace-setting-object-status {
|
|
699
|
+
border-radius: 999px;
|
|
700
|
+
padding: 0.2rem 0.5rem;
|
|
701
|
+
color: var(--ui-workspace-muted-foreground);
|
|
702
|
+
background: var(--ui-workspace-muted);
|
|
703
|
+
font-size: 0.75rem;
|
|
704
|
+
font-weight: 600;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
.ui-workspace-setting-output {
|
|
708
|
+
display: inline-flex;
|
|
709
|
+
min-height: var(--ui-workspace-settings-control-height);
|
|
710
|
+
max-width: 24rem;
|
|
711
|
+
align-items: center;
|
|
712
|
+
color: var(--ui-workspace-foreground);
|
|
713
|
+
font-size: 0.8125rem;
|
|
714
|
+
overflow-wrap: anywhere;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.ui-workspace-setting-output[data-presentation="code"] code {
|
|
718
|
+
font-family: var(--ui-font-mono, monospace);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.ui-workspace-setting-output[data-presentation="status"] {
|
|
722
|
+
min-height: 1.65rem;
|
|
723
|
+
border-radius: 999px;
|
|
724
|
+
padding: 0.2rem 0.55rem;
|
|
725
|
+
color: var(--ui-workspace-muted-foreground);
|
|
726
|
+
background: var(--ui-workspace-muted);
|
|
727
|
+
font-size: 0.75rem;
|
|
728
|
+
font-weight: 600;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
.ui-workspace-setting-action-result,
|
|
732
|
+
.ui-workspace-setting-object-action-result {
|
|
733
|
+
margin: 0;
|
|
734
|
+
color: var(--ui-workspace-muted-foreground);
|
|
735
|
+
font-size: 0.75rem;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
.ui-workspace-setting-action-result[data-tone="success"],
|
|
739
|
+
.ui-workspace-setting-object-action-result[data-tone="success"] {
|
|
740
|
+
color: var(--ui-workspace-success, #15803d);
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
.ui-workspace-setting-action-result[data-tone="warning"],
|
|
744
|
+
.ui-workspace-setting-object-action-result[data-tone="warning"] {
|
|
745
|
+
color: var(--ui-workspace-warning, #a16207);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
.ui-workspace-setting-action-result[data-tone="error"],
|
|
749
|
+
.ui-workspace-setting-object-action-result[data-tone="error"] {
|
|
750
|
+
color: var(--ui-workspace-destructive, #b91c1c);
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
button.ui-workspace-copyable-value[data-ui-component="button"] {
|
|
754
|
+
--ui-button-padding-inline: 0.4rem;
|
|
755
|
+
min-width: 0;
|
|
756
|
+
max-width: 100%;
|
|
757
|
+
height: 1.65rem;
|
|
758
|
+
gap: 0.35rem;
|
|
759
|
+
border: 1px solid transparent;
|
|
760
|
+
border-radius: var(--ui-workspace-settings-control-radius);
|
|
761
|
+
color: inherit;
|
|
762
|
+
background: color-mix(in srgb, currentcolor 7%, transparent);
|
|
763
|
+
font-weight: 500;
|
|
764
|
+
transition:
|
|
765
|
+
background-color 120ms ease,
|
|
766
|
+
border-color 120ms ease,
|
|
767
|
+
box-shadow 120ms ease;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
button.ui-workspace-copyable-value[data-ui-component="button"] code {
|
|
771
|
+
min-width: 0;
|
|
772
|
+
overflow: hidden;
|
|
773
|
+
font: 500 0.75rem/1 var(--ui-font-mono, monospace);
|
|
774
|
+
text-overflow: ellipsis;
|
|
775
|
+
white-space: nowrap;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
button.ui-workspace-copyable-value[data-ui-component="button"]
|
|
779
|
+
[data-ui-component="workspace-icon"] {
|
|
780
|
+
width: 0.75rem;
|
|
781
|
+
height: 0.75rem;
|
|
782
|
+
flex: 0 0 auto;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
button.ui-workspace-copyable-value[data-copy-failed="true"] {
|
|
786
|
+
color: var(--ui-workspace-destructive);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
.ui-workspace-copyable-value__empty {
|
|
790
|
+
color: var(--ui-workspace-muted-foreground);
|
|
791
|
+
font-size: 0.8125rem;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
@media (hover: hover) {
|
|
795
|
+
button.ui-workspace-copyable-value[data-ui-component="button"]:hover {
|
|
796
|
+
border-color: color-mix(in srgb, currentcolor 20%, transparent);
|
|
797
|
+
color: var(--ui-workspace-panel-action-hover-foreground);
|
|
798
|
+
background: var(--ui-workspace-panel-action-hover-background);
|
|
799
|
+
box-shadow: 0 1px 2px color-mix(in srgb, currentcolor 14%, transparent);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
button.ui-workspace-copyable-value[data-ui-component="button"]:focus-visible {
|
|
804
|
+
border-color: color-mix(in srgb, currentcolor 28%, transparent);
|
|
805
|
+
color: var(--ui-workspace-panel-action-hover-foreground);
|
|
806
|
+
background: var(--ui-workspace-panel-action-hover-background);
|
|
807
|
+
}
|
|
808
|
+
|
|
670
809
|
.ui-workspace-setting-unsupported {
|
|
671
810
|
max-width: 22rem;
|
|
672
811
|
}
|
|
@@ -1151,11 +1290,39 @@
|
|
|
1151
1290
|
height: 1rem;
|
|
1152
1291
|
}
|
|
1153
1292
|
|
|
1154
|
-
@
|
|
1293
|
+
@container workspace-settings (max-width: 44rem) {
|
|
1155
1294
|
.ui-workspace-settings__sidebar {
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1295
|
+
display: none;
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
.ui-workspace-settings__mobile-toolbar {
|
|
1299
|
+
position: absolute;
|
|
1300
|
+
z-index: 2;
|
|
1301
|
+
inset: 0 0 auto;
|
|
1302
|
+
display: flex;
|
|
1303
|
+
min-width: 0;
|
|
1304
|
+
flex: 0 0 auto;
|
|
1305
|
+
align-items: center;
|
|
1306
|
+
border-bottom: 1px solid var(--ui-workspace-border);
|
|
1307
|
+
padding: 0.375rem 0.5rem;
|
|
1308
|
+
background: var(--ui-workspace-panel);
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
.ui-workspace-settings__content-inner {
|
|
1312
|
+
padding-top: 3.75rem;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
.ui-workspace-settings__mobile-navigation-trigger {
|
|
1316
|
+
min-width: 0;
|
|
1317
|
+
max-width: 100%;
|
|
1318
|
+
justify-content: flex-start;
|
|
1319
|
+
color: var(--ui-workspace-foreground);
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
.ui-workspace-settings__mobile-navigation-trigger span {
|
|
1323
|
+
overflow: hidden;
|
|
1324
|
+
text-overflow: ellipsis;
|
|
1325
|
+
white-space: nowrap;
|
|
1159
1326
|
}
|
|
1160
1327
|
|
|
1161
1328
|
.ui-workspace-settings__content-inner {
|
|
@@ -1188,3 +1355,22 @@
|
|
|
1188
1355
|
flex-wrap: wrap;
|
|
1189
1356
|
}
|
|
1190
1357
|
}
|
|
1358
|
+
|
|
1359
|
+
.ui-workspace-settings__mobile-sheet {
|
|
1360
|
+
width: min(20rem, calc(100vw - 2rem));
|
|
1361
|
+
max-width: calc(100vw - 2rem);
|
|
1362
|
+
min-height: 0;
|
|
1363
|
+
gap: 0;
|
|
1364
|
+
overflow: hidden;
|
|
1365
|
+
padding: 0;
|
|
1366
|
+
color: var(--ui-workspace-foreground);
|
|
1367
|
+
background: var(--ui-workspace-panel);
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
.ui-workspace-settings__mobile-sheet-body {
|
|
1371
|
+
display: flex;
|
|
1372
|
+
min-height: 0;
|
|
1373
|
+
flex: 1 1 auto;
|
|
1374
|
+
flex-direction: column;
|
|
1375
|
+
padding-top: 2.75rem;
|
|
1376
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Input } from "@lapismd/design-core/shadcn/input";
|
|
3
3
|
import type { WorkspaceCustomSettingProps } from "./types.js";
|
|
4
4
|
|
|
5
|
-
let { id, value, disabled,
|
|
5
|
+
let { id, value, disabled, setValue }: WorkspaceCustomSettingProps = $props();
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<label class="ui-workspace-settings-story-custom">
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
type="text"
|
|
13
13
|
value={String(value ?? "")}
|
|
14
14
|
{disabled}
|
|
15
|
-
oninput={(event) =>
|
|
15
|
+
oninput={(event) => void setValue(event.currentTarget.value)}
|
|
16
16
|
/>
|
|
17
17
|
</label>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { WorkspaceSettingsPageProps } from "./types.js";
|
|
3
|
+
|
|
4
|
+
let { section }: WorkspaceSettingsPageProps = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<section aria-labelledby="custom-settings-page-title">
|
|
8
|
+
<h1 id="custom-settings-page-title">{section.title}</h1>
|
|
9
|
+
<article data-setting-id="community.spellcheck">
|
|
10
|
+
<h2>Spellcheck</h2>
|
|
11
|
+
<p>Check prose while editing.</p>
|
|
12
|
+
</article>
|
|
13
|
+
</section>
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { Button } from "../../shadcn/button/index.js";
|
|
3
|
+
import * as Sheet from "../../shadcn/sheet/index.js";
|
|
2
4
|
import type { AppShellController } from "../core/app-shell-controller.svelte.js";
|
|
5
|
+
import WorkspaceIcon from "../icon/WorkspaceIcon.svelte";
|
|
3
6
|
import type { WorkspaceSettingsController } from "./settings-controller.svelte.js";
|
|
4
7
|
import AppSettingsContent from "./AppSettingsContent.svelte";
|
|
5
8
|
import AppSettingsNavigation from "./AppSettingsNavigation.svelte";
|
|
@@ -13,6 +16,13 @@
|
|
|
13
16
|
controller: WorkspaceSettingsController;
|
|
14
17
|
app?: AppShellController;
|
|
15
18
|
} = $props();
|
|
19
|
+
|
|
20
|
+
let navigationOpen = $state(false);
|
|
21
|
+
let selectedSection = $derived(
|
|
22
|
+
controller.sections.find(
|
|
23
|
+
(section) => section.id === controller.selectedSectionId,
|
|
24
|
+
) ?? controller.sections[0],
|
|
25
|
+
);
|
|
16
26
|
</script>
|
|
17
27
|
|
|
18
28
|
<AppSettingsRoot {controller} {app}>
|
|
@@ -24,5 +34,45 @@
|
|
|
24
34
|
<AppSettingsSearch />
|
|
25
35
|
<AppSettingsNavigation />
|
|
26
36
|
</aside>
|
|
37
|
+
<div
|
|
38
|
+
class="ui-workspace-settings__mobile-toolbar"
|
|
39
|
+
data-ui-part="settings-mobile-toolbar"
|
|
40
|
+
>
|
|
41
|
+
<Sheet.Root bind:open={navigationOpen}>
|
|
42
|
+
<Sheet.Trigger>
|
|
43
|
+
{#snippet child({ props })}
|
|
44
|
+
<Button
|
|
45
|
+
{...props}
|
|
46
|
+
class="ui-workspace-settings__mobile-navigation-trigger"
|
|
47
|
+
variant="ghost"
|
|
48
|
+
size="sm"
|
|
49
|
+
aria-label="Open settings navigation"
|
|
50
|
+
>
|
|
51
|
+
<WorkspaceIcon name="panel-left" data-icon="inline-start" />
|
|
52
|
+
<span>{selectedSection?.title ?? "Settings"}</span>
|
|
53
|
+
</Button>
|
|
54
|
+
{/snippet}
|
|
55
|
+
</Sheet.Trigger>
|
|
56
|
+
<Sheet.Content
|
|
57
|
+
side="left"
|
|
58
|
+
class="ui-workspace-settings__mobile-sheet"
|
|
59
|
+
aria-label="Settings navigation"
|
|
60
|
+
>
|
|
61
|
+
<Sheet.Header class="sr-only">
|
|
62
|
+
<Sheet.Title>Settings navigation</Sheet.Title>
|
|
63
|
+
<Sheet.Description>
|
|
64
|
+
Search settings and choose a settings section.
|
|
65
|
+
</Sheet.Description>
|
|
66
|
+
</Sheet.Header>
|
|
67
|
+
<div
|
|
68
|
+
class="ui-workspace-settings__mobile-sheet-body"
|
|
69
|
+
data-ui-part="settings-mobile-sheet-body"
|
|
70
|
+
>
|
|
71
|
+
<AppSettingsSearch />
|
|
72
|
+
<AppSettingsNavigation onselect={() => (navigationOpen = false)} />
|
|
73
|
+
</div>
|
|
74
|
+
</Sheet.Content>
|
|
75
|
+
</Sheet.Root>
|
|
76
|
+
</div>
|
|
27
77
|
<AppSettingsContent />
|
|
28
78
|
</AppSettingsRoot>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { WorkspaceSettingsController } from "./settings-controller.svelte.js";
|
|
2
2
|
import type {
|
|
3
3
|
WorkspaceSettingOption,
|
|
4
|
+
WorkspaceSettingsDefinition,
|
|
4
5
|
WorkspaceSettingsNavigationGroup,
|
|
5
6
|
WorkspaceSettingsSection,
|
|
6
7
|
} from "./types.js";
|
|
@@ -72,6 +73,10 @@ export class ConfigurationSchema {
|
|
|
72
73
|
return this.register(section);
|
|
73
74
|
}
|
|
74
75
|
|
|
76
|
+
registerDefinition(definition: WorkspaceSettingsDefinition): () => void {
|
|
77
|
+
return this.settings.registerDefinition(definition);
|
|
78
|
+
}
|
|
79
|
+
|
|
75
80
|
registerNavigationGroup(group: WorkspaceSettingsNavigationGroup): () => void {
|
|
76
81
|
return this.settings.registerNavigationGroup(group);
|
|
77
82
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function shortenCopyableValue(
|
|
2
|
+
value: string,
|
|
3
|
+
leadingCharacters = 8,
|
|
4
|
+
trailingCharacters = 4,
|
|
5
|
+
): string {
|
|
6
|
+
const leading = Math.max(1, Math.floor(leadingCharacters));
|
|
7
|
+
const trailing = Math.max(0, Math.floor(trailingCharacters));
|
|
8
|
+
if (value.length <= leading + trailing + 1) return value;
|
|
9
|
+
return `${value.slice(0, leading)}…${trailing ? value.slice(-trailing) : ""}`;
|
|
10
|
+
}
|
|
@@ -5,11 +5,14 @@ import AppSettingsSearch from "./AppSettingsSearch.svelte";
|
|
|
5
5
|
import AppSettingsSection from "./AppSettingsSection.svelte";
|
|
6
6
|
import AppShellHotkeySettings from "./AppShellHotkeySettings.svelte";
|
|
7
7
|
import AppShellPluginsSettings from "./AppShellPluginsSettings.svelte";
|
|
8
|
+
import CopyableValue from "./CopyableValue.svelte";
|
|
9
|
+
import DeclarativeSettingsSection from "./DeclarativeSettingsSection.svelte";
|
|
8
10
|
import WorkspaceSettingField from "./WorkspaceSettingField.svelte";
|
|
9
11
|
import WorkspaceSettingList from "./WorkspaceSettingList.svelte";
|
|
10
12
|
import WorkspaceSettingsSurface from "./WorkspaceSettingsSurface.svelte";
|
|
11
13
|
|
|
12
14
|
export * from "./configuration.js";
|
|
15
|
+
export * from "./copyable-value.js";
|
|
13
16
|
export * from "./persistence.js";
|
|
14
17
|
export * from "./settings-controller.svelte.js";
|
|
15
18
|
export * from "./types.js";
|
|
@@ -22,6 +25,8 @@ export {
|
|
|
22
25
|
AppSettingsSection,
|
|
23
26
|
AppShellHotkeySettings,
|
|
24
27
|
AppShellPluginsSettings,
|
|
28
|
+
CopyableValue,
|
|
29
|
+
DeclarativeSettingsSection,
|
|
25
30
|
WorkspaceSettingField,
|
|
26
31
|
WorkspaceSettingList,
|
|
27
32
|
WorkspaceSettingsSurface,
|