create-starlight-cms 0.9.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 +18 -0
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/bin/index.js +147 -0
- package/package.json +46 -0
- package/template/.nvmrc +1 -0
- package/template/LICENSE +21 -0
- package/template/README.md +68 -0
- package/template/THIRD_PARTY_NOTICES.md +12 -0
- package/template/_gitignore +14 -0
- package/template/astro.config.mjs +26 -0
- package/template/migrations/0001_schema.sql +73 -0
- package/template/migrations/0002_publish_delivery.sql +16 -0
- package/template/package-lock.json.template +9123 -0
- package/template/package.json +89 -0
- package/template/scripts/build-admin.mjs +38 -0
- package/template/scripts/check-linux-bindings.mjs +18 -0
- package/template/scripts/dev.mjs +94 -0
- package/template/src/admin/admin.scss +182 -0
- package/template/src/admin/app.ts +130 -0
- package/template/src/admin/client.tsx +684 -0
- package/template/src/admin/components/tiptap-extension/node-background-extension.ts +150 -0
- package/template/src/admin/components/tiptap-icons/align-center-icon.tsx +38 -0
- package/template/src/admin/components/tiptap-icons/align-justify-icon.tsx +38 -0
- package/template/src/admin/components/tiptap-icons/align-left-icon.tsx +38 -0
- package/template/src/admin/components/tiptap-icons/align-right-icon.tsx +38 -0
- package/template/src/admin/components/tiptap-icons/arrow-left-icon.tsx +24 -0
- package/template/src/admin/components/tiptap-icons/arrow-right-icon.tsx +26 -0
- package/template/src/admin/components/tiptap-icons/ban-icon.tsx +26 -0
- package/template/src/admin/components/tiptap-icons/blockquote-icon.tsx +44 -0
- package/template/src/admin/components/tiptap-icons/bold-icon.tsx +26 -0
- package/template/src/admin/components/tiptap-icons/case-sensitive-icon.tsx +32 -0
- package/template/src/admin/components/tiptap-icons/check-icon.tsx +26 -0
- package/template/src/admin/components/tiptap-icons/chevron-down-icon.tsx +26 -0
- package/template/src/admin/components/tiptap-icons/chevron-up-icon.tsx +22 -0
- package/template/src/admin/components/tiptap-icons/close-icon.tsx +24 -0
- package/template/src/admin/components/tiptap-icons/code-block-icon.tsx +38 -0
- package/template/src/admin/components/tiptap-icons/code2-icon.tsx +32 -0
- package/template/src/admin/components/tiptap-icons/corner-down-left-icon.tsx +26 -0
- package/template/src/admin/components/tiptap-icons/external-link-icon.tsx +28 -0
- package/template/src/admin/components/tiptap-icons/heading-five-icon.tsx +28 -0
- package/template/src/admin/components/tiptap-icons/heading-four-icon.tsx +28 -0
- package/template/src/admin/components/tiptap-icons/heading-icon.tsx +24 -0
- package/template/src/admin/components/tiptap-icons/heading-one-icon.tsx +28 -0
- package/template/src/admin/components/tiptap-icons/heading-six-icon.tsx +30 -0
- package/template/src/admin/components/tiptap-icons/heading-three-icon.tsx +36 -0
- package/template/src/admin/components/tiptap-icons/heading-two-icon.tsx +28 -0
- package/template/src/admin/components/tiptap-icons/highlighter-icon.tsx +26 -0
- package/template/src/admin/components/tiptap-icons/image-plus-icon.tsx +26 -0
- package/template/src/admin/components/tiptap-icons/italic-icon.tsx +24 -0
- package/template/src/admin/components/tiptap-icons/link-icon.tsx +28 -0
- package/template/src/admin/components/tiptap-icons/list-icon.tsx +56 -0
- package/template/src/admin/components/tiptap-icons/list-ordered-icon.tsx +56 -0
- package/template/src/admin/components/tiptap-icons/list-todo-icon.tsx +50 -0
- package/template/src/admin/components/tiptap-icons/moon-star-icon.tsx +30 -0
- package/template/src/admin/components/tiptap-icons/redo2-icon.tsx +26 -0
- package/template/src/admin/components/tiptap-icons/search-icon.tsx +26 -0
- package/template/src/admin/components/tiptap-icons/strike-icon.tsx +28 -0
- package/template/src/admin/components/tiptap-icons/subscript-icon.tsx +38 -0
- package/template/src/admin/components/tiptap-icons/sun-icon.tsx +58 -0
- package/template/src/admin/components/tiptap-icons/superscript-icon.tsx +38 -0
- package/template/src/admin/components/tiptap-icons/trash-icon.tsx +26 -0
- package/template/src/admin/components/tiptap-icons/underline-icon.tsx +26 -0
- package/template/src/admin/components/tiptap-icons/undo2-icon.tsx +26 -0
- package/template/src/admin/components/tiptap-icons/whole-word-icon.tsx +36 -0
- package/template/src/admin/components/tiptap-node/blockquote-node/blockquote-node.scss +37 -0
- package/template/src/admin/components/tiptap-node/code-block-node/code-block-node.scss +54 -0
- package/template/src/admin/components/tiptap-node/heading-node/heading-node.scss +45 -0
- package/template/src/admin/components/tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.ts +14 -0
- package/template/src/admin/components/tiptap-node/horizontal-rule-node/horizontal-rule-node.scss +25 -0
- package/template/src/admin/components/tiptap-node/image-node/image-node.scss +35 -0
- package/template/src/admin/components/tiptap-node/image-upload-node/image-upload-node-extension.ts +161 -0
- package/template/src/admin/components/tiptap-node/image-upload-node/image-upload-node.scss +249 -0
- package/template/src/admin/components/tiptap-node/image-upload-node/image-upload-node.tsx +554 -0
- package/template/src/admin/components/tiptap-node/image-upload-node/index.tsx +1 -0
- package/template/src/admin/components/tiptap-node/list-node/list-node.scss +208 -0
- package/template/src/admin/components/tiptap-node/paragraph-node/paragraph-node.scss +217 -0
- package/template/src/admin/components/tiptap-templates/simple/NOTICE.md +14 -0
- package/template/src/admin/components/tiptap-templates/simple/data/content.json +477 -0
- package/template/src/admin/components/tiptap-templates/simple/simple-editor.scss +97 -0
- package/template/src/admin/components/tiptap-templates/simple/simple-editor.tsx +348 -0
- package/template/src/admin/components/tiptap-templates/simple/theme-toggle.tsx +44 -0
- package/template/src/admin/components/tiptap-ui/blockquote-button/blockquote-button.tsx +122 -0
- package/template/src/admin/components/tiptap-ui/blockquote-button/index.tsx +2 -0
- package/template/src/admin/components/tiptap-ui/blockquote-button/use-blockquote.ts +273 -0
- package/template/src/admin/components/tiptap-ui/code-block-button/code-block-button.tsx +122 -0
- package/template/src/admin/components/tiptap-ui/code-block-button/index.tsx +2 -0
- package/template/src/admin/components/tiptap-ui/code-block-button/use-code-block.ts +283 -0
- package/template/src/admin/components/tiptap-ui/color-highlight-button/color-highlight-button.scss +49 -0
- package/template/src/admin/components/tiptap-ui/color-highlight-button/color-highlight-button.tsx +170 -0
- package/template/src/admin/components/tiptap-ui/color-highlight-button/index.tsx +2 -0
- package/template/src/admin/components/tiptap-ui/color-highlight-button/use-color-highlight.ts +380 -0
- package/template/src/admin/components/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx +231 -0
- package/template/src/admin/components/tiptap-ui/color-highlight-popover/index.tsx +1 -0
- package/template/src/admin/components/tiptap-ui/heading-button/heading-button.tsx +124 -0
- package/template/src/admin/components/tiptap-ui/heading-button/index.tsx +2 -0
- package/template/src/admin/components/tiptap-ui/heading-button/use-heading.ts +348 -0
- package/template/src/admin/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx +128 -0
- package/template/src/admin/components/tiptap-ui/heading-dropdown-menu/index.tsx +2 -0
- package/template/src/admin/components/tiptap-ui/heading-dropdown-menu/use-heading-dropdown-menu.ts +132 -0
- package/template/src/admin/components/tiptap-ui/image-upload-button/image-upload-button.tsx +130 -0
- package/template/src/admin/components/tiptap-ui/image-upload-button/index.tsx +2 -0
- package/template/src/admin/components/tiptap-ui/image-upload-button/use-image-upload.ts +197 -0
- package/template/src/admin/components/tiptap-ui/link-popover/index.tsx +2 -0
- package/template/src/admin/components/tiptap-ui/link-popover/link-popover.scss +16 -0
- package/template/src/admin/components/tiptap-ui/link-popover/link-popover.tsx +315 -0
- package/template/src/admin/components/tiptap-ui/link-popover/use-link-popover.ts +297 -0
- package/template/src/admin/components/tiptap-ui/list-button/index.tsx +2 -0
- package/template/src/admin/components/tiptap-ui/list-button/list-button.tsx +120 -0
- package/template/src/admin/components/tiptap-ui/list-button/use-list.ts +353 -0
- package/template/src/admin/components/tiptap-ui/list-dropdown-menu/index.tsx +2 -0
- package/template/src/admin/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx +126 -0
- package/template/src/admin/components/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.ts +220 -0
- package/template/src/admin/components/tiptap-ui/mark-button/index.tsx +2 -0
- package/template/src/admin/components/tiptap-ui/mark-button/mark-button.tsx +122 -0
- package/template/src/admin/components/tiptap-ui/mark-button/use-mark.ts +219 -0
- package/template/src/admin/components/tiptap-ui/search-and-replace/index.tsx +2 -0
- package/template/src/admin/components/tiptap-ui/search-and-replace/search-and-replace.scss +300 -0
- package/template/src/admin/components/tiptap-ui/search-and-replace/search-and-replace.tsx +718 -0
- package/template/src/admin/components/tiptap-ui/search-and-replace/use-search-and-replace.ts +528 -0
- package/template/src/admin/components/tiptap-ui/text-align-button/index.tsx +2 -0
- package/template/src/admin/components/tiptap-ui/text-align-button/text-align-button.tsx +144 -0
- package/template/src/admin/components/tiptap-ui/text-align-button/use-text-align.ts +237 -0
- package/template/src/admin/components/tiptap-ui/undo-redo-button/index.tsx +2 -0
- package/template/src/admin/components/tiptap-ui/undo-redo-button/undo-redo-button.tsx +125 -0
- package/template/src/admin/components/tiptap-ui/undo-redo-button/use-undo-redo.ts +200 -0
- package/template/src/admin/components/tiptap-ui-primitive/badge/badge-colors.scss +395 -0
- package/template/src/admin/components/tiptap-ui-primitive/badge/badge-group.scss +16 -0
- package/template/src/admin/components/tiptap-ui-primitive/badge/badge.scss +99 -0
- package/template/src/admin/components/tiptap-ui-primitive/badge/badge.tsx +44 -0
- package/template/src/admin/components/tiptap-ui-primitive/badge/index.tsx +1 -0
- package/template/src/admin/components/tiptap-ui-primitive/button/button-colors.scss +613 -0
- package/template/src/admin/components/tiptap-ui-primitive/button/button.scss +390 -0
- package/template/src/admin/components/tiptap-ui-primitive/button/button.tsx +158 -0
- package/template/src/admin/components/tiptap-ui-primitive/button/index.tsx +1 -0
- package/template/src/admin/components/tiptap-ui-primitive/button-group/button-group.scss +89 -0
- package/template/src/admin/components/tiptap-ui-primitive/button-group/button-group.tsx +72 -0
- package/template/src/admin/components/tiptap-ui-primitive/button-group/index.tsx +1 -0
- package/template/src/admin/components/tiptap-ui-primitive/card/card.scss +74 -0
- package/template/src/admin/components/tiptap-ui-primitive/card/card.tsx +79 -0
- package/template/src/admin/components/tiptap-ui-primitive/card/index.tsx +1 -0
- package/template/src/admin/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.scss +152 -0
- package/template/src/admin/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.tsx +262 -0
- package/template/src/admin/components/tiptap-ui-primitive/dropdown-menu/index.tsx +1 -0
- package/template/src/admin/components/tiptap-ui-primitive/input/index.tsx +1 -0
- package/template/src/admin/components/tiptap-ui-primitive/input/input.scss +41 -0
- package/template/src/admin/components/tiptap-ui-primitive/input/input.tsx +22 -0
- package/template/src/admin/components/tiptap-ui-primitive/input-group/index.tsx +1 -0
- package/template/src/admin/components/tiptap-ui-primitive/input-group/input-group.scss +225 -0
- package/template/src/admin/components/tiptap-ui-primitive/input-group/input-group.tsx +135 -0
- package/template/src/admin/components/tiptap-ui-primitive/popover/index.tsx +1 -0
- package/template/src/admin/components/tiptap-ui-primitive/popover/popover.scss +64 -0
- package/template/src/admin/components/tiptap-ui-primitive/popover/popover.tsx +35 -0
- package/template/src/admin/components/tiptap-ui-primitive/separator/index.tsx +1 -0
- package/template/src/admin/components/tiptap-ui-primitive/separator/separator.scss +23 -0
- package/template/src/admin/components/tiptap-ui-primitive/separator/separator.tsx +28 -0
- package/template/src/admin/components/tiptap-ui-primitive/spacer/index.tsx +1 -0
- package/template/src/admin/components/tiptap-ui-primitive/spacer/spacer.tsx +24 -0
- package/template/src/admin/components/tiptap-ui-primitive/switch/index.tsx +1 -0
- package/template/src/admin/components/tiptap-ui-primitive/switch/switch.scss +86 -0
- package/template/src/admin/components/tiptap-ui-primitive/switch/switch.tsx +29 -0
- package/template/src/admin/components/tiptap-ui-primitive/textarea/index.tsx +1 -0
- package/template/src/admin/components/tiptap-ui-primitive/textarea/textarea.scss +42 -0
- package/template/src/admin/components/tiptap-ui-primitive/textarea/textarea.tsx +16 -0
- package/template/src/admin/components/tiptap-ui-primitive/toolbar/index.tsx +1 -0
- package/template/src/admin/components/tiptap-ui-primitive/toolbar/toolbar.scss +98 -0
- package/template/src/admin/components/tiptap-ui-primitive/toolbar/toolbar.tsx +203 -0
- package/template/src/admin/components/tiptap-ui-primitive/tooltip/index.tsx +1 -0
- package/template/src/admin/components/tiptap-ui-primitive/tooltip/tooltip.scss +43 -0
- package/template/src/admin/components/tiptap-ui-primitive/tooltip/tooltip.tsx +241 -0
- package/template/src/admin/hooks/use-composed-ref.ts +46 -0
- package/template/src/admin/hooks/use-cursor-visibility.ts +69 -0
- package/template/src/admin/hooks/use-element-rect.ts +166 -0
- package/template/src/admin/hooks/use-is-breakpoint.ts +35 -0
- package/template/src/admin/hooks/use-menu-navigation.ts +204 -0
- package/template/src/admin/hooks/use-scrolling.ts +75 -0
- package/template/src/admin/hooks/use-throttled-callback.ts +48 -0
- package/template/src/admin/hooks/use-tiptap-editor.ts +69 -0
- package/template/src/admin/hooks/use-unmount.ts +21 -0
- package/template/src/admin/hooks/use-window-size.ts +93 -0
- package/template/src/admin/html.ts +17 -0
- package/template/src/admin/lib/tiptap-utils.ts +652 -0
- package/template/src/admin/navigation-tree.tsx +82 -0
- package/template/src/admin/preview.ts +73 -0
- package/template/src/admin/styles/_cms-theme.scss +58 -0
- package/template/src/admin/styles/_keyframe-animations.scss +91 -0
- package/template/src/admin/styles/_variables.scss +298 -0
- package/template/src/assets/favicon.svg +1 -0
- package/template/src/assets/logo.svg +1 -0
- package/template/src/astro-env.d.ts +1 -0
- package/template/src/content.config.ts +12 -0
- package/template/src/db/bootstrap.ts +36 -0
- package/template/src/db/client.ts +7 -0
- package/template/src/db/schema.ts +45 -0
- package/template/src/documents/service.ts +178 -0
- package/template/src/documents/validation.ts +9 -0
- package/template/src/env.ts +9 -0
- package/template/src/index.ts +10 -0
- package/template/src/locales.ts +10 -0
- package/template/src/media/service.ts +120 -0
- package/template/src/navigation/service.ts +171 -0
- package/template/src/pages/[locale]/cms-preview-shell.astro +12 -0
- package/template/src/pages/cms-preview-shell.astro +5 -0
- package/template/src/publish/deploy-hook.ts +42 -0
- package/template/src/publish/record.ts +20 -0
- package/template/src/publish/service.ts +135 -0
- package/template/src/scss.d.ts +5 -0
- package/template/src/site.config.ts +7 -0
- package/template/src/sql.d.ts +4 -0
- package/template/src/starlight/cms-origin.ts +4 -0
- package/template/src/starlight/loader.ts +21 -0
- package/template/src/starlight/preview-render.ts +162 -0
- package/template/src/starlight/preview-shell.astro +14 -0
- package/template/src/starlight/render.ts +59 -0
- package/template/src/starlight/schema.ts +34 -0
- package/template/src/starlight/sidebar.ts +35 -0
- package/template/src/starlight/snapshot.ts +47 -0
- package/template/src/starlight/source.ts +26 -0
- package/template/src/starlight/tiptap.ts +29 -0
- package/template/src/styles/starlight.css +12 -0
- package/template/test-files/content.test.template.ts +82 -0
- package/template/test-files/deploy-hook.test.template.ts +32 -0
- package/template/test-files/media.test.template.ts +39 -0
- package/template/test-files/publishing.integration.test.template.ts +156 -0
- package/template/tsconfig.admin.json +18 -0
- package/template/tsconfig.json +23 -0
- package/template/worker-configuration.d.ts +15389 -0
- package/template/wrangler.jsonc +26 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { createOnDropHandler, dragAndDropFeature, hotkeysCoreFeature, keyboardDragAndDropFeature, selectionFeature, syncDataLoaderFeature } from '@headless-tree/core';
|
|
2
|
+
import { AssistiveTreeDescription, useTree } from '@headless-tree/react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
5
|
+
|
|
6
|
+
export type NavigationItem = { id: string; parentId: string | null; kind: 'folder' | 'document'; name: string; slug: string; order: number; hasTranslation: boolean; translationLocales: string[]; translationStates: { locale: string; state: 'draft' | 'changes' | 'published' }[]; documentId?: string };
|
|
7
|
+
const root: NavigationItem = { id: 'root', parentId: null, kind: 'folder', name: 'Navigation', slug: '', order: 0, hasTranslation: true, translationLocales: [], translationStates: [] };
|
|
8
|
+
|
|
9
|
+
export function NavigationTree({ items, selectedDocumentId, selectedFolderId, onSelectDocument, onSelectFolder, onChangeChildren, onTreeChanged, canReorder = true }: {
|
|
10
|
+
items: NavigationItem[]; selectedDocumentId?: string; selectedFolderId: string | null;
|
|
11
|
+
onSelectDocument: (id: string) => void; onSelectFolder: (id: string) => void;
|
|
12
|
+
onChangeChildren: (parentId: string | null, childIds: string[]) => Promise<void>;
|
|
13
|
+
onTreeChanged: () => Promise<void>;
|
|
14
|
+
canReorder?: boolean;
|
|
15
|
+
}) {
|
|
16
|
+
const saving = useRef(false);
|
|
17
|
+
const byId = useMemo(() => new Map([root, ...items].map((item) => [item.id, item])), [items]);
|
|
18
|
+
const children = useMemo(() => {
|
|
19
|
+
const entries: [string, string[]][] = [['root', items.filter((item) => item.parentId === null).sort((a, b) => a.order - b.order).map((item) => item.id)]];
|
|
20
|
+
for (const item of items) entries.push([item.id, items.filter((candidate) => candidate.parentId === item.id).sort((a, b) => a.order - b.order).map((candidate) => candidate.id)]);
|
|
21
|
+
return new Map(entries);
|
|
22
|
+
}, [items]);
|
|
23
|
+
const tree = useTree<NavigationItem>({
|
|
24
|
+
rootItemId: 'root', getItemName: (item) => item.getItemData().name,
|
|
25
|
+
isItemFolder: (item) => item.getItemData().kind === 'folder',
|
|
26
|
+
onPrimaryAction: (item) => {
|
|
27
|
+
const data = item.getItemData();
|
|
28
|
+
if (data.documentId) onSelectDocument(data.documentId);
|
|
29
|
+
else if (data.id !== 'root') onSelectFolder(data.id.slice('folder:'.length));
|
|
30
|
+
},
|
|
31
|
+
dataLoader: { getItem: (id) => byId.get(id) ?? root, getChildren: (id) => children.get(id) ?? [] },
|
|
32
|
+
initialState: { expandedItems: ['root', ...items.filter((item) => item.kind === 'folder').map((item) => item.id)] },
|
|
33
|
+
canReorder,
|
|
34
|
+
indent: 20,
|
|
35
|
+
canDrag: (dragged) => !saving.current && canReorder && dragged.length === 1 && dragged[0]?.getId() !== 'root',
|
|
36
|
+
// The sync loader must see the removal before the helper inserts the item.
|
|
37
|
+
// Persist only the final destination, never the intermediate removal.
|
|
38
|
+
onDrop: async (dragged, target) => {
|
|
39
|
+
if (saving.current) return;
|
|
40
|
+
saving.current = true;
|
|
41
|
+
const before = new Map(children);
|
|
42
|
+
try {
|
|
43
|
+
await createOnDropHandler<NavigationItem>((parent, childIds) => {
|
|
44
|
+
children.set(parent.getId(), childIds);
|
|
45
|
+
})(dragged, target);
|
|
46
|
+
const parentId = target.item.getId();
|
|
47
|
+
await onChangeChildren(parentId === 'root' ? null : parentId.slice('folder:'.length), children.get(parentId) ?? []);
|
|
48
|
+
await onTreeChanged();
|
|
49
|
+
} catch {
|
|
50
|
+
// The API caller displays the error; put the visible tree back as well.
|
|
51
|
+
children.clear();
|
|
52
|
+
for (const [id, ids] of before) children.set(id, ids);
|
|
53
|
+
tree.rebuildTree();
|
|
54
|
+
} finally {
|
|
55
|
+
saving.current = false;
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
features: [syncDataLoaderFeature, selectionFeature, dragAndDropFeature, hotkeysCoreFeature, keyboardDragAndDropFeature],
|
|
59
|
+
});
|
|
60
|
+
useEffect(() => { tree.rebuildTree(); }, [children, tree]);
|
|
61
|
+
return <div className="navigation-tree-scroll"><div {...tree.getContainerProps('Navigation tree')} className="tree">
|
|
62
|
+
<AssistiveTreeDescription tree={tree} />
|
|
63
|
+
{tree.getItems().filter((item) => item.getId() !== 'root').map((item) => {
|
|
64
|
+
const data = item.getItemData();
|
|
65
|
+
const isSelected = data.documentId ? selectedDocumentId === data.documentId : selectedFolderId === data.id.slice('folder:'.length);
|
|
66
|
+
const hasChanges = data.translationStates.some((entry) => entry.state === 'changes');
|
|
67
|
+
const hasDraft = data.translationStates.some((entry) => entry.state === 'draft');
|
|
68
|
+
const publicationLabel = hasChanges ? 'Changes' : hasDraft ? 'Draft' : null;
|
|
69
|
+
const publicationTitle = data.translationStates.filter((entry) => entry.state !== 'published').map((entry) => `${entry.locale}: ${entry.state === 'changes' ? 'Changes' : 'Draft'}`).join(', ');
|
|
70
|
+
return <button {...item.getProps()} key={item.getKey()} style={{ paddingLeft: `${item.getItemMeta().level * 20}px` }}>
|
|
71
|
+
<div className={clsx('treeitem', {
|
|
72
|
+
focused: item.isFocused(),
|
|
73
|
+
expanded: item.isExpanded(),
|
|
74
|
+
selected: isSelected,
|
|
75
|
+
folder: item.isFolder(),
|
|
76
|
+
drop: item.isDragTarget(),
|
|
77
|
+
})}><span className="treeitem-name">{data.name}</span>{publicationLabel && <span className={clsx('treeitem-status', hasChanges ? 'changes' : 'draft')} title={publicationTitle}>{publicationLabel}</span>}</div>
|
|
78
|
+
</button>;
|
|
79
|
+
})}
|
|
80
|
+
<div className="dragline" style={tree.getDragLineStyle()} />
|
|
81
|
+
</div></div>;
|
|
82
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { getDocument } from '../documents/service.ts';
|
|
2
|
+
import type { RuntimeEnv } from '../env.ts';
|
|
3
|
+
import { defaultLocale, type SupportedLocale } from '../locales.ts';
|
|
4
|
+
import { renderPreviewDocument, renderPreviewTocItems } from '../starlight/preview-render.ts';
|
|
5
|
+
|
|
6
|
+
function previewShellPath(locale: SupportedLocale): string {
|
|
7
|
+
return locale === defaultLocale ? '/cms-preview-shell/' : `/${locale}/cms-preview-shell/`;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function previewHeaders(asset: Response): Headers {
|
|
11
|
+
const headers = new Headers(asset.headers);
|
|
12
|
+
headers.delete('ETag');
|
|
13
|
+
headers.delete('CF-Cache-Status');
|
|
14
|
+
headers.delete('Content-Length');
|
|
15
|
+
headers.set('Cache-Control', 'private, no-store');
|
|
16
|
+
headers.set('X-Robots-Tag', 'noindex, nofollow');
|
|
17
|
+
return headers;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function headingLevel(value: string | null, fallback: number): number {
|
|
21
|
+
const level = Number(value);
|
|
22
|
+
return Number.isInteger(level) && level >= 1 && level <= 6 ? level : fallback;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Keep Preview on the protected admin path while reusing the actual Starlight
|
|
27
|
+
* page frame and assets generated by the most recent public build.
|
|
28
|
+
*/
|
|
29
|
+
export async function previewDocument(env: RuntimeEnv, request: Request, id: string, locale: SupportedLocale): Promise<Response> {
|
|
30
|
+
const document = await getDocument(env, id, locale);
|
|
31
|
+
const shellRequest = new Request(new URL(previewShellPath(locale), request.url));
|
|
32
|
+
const shell = await env.ASSETS.fetch(shellRequest);
|
|
33
|
+
if (!shell.ok || !shell.headers.get('content-type')?.includes('text/html')) {
|
|
34
|
+
throw new Error('Preview shell is unavailable. Rebuild the public site, then try again.');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const title = document.title || 'Untitled document';
|
|
38
|
+
const preview = renderPreviewDocument(document.contentJson);
|
|
39
|
+
let desktopLevels = { min: 2, max: 3 };
|
|
40
|
+
let mobileLevels = { min: 2, max: 3 };
|
|
41
|
+
const response = new HTMLRewriter()
|
|
42
|
+
.on('title', { element: (element) => { element.setInnerContent(`${title} | Preview`); } })
|
|
43
|
+
.on('meta[name="description"], meta[property="og:description"]', { element: (element) => { element.setAttribute('content', document.description); } })
|
|
44
|
+
.on('meta[property="og:title"]', { element: (element) => { element.setAttribute('content', title); } })
|
|
45
|
+
.on('meta[name="robots"]', { element: (element) => { element.setAttribute('content', 'noindex, nofollow'); } })
|
|
46
|
+
.on('link[rel="canonical"]', { element: (element) => { element.remove(); } })
|
|
47
|
+
// A preview is opened for one document locale. The public-site selector
|
|
48
|
+
// would navigate to an empty static shell rather than this saved draft.
|
|
49
|
+
.on('starlight-lang-select', { element: (element) => { element.remove(); } })
|
|
50
|
+
.on('#_top', { element: (element) => { element.setInnerContent(title); } })
|
|
51
|
+
.on('#cms-preview-content', { element: (element) => { element.setInnerContent(preview.html, { html: true }); } })
|
|
52
|
+
.on('starlight-toc', { element: (element) => {
|
|
53
|
+
desktopLevels = {
|
|
54
|
+
min: headingLevel(element.getAttribute('data-min-h'), 2),
|
|
55
|
+
max: headingLevel(element.getAttribute('data-max-h'), 3),
|
|
56
|
+
};
|
|
57
|
+
} })
|
|
58
|
+
.on('mobile-starlight-toc', { element: (element) => {
|
|
59
|
+
mobileLevels = {
|
|
60
|
+
min: headingLevel(element.getAttribute('data-min-h'), 2),
|
|
61
|
+
max: headingLevel(element.getAttribute('data-max-h'), 3),
|
|
62
|
+
};
|
|
63
|
+
} })
|
|
64
|
+
.on('starlight-toc ul', { element: (element) => {
|
|
65
|
+
element.setInnerContent(renderPreviewTocItems(preview.headings, desktopLevels.min, desktopLevels.max, element.getAttribute('class') ?? ''), { html: true });
|
|
66
|
+
} })
|
|
67
|
+
.on('mobile-starlight-toc ul', { element: (element) => {
|
|
68
|
+
element.setInnerContent(renderPreviewTocItems(preview.headings, mobileLevels.min, mobileLevels.max, element.getAttribute('class') ?? ''), { html: true });
|
|
69
|
+
} })
|
|
70
|
+
.transform(shell);
|
|
71
|
+
|
|
72
|
+
return new Response(response.body, { status: response.status, statusText: response.statusText, headers: previewHeaders(shell) });
|
|
73
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* CMS-owned semantic tokens. Tiptap's editor tokens remain in _variables.scss. */
|
|
2
|
+
:root {
|
|
3
|
+
--cms-bg: #f7f8fa;
|
|
4
|
+
--cms-surface: #ffffff;
|
|
5
|
+
--cms-elevated: #ffffff;
|
|
6
|
+
--cms-border: #e2e5ea;
|
|
7
|
+
--cms-accent: #7c3aed;
|
|
8
|
+
--cms-accent-hover: #6d28d9;
|
|
9
|
+
--cms-accent-subtle: rgba(124, 58, 237, .10);
|
|
10
|
+
--cms-success: #16a34a;
|
|
11
|
+
--cms-success-subtle: rgba(22, 163, 74, .10);
|
|
12
|
+
--cms-warning: #d97706;
|
|
13
|
+
--cms-warning-subtle: rgba(217, 119, 6, .10);
|
|
14
|
+
--cms-danger: #dc2626;
|
|
15
|
+
--cms-danger-subtle: rgba(220, 38, 38, .10);
|
|
16
|
+
|
|
17
|
+
--cms-text: #182230;
|
|
18
|
+
--cms-text-muted: #667085;
|
|
19
|
+
--cms-text-subtle: #98a2b3;
|
|
20
|
+
--cms-hover: #f1f3f6;
|
|
21
|
+
--cms-input-bg: #ffffff;
|
|
22
|
+
--cms-focus-ring: rgba(124, 58, 237, .20);
|
|
23
|
+
--cms-backdrop: rgba(16, 24, 40, .32);
|
|
24
|
+
--cms-shadow: rgba(16, 24, 40, .12);
|
|
25
|
+
--cms-accent-foreground: #ffffff;
|
|
26
|
+
--cms-success-text: #166534;
|
|
27
|
+
--cms-warning-text: #92400e;
|
|
28
|
+
--cms-danger-text: #b91c1c;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
html.dark {
|
|
32
|
+
--cms-bg: #111318;
|
|
33
|
+
--cms-surface: #181b21;
|
|
34
|
+
--cms-elevated: #1d2027;
|
|
35
|
+
--cms-border: #2b303a;
|
|
36
|
+
--cms-accent: #8b5cf6;
|
|
37
|
+
--cms-accent-hover: #a78bfa;
|
|
38
|
+
--cms-accent-subtle: rgba(139, 92, 246, .14);
|
|
39
|
+
--cms-success: #22c55e;
|
|
40
|
+
--cms-success-subtle: rgba(34, 197, 94, .14);
|
|
41
|
+
--cms-warning: #f59e0b;
|
|
42
|
+
--cms-warning-subtle: rgba(245, 158, 11, .14);
|
|
43
|
+
--cms-danger: #ef4444;
|
|
44
|
+
--cms-danger-subtle: rgba(239, 68, 68, .14);
|
|
45
|
+
|
|
46
|
+
--cms-text: #f5f7fa;
|
|
47
|
+
--cms-text-muted: #b0b7c3;
|
|
48
|
+
--cms-text-subtle: #87909f;
|
|
49
|
+
--cms-hover: #252a33;
|
|
50
|
+
--cms-input-bg: #181b21;
|
|
51
|
+
--cms-focus-ring: rgba(139, 92, 246, .32);
|
|
52
|
+
--cms-backdrop: rgba(0, 0, 0, .50);
|
|
53
|
+
--cms-shadow: rgba(0, 0, 0, .42);
|
|
54
|
+
--cms-accent-foreground: #ffffff;
|
|
55
|
+
--cms-success-text: #86efac;
|
|
56
|
+
--cms-warning-text: #fcd34d;
|
|
57
|
+
--cms-danger-text: #fca5a5;
|
|
58
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
@keyframes fadeIn {
|
|
2
|
+
from {
|
|
3
|
+
opacity: 0;
|
|
4
|
+
}
|
|
5
|
+
to {
|
|
6
|
+
opacity: 1;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@keyframes fadeOut {
|
|
11
|
+
from {
|
|
12
|
+
opacity: 1;
|
|
13
|
+
}
|
|
14
|
+
to {
|
|
15
|
+
opacity: 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@keyframes zoomIn {
|
|
20
|
+
from {
|
|
21
|
+
transform: scale(0.95);
|
|
22
|
+
}
|
|
23
|
+
to {
|
|
24
|
+
transform: scale(1);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@keyframes zoomOut {
|
|
29
|
+
from {
|
|
30
|
+
transform: scale(1);
|
|
31
|
+
}
|
|
32
|
+
to {
|
|
33
|
+
transform: scale(0.95);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@keyframes zoom {
|
|
38
|
+
0% {
|
|
39
|
+
opacity: 0;
|
|
40
|
+
transform: scale(0.95);
|
|
41
|
+
}
|
|
42
|
+
100% {
|
|
43
|
+
opacity: 1;
|
|
44
|
+
transform: scale(1);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@keyframes slideFromTop {
|
|
49
|
+
from {
|
|
50
|
+
transform: translateY(-0.5rem);
|
|
51
|
+
}
|
|
52
|
+
to {
|
|
53
|
+
transform: translateY(0);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@keyframes slideFromRight {
|
|
58
|
+
from {
|
|
59
|
+
transform: translateX(0.5rem);
|
|
60
|
+
}
|
|
61
|
+
to {
|
|
62
|
+
transform: translateX(0);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@keyframes slideFromLeft {
|
|
67
|
+
from {
|
|
68
|
+
transform: translateX(-0.5rem);
|
|
69
|
+
}
|
|
70
|
+
to {
|
|
71
|
+
transform: translateX(0);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@keyframes slideFromBottom {
|
|
76
|
+
from {
|
|
77
|
+
transform: translateY(0.5rem);
|
|
78
|
+
}
|
|
79
|
+
to {
|
|
80
|
+
transform: translateY(0);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@keyframes spin {
|
|
85
|
+
from {
|
|
86
|
+
transform: rotate(0deg);
|
|
87
|
+
}
|
|
88
|
+
to {
|
|
89
|
+
transform: rotate(360deg);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/******************
|
|
3
|
+
Basics
|
|
4
|
+
******************/
|
|
5
|
+
|
|
6
|
+
overflow-wrap: break-word;
|
|
7
|
+
/* iOS WebKit only honors the -webkit- prefixed form */
|
|
8
|
+
-webkit-text-size-adjust: none;
|
|
9
|
+
text-size-adjust: none;
|
|
10
|
+
text-rendering: optimizeLegibility;
|
|
11
|
+
-webkit-font-smoothing: antialiased;
|
|
12
|
+
-moz-osx-font-smoothing: grayscale;
|
|
13
|
+
|
|
14
|
+
/******************
|
|
15
|
+
Colors variables
|
|
16
|
+
******************/
|
|
17
|
+
|
|
18
|
+
/* Gray alpha (light mode) */
|
|
19
|
+
--tt-gray-light-a-50: rgba(56, 56, 56, 0.04);
|
|
20
|
+
--tt-gray-light-a-100: rgba(15, 22, 36, 0.05);
|
|
21
|
+
--tt-gray-light-a-200: rgba(37, 39, 45, 0.1);
|
|
22
|
+
--tt-gray-light-a-300: rgba(47, 50, 55, 0.2);
|
|
23
|
+
--tt-gray-light-a-400: rgba(40, 44, 51, 0.42);
|
|
24
|
+
--tt-gray-light-a-500: rgba(52, 55, 60, 0.64);
|
|
25
|
+
--tt-gray-light-a-600: rgba(36, 39, 46, 0.78);
|
|
26
|
+
--tt-gray-light-a-700: rgba(35, 37, 42, 0.87);
|
|
27
|
+
--tt-gray-light-a-800: rgba(30, 32, 36, 0.95);
|
|
28
|
+
--tt-gray-light-a-900: rgba(29, 30, 32, 0.98);
|
|
29
|
+
|
|
30
|
+
/* Gray (light mode) */
|
|
31
|
+
--tt-gray-light-50: rgba(250, 250, 250, 1);
|
|
32
|
+
--tt-gray-light-100: rgba(244, 244, 245, 1);
|
|
33
|
+
--tt-gray-light-200: rgba(234, 234, 235, 1);
|
|
34
|
+
--tt-gray-light-300: rgba(213, 214, 215, 1);
|
|
35
|
+
--tt-gray-light-400: rgba(166, 167, 171, 1);
|
|
36
|
+
--tt-gray-light-500: rgba(125, 127, 130, 1);
|
|
37
|
+
--tt-gray-light-600: rgba(83, 86, 90, 1);
|
|
38
|
+
--tt-gray-light-700: rgba(64, 65, 69, 1);
|
|
39
|
+
--tt-gray-light-800: rgba(44, 45, 48, 1);
|
|
40
|
+
--tt-gray-light-900: rgba(34, 35, 37, 1);
|
|
41
|
+
|
|
42
|
+
/* Gray alpha (dark mode) */
|
|
43
|
+
--tt-gray-dark-a-50: rgba(232, 232, 253, 0.05);
|
|
44
|
+
--tt-gray-dark-a-100: rgba(231, 231, 243, 0.07);
|
|
45
|
+
--tt-gray-dark-a-200: rgba(238, 238, 246, 0.11);
|
|
46
|
+
--tt-gray-dark-a-300: rgba(239, 239, 245, 0.22);
|
|
47
|
+
--tt-gray-dark-a-400: rgba(244, 244, 255, 0.37);
|
|
48
|
+
--tt-gray-dark-a-500: rgba(236, 238, 253, 0.5);
|
|
49
|
+
--tt-gray-dark-a-600: rgba(247, 247, 253, 0.64);
|
|
50
|
+
--tt-gray-dark-a-700: rgba(251, 251, 254, 0.75);
|
|
51
|
+
--tt-gray-dark-a-800: rgba(253, 253, 253, 0.88);
|
|
52
|
+
--tt-gray-dark-a-900: rgba(255, 255, 255, 0.96);
|
|
53
|
+
|
|
54
|
+
/* Gray (dark mode) */
|
|
55
|
+
--tt-gray-dark-50: rgba(25, 25, 26, 1);
|
|
56
|
+
--tt-gray-dark-100: rgba(32, 32, 34, 1);
|
|
57
|
+
--tt-gray-dark-200: rgba(45, 45, 47, 1);
|
|
58
|
+
--tt-gray-dark-300: rgba(70, 70, 73, 1);
|
|
59
|
+
--tt-gray-dark-400: rgba(99, 99, 105, 1);
|
|
60
|
+
--tt-gray-dark-500: rgba(124, 124, 131, 1);
|
|
61
|
+
--tt-gray-dark-600: rgba(163, 163, 168, 1);
|
|
62
|
+
--tt-gray-dark-700: rgba(192, 192, 195, 1);
|
|
63
|
+
--tt-gray-dark-800: rgba(224, 224, 225, 1);
|
|
64
|
+
--tt-gray-dark-900: rgba(245, 245, 245, 1);
|
|
65
|
+
|
|
66
|
+
/* Brand colors */
|
|
67
|
+
--tt-brand-color-50: rgba(239, 238, 255, 1);
|
|
68
|
+
--tt-brand-color-100: rgba(222, 219, 255, 1);
|
|
69
|
+
--tt-brand-color-200: rgba(195, 189, 255, 1);
|
|
70
|
+
--tt-brand-color-300: rgba(157, 138, 255, 1);
|
|
71
|
+
--tt-brand-color-400: rgba(122, 82, 255, 1);
|
|
72
|
+
--tt-brand-color-500: rgba(98, 41, 255, 1);
|
|
73
|
+
--tt-brand-color-600: rgba(84, 0, 229, 1);
|
|
74
|
+
--tt-brand-color-700: rgba(75, 0, 204, 1);
|
|
75
|
+
--tt-brand-color-800: rgba(56, 0, 153, 1);
|
|
76
|
+
--tt-brand-color-900: rgba(43, 25, 102, 1);
|
|
77
|
+
--tt-brand-color-950: hsla(257, 100%, 9%, 1);
|
|
78
|
+
|
|
79
|
+
/* Green */
|
|
80
|
+
--tt-color-green-inc-5: hsla(129, 100%, 97%, 1);
|
|
81
|
+
--tt-color-green-inc-4: hsla(129, 100%, 92%, 1);
|
|
82
|
+
--tt-color-green-inc-3: hsla(131, 100%, 86%, 1);
|
|
83
|
+
--tt-color-green-inc-2: hsla(133, 98%, 78%, 1);
|
|
84
|
+
--tt-color-green-inc-1: hsla(137, 99%, 70%, 1);
|
|
85
|
+
--tt-color-green-base: hsla(147, 99%, 50%, 1);
|
|
86
|
+
--tt-color-green-dec-1: hsla(147, 97%, 41%, 1);
|
|
87
|
+
--tt-color-green-dec-2: hsla(146, 98%, 32%, 1);
|
|
88
|
+
--tt-color-green-dec-3: hsla(146, 100%, 24%, 1);
|
|
89
|
+
--tt-color-green-dec-4: hsla(144, 100%, 16%, 1);
|
|
90
|
+
--tt-color-green-dec-5: hsla(140, 100%, 9%, 1);
|
|
91
|
+
|
|
92
|
+
/* Yellow */
|
|
93
|
+
--tt-color-yellow-inc-5: hsla(50, 100%, 97%, 1);
|
|
94
|
+
--tt-color-yellow-inc-4: hsla(50, 100%, 91%, 1);
|
|
95
|
+
--tt-color-yellow-inc-3: hsla(50, 100%, 84%, 1);
|
|
96
|
+
--tt-color-yellow-inc-2: hsla(50, 100%, 77%, 1);
|
|
97
|
+
--tt-color-yellow-inc-1: hsla(50, 100%, 68%, 1);
|
|
98
|
+
--tt-color-yellow-base: hsla(52, 100%, 50%, 1);
|
|
99
|
+
--tt-color-yellow-dec-1: hsla(52, 100%, 41%, 1);
|
|
100
|
+
--tt-color-yellow-dec-2: hsla(52, 100%, 32%, 1);
|
|
101
|
+
--tt-color-yellow-dec-3: hsla(52, 100%, 24%, 1);
|
|
102
|
+
--tt-color-yellow-dec-4: hsla(51, 100%, 16%, 1);
|
|
103
|
+
--tt-color-yellow-dec-5: hsla(50, 100%, 9%, 1);
|
|
104
|
+
|
|
105
|
+
/* Red */
|
|
106
|
+
--tt-color-red-inc-5: hsla(11, 100%, 96%, 1);
|
|
107
|
+
--tt-color-red-inc-4: hsla(11, 100%, 88%, 1);
|
|
108
|
+
--tt-color-red-inc-3: hsla(10, 100%, 80%, 1);
|
|
109
|
+
--tt-color-red-inc-2: hsla(9, 100%, 73%, 1);
|
|
110
|
+
--tt-color-red-inc-1: hsla(7, 100%, 64%, 1);
|
|
111
|
+
--tt-color-red-base: hsla(7, 100%, 54%, 1);
|
|
112
|
+
--tt-color-red-dec-1: hsla(7, 100%, 41%, 1);
|
|
113
|
+
--tt-color-red-dec-2: hsla(5, 100%, 32%, 1);
|
|
114
|
+
--tt-color-red-dec-3: hsla(4, 100%, 24%, 1);
|
|
115
|
+
--tt-color-red-dec-4: hsla(3, 100%, 16%, 1);
|
|
116
|
+
--tt-color-red-dec-5: hsla(1, 100%, 9%, 1);
|
|
117
|
+
|
|
118
|
+
/* Basic colors */
|
|
119
|
+
--white: rgba(255, 255, 255, 1);
|
|
120
|
+
--black: rgba(14, 14, 17, 1);
|
|
121
|
+
--transparent: rgba(255, 255, 255, 0);
|
|
122
|
+
|
|
123
|
+
/******************
|
|
124
|
+
Shadow variables
|
|
125
|
+
******************/
|
|
126
|
+
|
|
127
|
+
/* Shadows Light */
|
|
128
|
+
--tt-shadow-elevated-md:
|
|
129
|
+
0px 16px 48px 0px rgba(17, 24, 39, 0.04),
|
|
130
|
+
0px 12px 24px 0px rgba(17, 24, 39, 0.04),
|
|
131
|
+
0px 6px 8px 0px rgba(17, 24, 39, 0.02),
|
|
132
|
+
0px 2px 3px 0px rgba(17, 24, 39, 0.02);
|
|
133
|
+
|
|
134
|
+
/**************************************************
|
|
135
|
+
Radius variables
|
|
136
|
+
**************************************************/
|
|
137
|
+
|
|
138
|
+
--tt-radius-xxs: 0.125rem; /* 2px */
|
|
139
|
+
--tt-radius-xs: 0.25rem; /* 4px */
|
|
140
|
+
--tt-radius-sm: 0.375rem; /* 6px */
|
|
141
|
+
--tt-radius-md: 0.5rem; /* 8px */
|
|
142
|
+
--tt-radius-lg: 0.75rem; /* 12px */
|
|
143
|
+
--tt-radius-xl: 1rem; /* 16px */
|
|
144
|
+
|
|
145
|
+
/**************************************************
|
|
146
|
+
Transition variables
|
|
147
|
+
**************************************************/
|
|
148
|
+
|
|
149
|
+
--tt-transition-duration-short: 0.1s;
|
|
150
|
+
--tt-transition-duration-default: 0.2s;
|
|
151
|
+
--tt-transition-duration-long: 0.64s;
|
|
152
|
+
--tt-transition-easing-default: cubic-bezier(0.46, 0.03, 0.52, 0.96);
|
|
153
|
+
--tt-transition-easing-cubic: cubic-bezier(0.65, 0.05, 0.36, 1);
|
|
154
|
+
--tt-transition-easing-quart: cubic-bezier(0.77, 0, 0.18, 1);
|
|
155
|
+
--tt-transition-easing-circ: cubic-bezier(0.79, 0.14, 0.15, 0.86);
|
|
156
|
+
--tt-transition-easing-back: cubic-bezier(0.68, -0.55, 0.27, 1.55);
|
|
157
|
+
|
|
158
|
+
/******************
|
|
159
|
+
Contrast variables
|
|
160
|
+
******************/
|
|
161
|
+
|
|
162
|
+
--tt-accent-contrast: 8%;
|
|
163
|
+
--tt-destructive-contrast: 8%;
|
|
164
|
+
--tt-foreground-contrast: 8%;
|
|
165
|
+
|
|
166
|
+
&,
|
|
167
|
+
*,
|
|
168
|
+
::before,
|
|
169
|
+
::after {
|
|
170
|
+
box-sizing: border-box;
|
|
171
|
+
transition: none var(--tt-transition-duration-default)
|
|
172
|
+
var(--tt-transition-easing-default);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
:root {
|
|
177
|
+
/**************************************************
|
|
178
|
+
Global colors
|
|
179
|
+
**************************************************/
|
|
180
|
+
|
|
181
|
+
/* Global colors - Light mode */
|
|
182
|
+
--tt-bg-color: var(--white);
|
|
183
|
+
--tt-border-color: var(--tt-gray-light-a-200);
|
|
184
|
+
--tt-border-color-tint: var(--tt-gray-light-a-100);
|
|
185
|
+
--tt-sidebar-bg-color: var(--tt-gray-light-100);
|
|
186
|
+
--tt-scrollbar-color: var(--tt-gray-light-a-200);
|
|
187
|
+
--tt-cursor-color: var(--tt-brand-color-500);
|
|
188
|
+
--tt-selection-color: rgba(157, 138, 255, 0.2);
|
|
189
|
+
--tt-card-bg-color: var(--white);
|
|
190
|
+
--tt-card-border-color: var(--tt-gray-light-a-100);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* Global colors - Dark mode */
|
|
194
|
+
.dark {
|
|
195
|
+
--tt-bg-color: var(--black);
|
|
196
|
+
--tt-border-color: var(--tt-gray-dark-a-200);
|
|
197
|
+
--tt-border-color-tint: var(--tt-gray-dark-a-100);
|
|
198
|
+
--tt-sidebar-bg-color: var(--tt-gray-dark-100);
|
|
199
|
+
--tt-scrollbar-color: var(--tt-gray-dark-a-200);
|
|
200
|
+
--tt-cursor-color: var(--tt-brand-color-400);
|
|
201
|
+
--tt-selection-color: rgba(122, 82, 255, 0.2);
|
|
202
|
+
--tt-card-bg-color: var(--tt-gray-dark-50);
|
|
203
|
+
--tt-card-border-color: var(--tt-gray-dark-a-50);
|
|
204
|
+
|
|
205
|
+
--tt-shadow-elevated-md:
|
|
206
|
+
0px 16px 48px 0px rgba(0, 0, 0, 0.5), 0px 12px 24px 0px rgba(0, 0, 0, 0.24),
|
|
207
|
+
0px 6px 8px 0px rgba(0, 0, 0, 0.22), 0px 2px 3px 0px rgba(0, 0, 0, 0.12);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* Text colors */
|
|
211
|
+
:root {
|
|
212
|
+
--tt-color-text-gray: hsl(45, 2%, 46%);
|
|
213
|
+
--tt-color-text-brown: hsl(19, 31%, 47%);
|
|
214
|
+
--tt-color-text-orange: hsl(30, 89%, 45%);
|
|
215
|
+
--tt-color-text-yellow: hsl(38, 62%, 49%);
|
|
216
|
+
--tt-color-text-green: hsl(148, 32%, 39%);
|
|
217
|
+
--tt-color-text-blue: hsl(202, 54%, 43%);
|
|
218
|
+
--tt-color-text-purple: hsl(274, 32%, 54%);
|
|
219
|
+
--tt-color-text-pink: hsl(328, 49%, 53%);
|
|
220
|
+
--tt-color-text-red: hsl(2, 62%, 55%);
|
|
221
|
+
|
|
222
|
+
--tt-color-text-gray-contrast: hsla(39, 26%, 26%, 0.15);
|
|
223
|
+
--tt-color-text-brown-contrast: hsla(18, 43%, 69%, 0.35);
|
|
224
|
+
--tt-color-text-orange-contrast: hsla(24, 73%, 55%, 0.27);
|
|
225
|
+
--tt-color-text-yellow-contrast: hsla(44, 82%, 59%, 0.39);
|
|
226
|
+
--tt-color-text-green-contrast: hsla(126, 29%, 60%, 0.27);
|
|
227
|
+
--tt-color-text-blue-contrast: hsla(202, 54%, 59%, 0.27);
|
|
228
|
+
--tt-color-text-purple-contrast: hsla(274, 37%, 64%, 0.27);
|
|
229
|
+
--tt-color-text-pink-contrast: hsla(331, 60%, 71%, 0.27);
|
|
230
|
+
--tt-color-text-red-contrast: hsla(8, 79%, 79%, 0.4);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.dark {
|
|
234
|
+
--tt-color-text-gray: hsl(0, 0%, 61%);
|
|
235
|
+
--tt-color-text-brown: hsl(18, 35%, 58%);
|
|
236
|
+
--tt-color-text-orange: hsl(25, 53%, 53%);
|
|
237
|
+
--tt-color-text-yellow: hsl(36, 54%, 55%);
|
|
238
|
+
--tt-color-text-green: hsl(145, 32%, 47%);
|
|
239
|
+
--tt-color-text-blue: hsl(202, 64%, 52%);
|
|
240
|
+
--tt-color-text-purple: hsl(270, 55%, 62%);
|
|
241
|
+
--tt-color-text-pink: hsl(329, 57%, 58%);
|
|
242
|
+
--tt-color-text-red: hsl(1, 69%, 60%);
|
|
243
|
+
|
|
244
|
+
--tt-color-text-gray-contrast: hsla(0, 0%, 100%, 0.09);
|
|
245
|
+
--tt-color-text-brown-contrast: hsla(17, 45%, 50%, 0.25);
|
|
246
|
+
--tt-color-text-orange-contrast: hsla(27, 82%, 53%, 0.2);
|
|
247
|
+
--tt-color-text-yellow-contrast: hsla(35, 49%, 47%, 0.2);
|
|
248
|
+
--tt-color-text-green-contrast: hsla(151, 55%, 39%, 0.2);
|
|
249
|
+
--tt-color-text-blue-contrast: hsla(202, 54%, 43%, 0.2);
|
|
250
|
+
--tt-color-text-purple-contrast: hsla(271, 56%, 60%, 0.18);
|
|
251
|
+
--tt-color-text-pink-contrast: hsla(331, 67%, 58%, 0.22);
|
|
252
|
+
--tt-color-text-red-contrast: hsla(0, 67%, 60%, 0.25);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/* Highlight colors */
|
|
256
|
+
:root {
|
|
257
|
+
--tt-color-highlight-yellow: #fef9c3;
|
|
258
|
+
--tt-color-highlight-green: #dcfce7;
|
|
259
|
+
--tt-color-highlight-blue: #e0f2fe;
|
|
260
|
+
--tt-color-highlight-purple: #f3e8ff;
|
|
261
|
+
--tt-color-highlight-red: #ffe4e6;
|
|
262
|
+
--tt-color-highlight-gray: rgb(248, 248, 247);
|
|
263
|
+
--tt-color-highlight-brown: rgb(244, 238, 238);
|
|
264
|
+
--tt-color-highlight-orange: rgb(251, 236, 221);
|
|
265
|
+
--tt-color-highlight-pink: rgb(252, 241, 246);
|
|
266
|
+
|
|
267
|
+
--tt-color-highlight-yellow-contrast: #fbe604;
|
|
268
|
+
--tt-color-highlight-green-contrast: #c7fad8;
|
|
269
|
+
--tt-color-highlight-blue-contrast: #ceeafd;
|
|
270
|
+
--tt-color-highlight-purple-contrast: #e4ccff;
|
|
271
|
+
--tt-color-highlight-red-contrast: #ffccd0;
|
|
272
|
+
--tt-color-highlight-gray-contrast: rgba(84, 72, 49, 0.15);
|
|
273
|
+
--tt-color-highlight-brown-contrast: rgba(210, 162, 141, 0.35);
|
|
274
|
+
--tt-color-highlight-orange-contrast: rgba(224, 124, 57, 0.27);
|
|
275
|
+
--tt-color-highlight-pink-contrast: rgba(225, 136, 179, 0.27);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.dark {
|
|
279
|
+
--tt-color-highlight-yellow: #6b6524;
|
|
280
|
+
--tt-color-highlight-green: #509568;
|
|
281
|
+
--tt-color-highlight-blue: #6e92aa;
|
|
282
|
+
--tt-color-highlight-purple: #583e74;
|
|
283
|
+
--tt-color-highlight-red: #743e42;
|
|
284
|
+
--tt-color-highlight-gray: rgb(47, 47, 47);
|
|
285
|
+
--tt-color-highlight-brown: rgb(74, 50, 40);
|
|
286
|
+
--tt-color-highlight-orange: rgb(92, 59, 35);
|
|
287
|
+
--tt-color-highlight-pink: rgb(78, 44, 60);
|
|
288
|
+
|
|
289
|
+
--tt-color-highlight-yellow-contrast: #58531e;
|
|
290
|
+
--tt-color-highlight-green-contrast: #47855d;
|
|
291
|
+
--tt-color-highlight-blue-contrast: #5e86a1;
|
|
292
|
+
--tt-color-highlight-purple-contrast: #4c3564;
|
|
293
|
+
--tt-color-highlight-red-contrast: #643539;
|
|
294
|
+
--tt-color-highlight-gray-contrast: rgba(255, 255, 255, 0.094);
|
|
295
|
+
--tt-color-highlight-brown-contrast: rgba(184, 101, 69, 0.25);
|
|
296
|
+
--tt-color-highlight-orange-contrast: rgba(233, 126, 37, 0.2);
|
|
297
|
+
--tt-color-highlight-pink-contrast: rgba(220, 76, 145, 0.22);
|
|
298
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="45 45 160 160"><g id="cloud-document-icon" data-name="Cloud document icon" fill="none" stroke="#111827" stroke-width="2"><path id="document-back" data-name="Purple document backing" fill="#8B5CF6" stroke="none" stroke-width="2" d="M 71.235 164.233 L 71.235 83.433 C 71.235 73.033 79.635 65.833 91.135 65.833 L 139.976 66.011 L 164.02 90.497 L 164.035 155.433 Z" /><path id="paper" data-name="White paper sheet" fill="#FFFFFF" stroke="none" stroke-width="2" d="M 81.235 164.233 L 81.235 85.833 C 81.235 79.833 85.935 75.833 91.935 75.833 L 132.9 75.833 C 132.9 87 142 96 154.035 96 L 154.035 156.5 Z" /><path id="path-6" data-name="Folded page flap" fill="#8B5CF6" stroke="none" stroke-width="2" d="M 139.976 66.011 L 164.02 90.497 L 154.035 96 C 142 96 132.9 87 132.9 75.833 L 139.976 66.011 Z" /><rect id="line-one" data-name="Text line one" fill="#8B5CF6" stroke="none" stroke-width="2" x="93.277" y="100.317" width="33.6" height="8.4" rx="4.8" ry="4.8" /><rect id="line-two" data-name="Text line two" fill="#8B5CF6" stroke="none" stroke-width="2" x="93.277" y="114.317" width="51.2" height="8.4" rx="4.8" ry="4.8" /><rect id="line-three" data-name="Text line three" fill="#8B5CF6" stroke="none" stroke-width="2" x="93.277" y="127.717" width="30.4" height="8.4" rx="4.8" ry="4.8" /><path id="cloud" data-name="Foreground cloud embracing document" fill="#8B5CF6" stroke="none" stroke-width="2" d="M 64.625 193.917 C 54.625 193.917 47.825 186.117 47.825 173.717 C 47.825 158.317 58.425 145.917 73.625 141.517 C 88.225 137.517 100.625 143.117 109.825 151.117 C 118.625 131.917 134.025 128.517 150.825 128.517 C 170.625 128.517 185.225 142.717 186.425 156.717 C 197.825 158.517 202.625 168.117 202.625 174.517 C 202.625 186.517 193.625 193.917 180.625 193.917 Z" /><path id="sparkle" data-name="Four-point sparkle" fill="#8B5CF6" stroke="none" stroke-width="2" d="M 175.877 56.717 C 178.677 68.917 181.677 72.917 194.477 75.517 C 181.477 78.117 178.677 81.917 175.877 94.117 C 172.877 81.917 170.077 78.517 157.077 75.517 C 170.077 72.717 172.877 68.917 175.877 56.717 Z" /></g></svg>
|