@ecsplico/editor 3.1.1 → 3.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 +35 -0
- package/dist/adapters/direct-ai.d.ts +36 -0
- package/dist/adapters/direct-ai.js +169 -0
- package/dist/adapters/direct-ai.js.map +1 -0
- package/dist/adapters/memory.js.map +1 -1
- package/dist/code/CodeSurface.vue.d.ts +2 -2
- package/dist/core/block-drag.js +3 -0
- package/dist/core/block-drag.js.map +1 -1
- package/dist/core/block-transfer.d.ts +44 -0
- package/dist/core/block-transfer.js +68 -0
- package/dist/core/block-transfer.js.map +1 -0
- package/dist/core/commands.js +5 -0
- package/dist/core/commands.js.map +1 -1
- package/dist/core/core-feature.d.ts +4 -1
- package/dist/core/core-feature.js +8 -3
- package/dist/core/core-feature.js.map +1 -1
- package/dist/core/editor-ui.d.ts +3 -1
- package/dist/core/editor-ui.js.map +1 -1
- package/dist/core/extension-points.d.ts +17 -1
- package/dist/core/feature.d.ts +6 -1
- package/dist/core/feature.js.map +1 -1
- package/dist/core/index.d.ts +4 -2
- package/dist/core/index.js +3 -2
- package/dist/core/schema/index.d.ts +24 -3
- package/dist/core/schema/index.js +21 -4
- package/dist/core/schema/index.js.map +1 -1
- package/dist/core/surface-session.js +3 -1
- package/dist/core/surface-session.js.map +1 -1
- package/dist/core/toolbar-items.js +1 -1
- package/dist/core/toolbar-items.js.map +1 -1
- package/dist/document/DocumentSurface.vue.d.ts +2 -2
- package/dist/features/ai/agent-op-review.js +1 -1
- package/dist/features/ai/agent-ops.js +2 -2
- package/dist/features/ai/ai-apply.js +1 -1
- package/dist/features/ai/assistant.js +1 -1
- package/dist/features/ai/components/AiSelectionMenu.js +2 -2
- package/dist/features/ai/components/AiSidebar.js +2 -2
- package/dist/features/ai/components/SettingsAiTab.js +1 -1
- package/dist/features/ai/components/SettingsModelProfiles.js +1 -1
- package/dist/features/ai/document-chat-model.js +1 -1
- package/dist/features/ai/document-chat.js +2 -2
- package/dist/features/ai/ghost-autocomplete.js +1 -1
- package/dist/features/ai/index.d.ts +4 -3
- package/dist/features/ai/index.js +6 -5
- package/dist/features/ai/protocol/complete.d.ts +19 -0
- package/dist/features/ai/protocol/complete.js +27 -1
- package/dist/features/ai/protocol/complete.js.map +1 -1
- package/dist/features/ai/protocol/generate.d.ts +95 -0
- package/dist/features/ai/protocol/generate.js +58 -0
- package/dist/features/ai/protocol/generate.js.map +1 -0
- package/dist/features/ai/protocol/index.d.ts +4 -3
- package/dist/features/ai/protocol/index.js +6 -5
- package/dist/features/ai/protocol/tasks.d.ts +3 -1
- package/dist/features/ai/protocol/tasks.js +74 -2
- package/dist/features/ai/protocol/tasks.js.map +1 -1
- package/dist/features/ai/react/AiSelectionMenu.js +2 -2
- package/dist/features/ai/react/AiSidebar.js +2 -2
- package/dist/features/ai/react/SettingsAiTab.js +1 -1
- package/dist/features/ai/react/SettingsModelProfiles.js +1 -1
- package/dist/features/ai/selection-flow.js +1 -1
- package/dist/features/ai/sidebar-flow.js +1 -1
- package/dist/features/block-ui/block-actions.d.ts +19 -3
- package/dist/features/block-ui/block-actions.js +49 -3
- package/dist/features/block-ui/block-actions.js.map +1 -1
- package/dist/features/block-ui/components/BlockActionsOverlay.js +24 -13
- package/dist/features/block-ui/components/BlockActionsOverlay.js.map +1 -1
- package/dist/features/block-ui/components/BlockActionsOverlay.vue.d.ts +12 -5
- package/dist/features/block-ui/components/BlockUi.js +52 -20
- package/dist/features/block-ui/components/BlockUi.js.map +1 -1
- package/dist/features/block-ui/components/BlockUi.vue.d.ts +6 -4
- package/dist/features/block-ui/feature.d.ts +8 -2
- package/dist/features/block-ui/feature.js +7 -2
- package/dist/features/block-ui/feature.js.map +1 -1
- package/dist/features/block-ui/index.d.ts +3 -2
- package/dist/features/block-ui/index.js +2 -2
- package/dist/features/block-ui/react/BlockActionsOverlay.d.ts +14 -7
- package/dist/features/block-ui/react/BlockActionsOverlay.js +25 -13
- package/dist/features/block-ui/react/BlockActionsOverlay.js.map +1 -1
- package/dist/features/block-ui/react/BlockUi.d.ts +6 -4
- package/dist/features/block-ui/react/BlockUi.js +43 -15
- package/dist/features/block-ui/react/BlockUi.js.map +1 -1
- package/dist/features/block-ui/react.d.ts +4 -2
- package/dist/features/block-ui/react.js +3 -3
- package/dist/features/block-ui/react.js.map +1 -1
- package/dist/features/block-ui/vue.d.ts +4 -2
- package/dist/features/block-ui/vue.js +3 -3
- package/dist/features/block-ui/vue.js.map +1 -1
- package/dist/features/composites/baskets.d.ts +27 -0
- package/dist/features/composites/baskets.js +46 -0
- package/dist/features/composites/baskets.js.map +1 -0
- package/dist/features/composites/components/CompositeBasketMenu.js +97 -0
- package/dist/features/composites/components/CompositeBasketMenu.js.map +1 -0
- package/dist/features/composites/components/CompositeChrome.js +79 -23
- package/dist/features/composites/components/CompositeChrome.js.map +1 -1
- package/dist/features/composites/components/CompositeView.js +17 -2
- package/dist/features/composites/components/CompositeView.js.map +1 -1
- package/dist/features/composites/components/DerivationBadge.js +12 -3
- package/dist/features/composites/components/DerivationBadge.js.map +1 -1
- package/dist/features/composites/components/FocusChip.js +53 -0
- package/dist/features/composites/components/FocusChip.js.map +1 -0
- package/dist/features/composites/components/FocusChip.vue.d.ts +14 -0
- package/dist/features/composites/components/SettingsEditingTab.js +40 -4
- package/dist/features/composites/components/SettingsEditingTab.js.map +1 -1
- package/dist/features/composites/derivation.d.ts +2 -1
- package/dist/features/composites/derivation.js +5 -1
- package/dist/features/composites/derivation.js.map +1 -1
- package/dist/features/composites/derived-chrome.js +13 -3
- package/dist/features/composites/derived-chrome.js.map +1 -1
- package/dist/features/composites/feature.d.ts +7 -1
- package/dist/features/composites/feature.js +96 -23
- package/dist/features/composites/feature.js.map +1 -1
- package/dist/features/composites/focus.d.ts +38 -0
- package/dist/features/composites/focus.js +86 -0
- package/dist/features/composites/focus.js.map +1 -0
- package/dist/features/composites/index.d.ts +6 -3
- package/dist/features/composites/index.js +6 -3
- package/dist/features/composites/meta-keys.d.ts +4 -0
- package/dist/features/composites/meta-keys.js +8 -4
- package/dist/features/composites/meta-keys.js.map +1 -1
- package/dist/features/composites/nodes.d.ts +14 -2
- package/dist/features/composites/nodes.js +61 -5
- package/dist/features/composites/nodes.js.map +1 -1
- package/dist/features/composites/outline.d.ts +4 -0
- package/dist/features/composites/outline.js +3 -0
- package/dist/features/composites/outline.js.map +1 -1
- package/dist/features/composites/react/CompositeBasketMenu.js +88 -0
- package/dist/features/composites/react/CompositeBasketMenu.js.map +1 -0
- package/dist/features/composites/react/CompositeChrome.js +52 -4
- package/dist/features/composites/react/CompositeChrome.js.map +1 -1
- package/dist/features/composites/react/CompositeView.js +12 -2
- package/dist/features/composites/react/CompositeView.js.map +1 -1
- package/dist/features/composites/react/DerivationBadge.js +10 -1
- package/dist/features/composites/react/DerivationBadge.js.map +1 -1
- package/dist/features/composites/react/FocusChip.d.ts +11 -0
- package/dist/features/composites/react/FocusChip.js +50 -0
- package/dist/features/composites/react/FocusChip.js.map +1 -0
- package/dist/features/composites/react/SettingsEditingTab.js +36 -1
- package/dist/features/composites/react/SettingsEditingTab.js.map +1 -1
- package/dist/features/composites/react.d.ts +2 -1
- package/dist/features/composites/react.js +3 -1
- package/dist/features/composites/react.js.map +1 -1
- package/dist/features/composites/schema.d.ts +5 -3
- package/dist/features/composites/schema.js +8 -4
- package/dist/features/composites/schema.js.map +1 -1
- package/dist/features/composites/split.d.ts +62 -0
- package/dist/features/composites/split.js +172 -0
- package/dist/features/composites/split.js.map +1 -0
- package/dist/features/composites/vue.d.ts +4 -3
- package/dist/features/composites/vue.js +7 -5
- package/dist/features/composites/vue.js.map +1 -1
- package/dist/features/transfer/components/TransferMenu.js +93 -0
- package/dist/features/transfer/components/TransferMenu.js.map +1 -0
- package/dist/features/transfer/components/TransferMenu.vue.d.ts +15 -0
- package/dist/features/transfer/feature.d.ts +76 -0
- package/dist/features/transfer/feature.js +169 -0
- package/dist/features/transfer/feature.js.map +1 -0
- package/dist/features/transfer/index.d.ts +3 -0
- package/dist/features/transfer/index.js +3 -0
- package/dist/features/transfer/react/TransferMenu.d.ts +12 -0
- package/dist/features/transfer/react/TransferMenu.js +71 -0
- package/dist/features/transfer/react/TransferMenu.js.map +1 -0
- package/dist/features/transfer/react.d.ts +10 -0
- package/dist/features/transfer/react.js +11 -0
- package/dist/features/transfer/react.js.map +1 -0
- package/dist/features/transfer/transforms.d.ts +83 -0
- package/dist/features/transfer/transforms.js +137 -0
- package/dist/features/transfer/transforms.js.map +1 -0
- package/dist/features/transfer/vue.d.ts +9 -0
- package/dist/features/transfer/vue.js +11 -0
- package/dist/features/transfer/vue.js.map +1 -0
- package/dist/i18n/de/ai.js +4 -0
- package/dist/i18n/de/ai.js.map +1 -1
- package/dist/i18n/de/composites.js +20 -1
- package/dist/i18n/de/composites.js.map +1 -1
- package/dist/i18n/de/integrations.js +16 -0
- package/dist/i18n/de/integrations.js.map +1 -1
- package/dist/i18n/de/transfer.js +17 -0
- package/dist/i18n/de/transfer.js.map +1 -0
- package/dist/i18n/de/tree.js +6 -0
- package/dist/i18n/de/tree.js.map +1 -1
- package/dist/i18n/de.d.ts +55 -0
- package/dist/i18n/de.js +3 -1
- package/dist/i18n/de.js.map +1 -1
- package/dist/i18n/en/ai.js +4 -0
- package/dist/i18n/en/ai.js.map +1 -1
- package/dist/i18n/en/composites.js +20 -1
- package/dist/i18n/en/composites.js.map +1 -1
- package/dist/i18n/en/integrations.js +16 -0
- package/dist/i18n/en/integrations.js.map +1 -1
- package/dist/i18n/en/transfer.js +17 -0
- package/dist/i18n/en/transfer.js.map +1 -0
- package/dist/i18n/en/tree.js +6 -0
- package/dist/i18n/en/tree.js.map +1 -1
- package/dist/i18n/en.js +3 -1
- package/dist/i18n/en.js.map +1 -1
- package/dist/integrations/composite-ai/composite-fill.js +1 -1
- package/dist/integrations/composite-ai/composite-summary.js +1 -1
- package/dist/integrations/composite-ai/derive.d.ts +21 -0
- package/dist/integrations/composite-ai/derive.js +69 -47
- package/dist/integrations/composite-ai/derive.js.map +1 -1
- package/dist/integrations/composite-ai/index.d.ts +8 -3
- package/dist/integrations/composite-ai/index.js +50 -4
- package/dist/integrations/composite-ai/index.js.map +1 -1
- package/dist/integrations/composite-ai/outline-sanitize.d.ts +48 -0
- package/dist/integrations/composite-ai/outline-sanitize.js +175 -0
- package/dist/integrations/composite-ai/outline-sanitize.js.map +1 -0
- package/dist/integrations/composite-ai/split.d.ts +44 -0
- package/dist/integrations/composite-ai/split.js +187 -0
- package/dist/integrations/composite-ai/split.js.map +1 -0
- package/dist/integrations/composite-ai/transfer-transforms.d.ts +27 -0
- package/dist/integrations/composite-ai/transfer-transforms.js +153 -0
- package/dist/integrations/composite-ai/transfer-transforms.js.map +1 -0
- package/dist/integrations/transcript-ai/protocol.d.ts +13 -0
- package/dist/integrations/transcript-ai/protocol.js +49 -1
- package/dist/integrations/transcript-ai/protocol.js.map +1 -1
- package/dist/integrations/transcript-ai/transcript-cleanup.js +1 -1
- package/dist/markdown/MarkdownSurface.vue.d.ts +6 -6
- package/dist/nuxt/module.d.ts +110 -0
- package/dist/presets/compose.d.ts +24 -8
- package/dist/presets/compose.js +117 -58
- package/dist/presets/compose.js.map +1 -1
- package/dist/react/compose.js +5 -1
- package/dist/react/compose.js.map +1 -1
- package/dist/react/composed-surface.d.ts +9 -0
- package/dist/react/composed-surface.js +4 -1
- package/dist/react/composed-surface.js.map +1 -1
- package/dist/server/ai.d.ts +2 -5
- package/dist/server/ai.js.map +1 -1
- package/dist/server/handlers/ai.d.ts +7 -78
- package/dist/server/handlers/ai.js +30 -94
- package/dist/server/handlers/ai.js.map +1 -1
- package/dist/server/handlers/editor.d.ts +1 -0
- package/dist/server/handlers/index.d.ts +3 -1
- package/dist/server/handlers/index.js +3 -1
- package/dist/server/index.d.ts +2 -1
- package/dist/settings/index.d.ts +8 -0
- package/dist/settings/index.js +16 -4
- package/dist/settings/index.js.map +1 -1
- package/dist/styles/composites.css +32 -0
- package/dist/tree/DocumentTree.js +229 -78
- package/dist/tree/DocumentTree.js.map +1 -1
- package/dist/tree/drop-rules.js +8 -0
- package/dist/tree/drop-rules.js.map +1 -1
- package/dist/tree/react/DocumentTree.js +152 -31
- package/dist/tree/react/DocumentTree.js.map +1 -1
- package/dist/tree/tree-host.js +31 -2
- package/dist/tree/tree-host.js.map +1 -1
- package/dist/tree/tree-items.js +52 -5
- package/dist/tree/tree-items.js.map +1 -1
- package/dist/tree/tree-model.js +113 -10
- package/dist/tree/tree-model.js.map +1 -1
- package/dist/tree/tree-rows.js +20 -7
- package/dist/tree/tree-rows.js.map +1 -1
- package/dist/tree/tree-view-model.d.ts +5 -0
- package/dist/tree/tree-view-model.js +13 -0
- package/dist/tree/tree-view-model.js.map +1 -1
- package/dist/vue/AdvancedEditor.js +6 -0
- package/dist/vue/AdvancedEditor.js.map +1 -1
- package/dist/vue/AdvancedEditor.vue.d.ts +13 -5
- package/dist/vue/SimpleEditor.vue.d.ts +4 -4
- package/dist/vue/components/EditorSurface.vue.d.ts +4 -4
- package/dist/vue/compose.js +5 -1
- package/dist/vue/compose.js.map +1 -1
- package/package.json +21 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { generateBodySchema } from "../../features/ai/protocol/generate.js";
|
|
2
|
+
import { completeBodySchema } from "../../features/ai/protocol/complete.js";
|
|
1
3
|
import { AiHandlerContext, HandlerContext, HandlerRequest, HandlerResponse, authenticated, empty, enforceRateLimit, eventStream, json, port, readBody, text } from "./context.js";
|
|
2
|
-
import { chatBodySchema, chatPost,
|
|
4
|
+
import { chatBodySchema, chatPost, completePost, extractBodySchema, extractPost, generatePost, modelsGet, transcriptCleanupBodySchema, transcriptCleanupPost } from "./ai.js";
|
|
3
5
|
import { assetGet, assetPost, capabilitiesGet, listWorkspaceTags, settingsGet, settingsPut, settingsPutBodySchema, tagsGet, themeDelete, themeGet, themePost, themesGet, usersGet } from "./editor.js";
|
|
4
6
|
export { type AiHandlerContext, type HandlerContext, type HandlerRequest, type HandlerResponse, assetGet, assetPost, authenticated, capabilitiesGet, chatBodySchema, chatPost, completeBodySchema, completePost, empty, enforceRateLimit, eventStream, extractBodySchema, extractPost, generateBodySchema, generatePost, json, listWorkspaceTags, modelsGet, port, readBody, settingsGet, settingsPut, settingsPutBodySchema, tagsGet, text, themeDelete, themeGet, themePost, themesGet, transcriptCleanupBodySchema, transcriptCleanupPost, usersGet };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { completeBodySchema } from "../../features/ai/protocol/complete.js";
|
|
2
|
+
import { generateBodySchema } from "../../features/ai/protocol/generate.js";
|
|
1
3
|
import { authenticated, empty, enforceRateLimit, eventStream, json, port, readBody, text } from "./context.js";
|
|
2
|
-
import { chatBodySchema, chatPost,
|
|
4
|
+
import { chatBodySchema, chatPost, completePost, extractBodySchema, extractPost, generatePost, modelsGet, transcriptCleanupBodySchema, transcriptCleanupPost } from "./ai.js";
|
|
3
5
|
import { assetGet, assetPost, capabilitiesGet, listWorkspaceTags, settingsGet, settingsPut, settingsPutBodySchema, tagsGet, themeDelete, themeGet, themePost, themesGet, usersGet } from "./editor.js";
|
|
4
6
|
export { assetGet, assetPost, authenticated, capabilitiesGet, chatBodySchema, chatPost, completeBodySchema, completePost, empty, enforceRateLimit, eventStream, extractBodySchema, extractPost, generateBodySchema, generatePost, json, listWorkspaceTags, modelsGet, port, readBody, settingsGet, settingsPut, settingsPutBodySchema, tagsGet, text, themeDelete, themeGet, themePost, themesGet, transcriptCleanupBodySchema, transcriptCleanupPost, usersGet };
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { PresetConfig, TranscriptionConfig } from "../config/index.js";
|
|
2
2
|
import { AuthenticateRequest } from "./auth.js";
|
|
3
|
+
import { ChatMessage } from "../features/ai/protocol/generate.js";
|
|
3
4
|
import { HttpError } from "./errors.js";
|
|
4
|
-
import { AiModels, AiModelsConfig,
|
|
5
|
+
import { AiModels, AiModelsConfig, ChatTurnPart, createAiModels, streamChat, streamChatTurn, upstreamError } from "./ai.js";
|
|
5
6
|
import { AssetStore, CollabStateStore, Directory, DocumentAdmin, DocumentStore, EditorPorts, Identity, ModelProvider, PORT_CAPABILITY, SettingsStore, ThemeStore, serverCapabilities } from "./ports.js";
|
|
6
7
|
import { COLLAB_FIELD, CollabConnection, CollabServer, CollabServerOptions, WebSocketLike, createCollabServer } from "./collab.js";
|
|
7
8
|
import { decodeCollabState, encodeCollabState, isStateStale } from "./collab-state.js";
|
package/dist/settings/index.d.ts
CHANGED
|
@@ -36,12 +36,19 @@ export interface EditorSettings {
|
|
|
36
36
|
kindIcon: KindIconVisibility;
|
|
37
37
|
/** Standard drag handle of blocks without kind icon: on the hovered block, or permanently beside every block. */
|
|
38
38
|
dragHandle: DragHandleVisibility;
|
|
39
|
+
/** Target size in characters of the parts a length split cuts a Baustein into (200–20000). */
|
|
40
|
+
splitTargetChars: number;
|
|
39
41
|
};
|
|
40
42
|
appearance: {
|
|
41
43
|
/** Id of the Obsidian theme applied to the whole app (themes feature); `null` = the standard Nuxt UI look. */
|
|
42
44
|
theme: string | null;
|
|
43
45
|
};
|
|
44
46
|
}
|
|
47
|
+
/** Bounds of `blocks.splitTargetChars`. */
|
|
48
|
+
export declare const SPLIT_TARGET_CHARS_MIN = 200;
|
|
49
|
+
export declare const SPLIT_TARGET_CHARS_MAX = 20000;
|
|
50
|
+
/** The split target typed into the field as a valid setting: rounded and clamped to its bounds; `current` when `typed` is empty or not a number. */
|
|
51
|
+
export declare function clampSplitTargetChars(typed: string, current: number): number;
|
|
45
52
|
export declare const EDITOR_SETTINGS_DEFAULTS: EditorSettings;
|
|
46
53
|
/** Complete, valid settings (the body of `PUT /api/editor/settings`). */
|
|
47
54
|
export declare const editorSettingsSchema: z.ZodObject<{
|
|
@@ -95,6 +102,7 @@ export declare const editorSettingsSchema: z.ZodObject<{
|
|
|
95
102
|
always: "always";
|
|
96
103
|
hover: "hover";
|
|
97
104
|
}>;
|
|
105
|
+
splitTargetChars: z.ZodNumber;
|
|
98
106
|
}, z.core.$strip>;
|
|
99
107
|
appearance: z.ZodObject<{
|
|
100
108
|
theme: z.ZodNullable<z.ZodString>;
|
package/dist/settings/index.js
CHANGED
|
@@ -4,6 +4,14 @@ import { z } from "zod";
|
|
|
4
4
|
const EDITOR_SETTINGS_VERSION = 1;
|
|
5
5
|
/** Valid theme id: lowercase slug, used as directory name and in `/api/editor/themes/:id`. Defined here so core never imports a feature. */
|
|
6
6
|
const THEME_ID = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
7
|
+
/** Bounds of `blocks.splitTargetChars`. */
|
|
8
|
+
const SPLIT_TARGET_CHARS_MIN = 200;
|
|
9
|
+
const SPLIT_TARGET_CHARS_MAX = 2e4;
|
|
10
|
+
/** The split target typed into the field as a valid setting: rounded and clamped to its bounds; `current` when `typed` is empty or not a number. */
|
|
11
|
+
function clampSplitTargetChars(typed, current) {
|
|
12
|
+
const value = Math.round(Number(typed));
|
|
13
|
+
return typed.trim() !== "" && Number.isFinite(value) ? Math.min(SPLIT_TARGET_CHARS_MAX, Math.max(200, value)) : current;
|
|
14
|
+
}
|
|
7
15
|
const EDITOR_SETTINGS_DEFAULTS = {
|
|
8
16
|
version: 1,
|
|
9
17
|
editing: {
|
|
@@ -22,7 +30,8 @@ const EDITOR_SETTINGS_DEFAULTS = {
|
|
|
22
30
|
structure: "composite",
|
|
23
31
|
treeRoot: "folders",
|
|
24
32
|
kindIcon: "always",
|
|
25
|
-
dragHandle: "hover"
|
|
33
|
+
dragHandle: "hover",
|
|
34
|
+
splitTargetChars: 1500
|
|
26
35
|
},
|
|
27
36
|
appearance: { theme: null }
|
|
28
37
|
};
|
|
@@ -38,6 +47,7 @@ const structureSchema = z.enum(STRUCTURE_MODES);
|
|
|
38
47
|
const treeRootSchema = z.enum(TREE_ROOTS);
|
|
39
48
|
const kindIconSchema = z.enum(KIND_ICON_VISIBILITIES);
|
|
40
49
|
const dragHandleSchema = z.enum(DRAG_HANDLE_VISIBILITIES);
|
|
50
|
+
const splitTargetCharsSchema = z.number().int().min(200).max(SPLIT_TARGET_CHARS_MAX);
|
|
41
51
|
const themeSchema = z.string().regex(THEME_ID).nullable();
|
|
42
52
|
/** Complete, valid settings (the body of `PUT /api/editor/settings`). */
|
|
43
53
|
const editorSettingsSchema = z.object({
|
|
@@ -58,7 +68,8 @@ const editorSettingsSchema = z.object({
|
|
|
58
68
|
structure: structureSchema,
|
|
59
69
|
treeRoot: treeRootSchema,
|
|
60
70
|
kindIcon: kindIconSchema,
|
|
61
|
-
dragHandle: dragHandleSchema
|
|
71
|
+
dragHandle: dragHandleSchema,
|
|
72
|
+
splitTargetChars: splitTargetCharsSchema
|
|
62
73
|
}),
|
|
63
74
|
appearance: z.object({ theme: themeSchema })
|
|
64
75
|
});
|
|
@@ -103,12 +114,13 @@ function parseEditorSettings(input) {
|
|
|
103
114
|
structure: valid(structureSchema, blocks.structure, defaults.blocks.structure),
|
|
104
115
|
treeRoot: valid(treeRootSchema, blocks.treeRoot, defaults.blocks.treeRoot),
|
|
105
116
|
kindIcon: valid(kindIconSchema, blocks.kindIcon, defaults.blocks.kindIcon),
|
|
106
|
-
dragHandle: valid(dragHandleSchema, blocks.dragHandle, defaults.blocks.dragHandle)
|
|
117
|
+
dragHandle: valid(dragHandleSchema, blocks.dragHandle, defaults.blocks.dragHandle),
|
|
118
|
+
splitTargetChars: valid(splitTargetCharsSchema, blocks.splitTargetChars, defaults.blocks.splitTargetChars)
|
|
107
119
|
},
|
|
108
120
|
appearance: { theme: valid(themeSchema, appearance.theme, defaults.appearance.theme) }
|
|
109
121
|
};
|
|
110
122
|
}
|
|
111
123
|
//#endregion
|
|
112
|
-
export { AI_LANGUAGES, AUTHOR_COLOR_STYLES, COMMENTS_LAYOUTS, DRAG_HANDLE_VISIBILITIES, EDITOR_SETTINGS_DEFAULTS, EDITOR_SETTINGS_VERSION, HEADING_CONVERSION_SCOPES, KIND_ICON_VISIBILITIES, MODEL_SLOTS, STRUCTURE_MODES, THEME_ID, TREE_ROOTS, editorSettingsSchema, parseEditorSettings };
|
|
124
|
+
export { AI_LANGUAGES, AUTHOR_COLOR_STYLES, COMMENTS_LAYOUTS, DRAG_HANDLE_VISIBILITIES, EDITOR_SETTINGS_DEFAULTS, EDITOR_SETTINGS_VERSION, HEADING_CONVERSION_SCOPES, KIND_ICON_VISIBILITIES, MODEL_SLOTS, SPLIT_TARGET_CHARS_MAX, SPLIT_TARGET_CHARS_MIN, STRUCTURE_MODES, THEME_ID, TREE_ROOTS, clampSplitTargetChars, editorSettingsSchema, parseEditorSettings };
|
|
113
125
|
|
|
114
126
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/settings/index.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n AI_LANGUAGES,\n type AiLanguage,\n AUTHOR_COLOR_STYLES,\n type AuthorColorStyle,\n COMMENTS_LAYOUTS,\n type CommentsLayout,\n DRAG_HANDLE_VISIBILITIES,\n type DragHandleVisibility,\n HEADING_CONVERSION_SCOPES,\n type HeadingConversionScope,\n KIND_ICON_VISIBILITIES,\n type KindIconVisibility,\n MODEL_SLOTS,\n type ModelSlot,\n STRUCTURE_MODES,\n type StructureMode,\n TREE_ROOTS,\n type TreeRoot,\n} from './values'\n\nexport * from './values'\n\nexport const EDITOR_SETTINGS_VERSION = 1\n\n/** Valid theme id: lowercase slug, used as directory name and in `/api/editor/themes/:id`. Defined here so core never imports a feature. */\nexport const THEME_ID = /^[a-z0-9][a-z0-9-]{0,63}$/\n\n/** A user's editor preferences, shared by all editors on the page; persisted per user through the `settings` port. */\nexport interface EditorSettings {\n version: typeof EDITOR_SETTINGS_VERSION\n editing: {\n /** Blocks „Gliederung umwandeln“ (both directions) converts when nothing is selected. */\n headingConversionScope: HeadingConversionScope\n /** Text is tinted per author (authors feature): each run in the colour of the user who wrote it. */\n authorColors: boolean\n /** `background`: tinted background; `text`: text in the author's colour. */\n authorColorStyle: AuthorColorStyle\n /** `margin`: comment cards in a column beside the text; `inline`: popover at the text plus the toolbar's list (comments feature). */\n commentsLayout: CommentsLayout\n }\n ai: {\n /** Ghost-text suggestions while typing (`GhostAutocomplete`). */\n autocomplete: boolean\n /** Model profile id per slot; a missing or unknown id falls back to the server's default preset for the slot. */\n slots: Partial<Record<ModelSlot, string>>\n /** Preselected target language of „Übersetzen“. */\n translateLanguage: AiLanguage\n }\n blocks: {\n /** Composite kind id the „Baustein“ shortcuts create (toolbar button, heading conversion). */\n defaultKind: string\n /** Preferred document structure: toolbar block types and the structure of AI-generated blocks. */\n structure: StructureMode\n /** Root of the document drawer while a composite file is loaded: nested in the folders, or the file itself. */\n treeRoot: TreeRoot\n /** Kind icon of composites (their drag handle): always visible, or only on hover, focus or while the details are open. */\n kindIcon: KindIconVisibility\n /** Standard drag handle of blocks without kind icon: on the hovered block, or permanently beside every block. */\n dragHandle: DragHandleVisibility\n }\n appearance: {\n /** Id of the Obsidian theme applied to the whole app (themes feature); `null` = the standard Nuxt UI look. */\n theme: string | null\n }\n}\n\nexport const EDITOR_SETTINGS_DEFAULTS: EditorSettings = {\n version: EDITOR_SETTINGS_VERSION,\n editing: { headingConversionScope: 'container', authorColors: false, authorColorStyle: 'background', commentsLayout: 'margin' },\n ai: { autocomplete: false, slots: {}, translateLanguage: 'Englisch' },\n blocks: { defaultKind: 'section', structure: 'composite', treeRoot: 'folders', kindIcon: 'always', dragHandle: 'hover' },\n appearance: { theme: null },\n}\n\nconst headingConversionScopeSchema = z.enum(HEADING_CONVERSION_SCOPES)\nconst authorColorsSchema = z.boolean()\nconst authorColorStyleSchema = z.enum(AUTHOR_COLOR_STYLES)\nconst commentsLayoutSchema = z.enum(COMMENTS_LAYOUTS)\nconst autocompleteSchema = z.boolean()\nconst profileIdSchema = z.string().min(1).max(100)\nconst translateLanguageSchema = z.enum(AI_LANGUAGES)\nconst defaultKindSchema = z.string().min(1).max(100)\nconst structureSchema = z.enum(STRUCTURE_MODES)\nconst treeRootSchema = z.enum(TREE_ROOTS)\nconst kindIconSchema = z.enum(KIND_ICON_VISIBILITIES)\nconst dragHandleSchema = z.enum(DRAG_HANDLE_VISIBILITIES)\nconst themeSchema = z.string().regex(THEME_ID).nullable()\n\n/** Complete, valid settings (the body of `PUT /api/editor/settings`). */\nexport const editorSettingsSchema = z.object({\n version: z.literal(EDITOR_SETTINGS_VERSION),\n editing: z.object({\n headingConversionScope: headingConversionScopeSchema,\n authorColors: authorColorsSchema,\n authorColorStyle: authorColorStyleSchema,\n commentsLayout: commentsLayoutSchema,\n }),\n ai: z.object({\n autocomplete: autocompleteSchema,\n slots: z.partialRecord(z.enum(MODEL_SLOTS), profileIdSchema),\n translateLanguage: translateLanguageSchema,\n }),\n blocks: z.object({\n defaultKind: defaultKindSchema,\n structure: structureSchema,\n treeRoot: treeRootSchema,\n kindIcon: kindIconSchema,\n dragHandle: dragHandleSchema,\n }),\n appearance: z.object({ theme: themeSchema }),\n}) satisfies z.ZodType<EditorSettings>\n\nfunction record(value: unknown): Record<string, unknown> {\n return value && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {}\n}\n\nfunction valid<T>(schema: z.ZodType<T>, value: unknown, fallback: T): T {\n const parsed = schema.safeParse(value)\n return parsed.success ? parsed.data : fallback\n}\n\n/**\n * Deep-merges unknown input over the defaults; unknown keys dropped, invalid values replaced. Accepts the legacy flat\n * `{ headingConversionScope }` shape of the per-browser settings before version 1. Always returns fresh objects.\n */\nexport function parseEditorSettings(input: unknown): EditorSettings {\n const root = record(input)\n const editing = record(root.editing)\n const ai = record(root.ai)\n const slots = record(ai.slots)\n const blocks = record(root.blocks)\n const appearance = record(root.appearance)\n const defaults = EDITOR_SETTINGS_DEFAULTS\n const legacyScope = valid(headingConversionScopeSchema, root.headingConversionScope, defaults.editing.headingConversionScope)\n return {\n version: EDITOR_SETTINGS_VERSION,\n editing: {\n headingConversionScope: valid(headingConversionScopeSchema, editing.headingConversionScope, legacyScope),\n authorColors: valid(authorColorsSchema, editing.authorColors, defaults.editing.authorColors),\n authorColorStyle: valid(authorColorStyleSchema, editing.authorColorStyle, defaults.editing.authorColorStyle),\n commentsLayout: valid(commentsLayoutSchema, editing.commentsLayout, defaults.editing.commentsLayout),\n },\n ai: {\n autocomplete: valid(autocompleteSchema, ai.autocomplete, defaults.ai.autocomplete),\n slots: Object.fromEntries(MODEL_SLOTS.flatMap((slot) => {\n const parsed = profileIdSchema.safeParse(slots[slot])\n return parsed.success ? [[slot, parsed.data]] : []\n })),\n translateLanguage: valid(translateLanguageSchema, ai.translateLanguage, defaults.ai.translateLanguage),\n },\n blocks: {\n defaultKind: valid(defaultKindSchema, blocks.defaultKind, defaults.blocks.defaultKind),\n structure: valid(structureSchema, blocks.structure, defaults.blocks.structure),\n treeRoot: valid(treeRootSchema, blocks.treeRoot, defaults.blocks.treeRoot),\n kindIcon: valid(kindIconSchema, blocks.kindIcon, defaults.blocks.kindIcon),\n dragHandle: valid(dragHandleSchema, blocks.dragHandle, defaults.blocks.dragHandle),\n },\n appearance: {\n theme: valid(themeSchema, appearance.theme, defaults.appearance.theme),\n },\n }\n}\n"],"mappings":";;;AAwBA,MAAa,0BAA0B;;AAGvC,MAAa,WAAW;AAyCxB,MAAa,2BAA2C;CACtD,SAAA;CACA,SAAS;EAAE,wBAAwB;EAAa,cAAc;EAAO,kBAAkB;EAAc,gBAAgB;CAAS;CAC9H,IAAI;EAAE,cAAc;EAAO,OAAO,CAAC;EAAG,mBAAmB;CAAW;CACpE,QAAQ;EAAE,aAAa;EAAW,WAAW;EAAa,UAAU;EAAW,UAAU;EAAU,YAAY;CAAQ;CACvH,YAAY,EAAE,OAAO,KAAK;AAC5B;AAEA,MAAM,+BAA+B,EAAE,KAAK,yBAAyB;AACrE,MAAM,qBAAqB,EAAE,QAAQ;AACrC,MAAM,yBAAyB,EAAE,KAAK,mBAAmB;AACzD,MAAM,uBAAuB,EAAE,KAAK,gBAAgB;AACpD,MAAM,qBAAqB,EAAE,QAAQ;AAC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} from 'zod'\nimport {\n AI_LANGUAGES,\n type AiLanguage,\n AUTHOR_COLOR_STYLES,\n type AuthorColorStyle,\n COMMENTS_LAYOUTS,\n type CommentsLayout,\n DRAG_HANDLE_VISIBILITIES,\n type DragHandleVisibility,\n HEADING_CONVERSION_SCOPES,\n type HeadingConversionScope,\n KIND_ICON_VISIBILITIES,\n type KindIconVisibility,\n MODEL_SLOTS,\n type ModelSlot,\n STRUCTURE_MODES,\n type StructureMode,\n TREE_ROOTS,\n type TreeRoot,\n} from './values'\n\nexport * from './values'\n\nexport const EDITOR_SETTINGS_VERSION = 1\n\n/** Valid theme id: lowercase slug, used as directory name and in `/api/editor/themes/:id`. Defined here so core never imports a feature. */\nexport const THEME_ID = /^[a-z0-9][a-z0-9-]{0,63}$/\n\n/** A user's editor preferences, shared by all editors on the page; persisted per user through the `settings` port. */\nexport interface EditorSettings {\n version: typeof EDITOR_SETTINGS_VERSION\n editing: {\n /** Blocks „Gliederung umwandeln“ (both directions) converts when nothing is selected. */\n headingConversionScope: HeadingConversionScope\n /** Text is tinted per author (authors feature): each run in the colour of the user who wrote it. */\n authorColors: boolean\n /** `background`: tinted background; `text`: text in the author's colour. */\n authorColorStyle: AuthorColorStyle\n /** `margin`: comment cards in a column beside the text; `inline`: popover at the text plus the toolbar's list (comments feature). */\n commentsLayout: CommentsLayout\n }\n ai: {\n /** Ghost-text suggestions while typing (`GhostAutocomplete`). */\n autocomplete: boolean\n /** Model profile id per slot; a missing or unknown id falls back to the server's default preset for the slot. */\n slots: Partial<Record<ModelSlot, string>>\n /** Preselected target language of „Übersetzen“. */\n translateLanguage: AiLanguage\n }\n blocks: {\n /** Composite kind id the „Baustein“ shortcuts create (toolbar button, heading conversion). */\n defaultKind: string\n /** Preferred document structure: toolbar block types and the structure of AI-generated blocks. */\n structure: StructureMode\n /** Root of the document drawer while a composite file is loaded: nested in the folders, or the file itself. */\n treeRoot: TreeRoot\n /** Kind icon of composites (their drag handle): always visible, or only on hover, focus or while the details are open. */\n kindIcon: KindIconVisibility\n /** Standard drag handle of blocks without kind icon: on the hovered block, or permanently beside every block. */\n dragHandle: DragHandleVisibility\n /** Target size in characters of the parts a length split cuts a Baustein into (200–20000). */\n splitTargetChars: number\n }\n appearance: {\n /** Id of the Obsidian theme applied to the whole app (themes feature); `null` = the standard Nuxt UI look. */\n theme: string | null\n }\n}\n\n/** Bounds of `blocks.splitTargetChars`. */\nexport const SPLIT_TARGET_CHARS_MIN = 200\nexport const SPLIT_TARGET_CHARS_MAX = 20000\n\n/** The split target typed into the field as a valid setting: rounded and clamped to its bounds; `current` when `typed` is empty or not a number. */\nexport function clampSplitTargetChars(typed: string, current: number): number {\n const value = Math.round(Number(typed))\n return typed.trim() !== '' && Number.isFinite(value) ? Math.min(SPLIT_TARGET_CHARS_MAX, Math.max(SPLIT_TARGET_CHARS_MIN, value)) : current\n}\n\nexport const EDITOR_SETTINGS_DEFAULTS: EditorSettings = {\n version: EDITOR_SETTINGS_VERSION,\n editing: { headingConversionScope: 'container', authorColors: false, authorColorStyle: 'background', commentsLayout: 'margin' },\n ai: { autocomplete: false, slots: {}, translateLanguage: 'Englisch' },\n blocks: { defaultKind: 'section', structure: 'composite', treeRoot: 'folders', kindIcon: 'always', dragHandle: 'hover', splitTargetChars: 1500 },\n appearance: { theme: null },\n}\n\nconst headingConversionScopeSchema = z.enum(HEADING_CONVERSION_SCOPES)\nconst authorColorsSchema = z.boolean()\nconst authorColorStyleSchema = z.enum(AUTHOR_COLOR_STYLES)\nconst commentsLayoutSchema = z.enum(COMMENTS_LAYOUTS)\nconst autocompleteSchema = z.boolean()\nconst profileIdSchema = z.string().min(1).max(100)\nconst translateLanguageSchema = z.enum(AI_LANGUAGES)\nconst defaultKindSchema = z.string().min(1).max(100)\nconst structureSchema = z.enum(STRUCTURE_MODES)\nconst treeRootSchema = z.enum(TREE_ROOTS)\nconst kindIconSchema = z.enum(KIND_ICON_VISIBILITIES)\nconst dragHandleSchema = z.enum(DRAG_HANDLE_VISIBILITIES)\nconst splitTargetCharsSchema = z.number().int().min(SPLIT_TARGET_CHARS_MIN).max(SPLIT_TARGET_CHARS_MAX)\nconst themeSchema = z.string().regex(THEME_ID).nullable()\n\n/** Complete, valid settings (the body of `PUT /api/editor/settings`). */\nexport const editorSettingsSchema = z.object({\n version: z.literal(EDITOR_SETTINGS_VERSION),\n editing: z.object({\n headingConversionScope: headingConversionScopeSchema,\n authorColors: authorColorsSchema,\n authorColorStyle: authorColorStyleSchema,\n commentsLayout: commentsLayoutSchema,\n }),\n ai: z.object({\n autocomplete: autocompleteSchema,\n slots: z.partialRecord(z.enum(MODEL_SLOTS), profileIdSchema),\n translateLanguage: translateLanguageSchema,\n }),\n blocks: z.object({\n defaultKind: defaultKindSchema,\n structure: structureSchema,\n treeRoot: treeRootSchema,\n kindIcon: kindIconSchema,\n dragHandle: dragHandleSchema,\n splitTargetChars: splitTargetCharsSchema,\n }),\n appearance: z.object({ theme: themeSchema }),\n}) satisfies z.ZodType<EditorSettings>\n\nfunction record(value: unknown): Record<string, unknown> {\n return value && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {}\n}\n\nfunction valid<T>(schema: z.ZodType<T>, value: unknown, fallback: T): T {\n const parsed = schema.safeParse(value)\n return parsed.success ? parsed.data : fallback\n}\n\n/**\n * Deep-merges unknown input over the defaults; unknown keys dropped, invalid values replaced. Accepts the legacy flat\n * `{ headingConversionScope }` shape of the per-browser settings before version 1. Always returns fresh objects.\n */\nexport function parseEditorSettings(input: unknown): EditorSettings {\n const root = record(input)\n const editing = record(root.editing)\n const ai = record(root.ai)\n const slots = record(ai.slots)\n const blocks = record(root.blocks)\n const appearance = record(root.appearance)\n const defaults = EDITOR_SETTINGS_DEFAULTS\n const legacyScope = valid(headingConversionScopeSchema, root.headingConversionScope, defaults.editing.headingConversionScope)\n return {\n version: EDITOR_SETTINGS_VERSION,\n editing: {\n headingConversionScope: valid(headingConversionScopeSchema, editing.headingConversionScope, legacyScope),\n authorColors: valid(authorColorsSchema, editing.authorColors, defaults.editing.authorColors),\n authorColorStyle: valid(authorColorStyleSchema, editing.authorColorStyle, defaults.editing.authorColorStyle),\n commentsLayout: valid(commentsLayoutSchema, editing.commentsLayout, defaults.editing.commentsLayout),\n },\n ai: {\n autocomplete: valid(autocompleteSchema, ai.autocomplete, defaults.ai.autocomplete),\n slots: Object.fromEntries(MODEL_SLOTS.flatMap((slot) => {\n const parsed = profileIdSchema.safeParse(slots[slot])\n return parsed.success ? [[slot, parsed.data]] : []\n })),\n translateLanguage: valid(translateLanguageSchema, ai.translateLanguage, defaults.ai.translateLanguage),\n },\n blocks: {\n defaultKind: valid(defaultKindSchema, blocks.defaultKind, defaults.blocks.defaultKind),\n structure: valid(structureSchema, blocks.structure, defaults.blocks.structure),\n treeRoot: valid(treeRootSchema, blocks.treeRoot, defaults.blocks.treeRoot),\n kindIcon: valid(kindIconSchema, blocks.kindIcon, defaults.blocks.kindIcon),\n dragHandle: valid(dragHandleSchema, blocks.dragHandle, defaults.blocks.dragHandle),\n splitTargetChars: valid(splitTargetCharsSchema, blocks.splitTargetChars, defaults.blocks.splitTargetChars),\n },\n appearance: {\n theme: valid(themeSchema, appearance.theme, defaults.appearance.theme),\n },\n }\n}\n"],"mappings":";;;AAwBA,MAAa,0BAA0B;;AAGvC,MAAa,WAAW;;AA4CxB,MAAa,yBAAyB;AACtC,MAAa,yBAAyB;;AAGtC,SAAgB,sBAAsB,OAAe,SAAyB;CAC5E,MAAM,QAAQ,KAAK,MAAM,OAAO,KAAK,CAAC;CACtC,OAAO,MAAM,KAAK,MAAM,MAAM,OAAO,SAAS,KAAK,IAAI,KAAK,IAAI,wBAAwB,KAAK,IAAA,KAA4B,KAAK,CAAC,IAAI;AACrI;AAEA,MAAa,2BAA2C;CACtD,SAAA;CACA,SAAS;EAAE,wBAAwB;EAAa,cAAc;EAAO,kBAAkB;EAAc,gBAAgB;CAAS;CAC9H,IAAI;EAAE,cAAc;EAAO,OAAO,CAAC;EAAG,mBAAmB;CA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Q;GACN,aAAa,MAAM,mBAAmB,OAAO,aAAa,SAAS,OAAO,WAAW;GACrF,WAAW,MAAM,iBAAiB,OAAO,WAAW,SAAS,OAAO,SAAS;GAC7E,UAAU,MAAM,gBAAgB,OAAO,UAAU,SAAS,OAAO,QAAQ;GACzE,UAAU,MAAM,gBAAgB,OAAO,UAAU,SAAS,OAAO,QAAQ;GACzE,YAAY,MAAM,kBAAkB,OAAO,YAAY,SAAS,OAAO,UAAU;GACjF,kBAAkB,MAAM,wBAAwB,OAAO,kBAAkB,SAAS,OAAO,gBAAgB;EAC3G;EACA,YAAY,EACV,OAAO,MAAM,aAAa,WAAW,OAAO,SAAS,WAAW,KAAK,EACvE;CACF;AACF"}
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
/* Styles of the composite feature (`@ecsplico/editor/composites`); import after `core.css`. */
|
|
2
|
+
/* Colour baskets (`compositeFeature({ baskets })`): the default set's colours, light and dark like `tokens.css` (the host sets
|
|
3
|
+
`.dark`). Declared under `:where()` (specificity 0), a host's rule always wins; a custom basket brings its own `color`. */
|
|
4
|
+
:where(:root) {
|
|
5
|
+
--sk-basket-red: #ef4444;
|
|
6
|
+
--sk-basket-orange: #f97316;
|
|
7
|
+
--sk-basket-yellow: #eab308;
|
|
8
|
+
--sk-basket-green: #22c55e;
|
|
9
|
+
--sk-basket-blue: #3b82f6;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:where(.dark) {
|
|
13
|
+
--sk-basket-red: #f87171;
|
|
14
|
+
--sk-basket-orange: #fb923c;
|
|
15
|
+
--sk-basket-yellow: #facc15;
|
|
16
|
+
--sk-basket-green: #4ade80;
|
|
17
|
+
--sk-basket-blue: #60a5fa;
|
|
18
|
+
}
|
|
19
|
+
|
|
2
20
|
/* Composite block: title, then description and tags row (data, hidden: the chips and the details popover of
|
|
3
21
|
`CompositeChrome` show and edit them), then the body. */
|
|
4
22
|
@layer components {
|
|
@@ -8,6 +26,16 @@
|
|
|
8
26
|
padding-left: 1.25rem;
|
|
9
27
|
border-left: 2px solid var(--sk-border);
|
|
10
28
|
}
|
|
29
|
+
/* The node view sets `--sk-basket-color` of a composite in a colour basket (`compositeFeature({ baskets })`); the colours of the default set are the tokens above. */
|
|
30
|
+
/* Basket stripe: the border takes the basket's colour; the inset shadow thickens it at every nesting depth without moving content. */
|
|
31
|
+
.tiptap .composite[data-basket] {
|
|
32
|
+
border-left-color: var(--sk-basket-color, var(--sk-border));
|
|
33
|
+
box-shadow: inset 2px 0 0 var(--sk-basket-color, transparent);
|
|
34
|
+
}
|
|
35
|
+
/* Hidden title (`meta.titleHidden`, until a caret enters it): the title is gone and a strip keeps the chrome row (basket, show
|
|
36
|
+
title, status and tags; `CompositeChrome`) and the kind icon clear of the body. */
|
|
37
|
+
.tiptap .composite[data-title-hidden] { padding-top: 1.75rem; }
|
|
38
|
+
.tiptap .composite[data-title-hidden] > .composite__content > .composite-title { display: none; }
|
|
11
39
|
.tiptap .composite .composite { margin: 1em 0; }
|
|
12
40
|
.tiptap .composite .composite .composite { margin: 0.75em 0; padding-left: 1rem; border-left-width: 1px; }
|
|
13
41
|
/* Derived Baustein (has a `meta.derivation`) that is not opened: a short faded preview. The content stays laid out and
|
|
@@ -45,6 +73,10 @@
|
|
|
45
73
|
/* Description and tags rows are data only: the chips and the details popover of `CompositeChrome` show and edit them. */
|
|
46
74
|
.tiptap .composite-description,
|
|
47
75
|
.tiptap .composite-tags { display: none; }
|
|
76
|
+
/* Focus mode (`focusComposite`): the decorations of `CompositeFocus` hide every sibling of the focused Baustein
|
|
77
|
+
(`sk-focus-target`) and of each ancestor (`sk-focus-ancestor`). An ancestor keeps its title (its description and tags
|
|
78
|
+
rows are hidden above anyway; its title, description and tags are not siblings in the sense of the decorations). */
|
|
79
|
+
.tiptap .sk-focus-hidden { display: none !important; }
|
|
48
80
|
/* Placeholder extension marks an empty title `is-empty`; the text is the kind's, set by CompositeView. */
|
|
49
81
|
.tiptap .composite-title.is-empty::before {
|
|
50
82
|
color: var(--sk-fg-dimmed);
|