alinea 2.0.0-preview.13 → 2.0.0-preview.14
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/dist/.init/content/pages/welcome.json +1 -1
- package/dist/.mcp/later/dev.json +1 -1
- package/dist/.mcp/online/dev.json +1 -1
- package/dist/adapter/next/cms.js +6 -2
- package/dist/adapter/next/context.js +1 -4
- package/dist/adapter/next/handler.js +12 -1
- package/dist/backend/CommitEntries.d.ts +17 -0
- package/dist/backend/CommitEntries.js +39 -0
- package/dist/backend/Handler.d.ts +9 -0
- package/dist/backend/Handler.js +80 -20
- package/dist/backend/api/BasicAuth.js +5 -1
- package/dist/backend/api/CreateBackend.js +2 -2
- package/dist/backend/api/DatabaseApi.js +18 -5
- package/dist/backend/api/GithubApi.d.ts +13 -0
- package/dist/backend/api/GithubApi.js +170 -30
- package/dist/backend/api/database.js +2 -2
- package/dist/backend/util/Syncable.d.ts +6 -0
- package/dist/backend/util/Syncable.js +3 -1
- package/dist/bundled.d.ts +911 -151
- package/dist/chunks/{chunk-5H4D5JQL.js → chunk-2PP7WJUJ.js} +1 -11
- package/dist/chunks/{chunk-QHHMKJUO.js → chunk-7DDPSWRY.js} +465 -2
- package/dist/chunks/{chunk-HOETF6HN.js → chunk-PMGIIYDD.js} +1 -0
- package/dist/chunks/{chunk-3QFSGTGF.js → chunk-SCV3TEXM.js} +1 -1
- package/dist/chunks/{chunk-UPY2RUZF.js → chunk-TWBREZWC.js} +30 -0
- package/dist/cli/Generate.js +20 -7
- package/dist/cli/Mcp.js +1 -1
- package/dist/cli/Serve.js +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/build/BuildEmitter.d.ts +5 -1
- package/dist/cli/build/BuildEmitter.js +8 -3
- package/dist/cli/generate/CompileConfig.js +10 -6
- package/dist/cli/generate/DevDB.d.ts +4 -1
- package/dist/cli/generate/DevDB.js +15 -7
- package/dist/cli/generate/GenerateDashboard.js +1 -0
- package/dist/cli/generate/MediaLocations.d.ts +18 -0
- package/dist/cli/generate/MediaLocations.js +69 -0
- package/dist/cli/serve/CreateLocalServer.js +1 -0
- package/dist/cli/serve/mcp/DevMcp.js +1 -1
- package/dist/cloud/CloudRemote.js +21 -7
- package/dist/cms.d.ts +4 -2
- package/dist/components/Alert.js +2 -2
- package/dist/components/AppShell.js +2 -2
- package/dist/components/AsyncList.d.ts +52 -0
- package/dist/components/AsyncList.js +69 -0
- package/dist/components/Breadcrumbs.js +6 -6
- package/dist/components/Button.js +4 -4
- package/dist/components/Calendar.js +18 -18
- package/dist/components/Checkbox.js +10 -10
- package/dist/components/CheckboxGroup.js +2 -2
- package/dist/components/Collapsible.js +5 -5
- package/dist/components/ColorSwatch.js +2 -2
- package/dist/components/ColorSwatchPicker.js +4 -4
- package/dist/components/ComboBox.d.ts +27 -9
- package/dist/components/ComboBox.js +40 -9
- package/dist/components/Command.js +13 -13
- package/dist/components/ContentCard.js +28 -28
- package/dist/components/ContentGrid.js +11 -11
- package/dist/components/DataList.js +1 -1
- package/dist/components/DateField.d.ts +4 -0
- package/dist/components/DateField.js +2 -2
- package/dist/components/DatePicker.js +2 -2
- package/dist/components/DateRangePicker.js +2 -2
- package/dist/components/Dialog.d.ts +14 -3
- package/dist/components/Dialog.js +38 -11
- package/dist/components/DropZone.js +6 -6
- package/dist/components/DropdownMenu.js +8 -8
- package/dist/components/Empty.js +4 -4
- package/dist/components/Field.d.ts +1 -1
- package/dist/components/Field.js +18 -12
- package/dist/components/Form.d.ts +23 -0
- package/dist/components/Form.js +64 -0
- package/dist/components/Link.d.ts +8 -1
- package/dist/components/List.js +27 -27
- package/dist/components/MediaPreview.js +5 -5
- package/dist/components/MultipleSelect.d.ts +13 -8
- package/dist/components/MultipleSelect.js +25 -25
- package/dist/components/NavRail.js +7 -7
- package/dist/components/NumberField.d.ts +5 -1
- package/dist/components/NumberField.js +6 -4
- package/dist/components/Page.js +6 -6
- package/dist/components/Popover.js +2 -2
- package/dist/components/PreviewFrame.js +8 -8
- package/dist/components/RadioGroup.js +10 -10
- package/dist/components/Resizable.js +1 -1
- package/dist/components/SearchField.js +8 -8
- package/dist/components/Select.d.ts +13 -10
- package/dist/components/Select.js +18 -32
- package/dist/components/Sheet.js +6 -6
- package/dist/components/Sidebar.js +5 -5
- package/dist/components/SortableList.js +12 -12
- package/dist/components/Spinner.js +4 -4
- package/dist/components/Stack.d.ts +20 -0
- package/dist/components/Stack.js +45 -0
- package/dist/components/Surface.js +1 -1
- package/dist/components/Switch.js +5 -5
- package/dist/components/Table.d.ts +11 -1
- package/dist/components/Table.js +81 -53
- package/dist/components/Tabs.js +6 -6
- package/dist/components/TagGroup.js +10 -10
- package/dist/components/TextField.d.ts +7 -1
- package/dist/components/TextField.js +20 -11
- package/dist/components/TimeField.d.ts +6 -1
- package/dist/components/TimeField.js +51 -26
- package/dist/components/Timestamp.js +1 -1
- package/dist/components/ToggleGroup.js +2 -2
- package/dist/components/Toolbar.js +3 -3
- package/dist/components/Tooltip.js +5 -4
- package/dist/components/Tree.js +27 -27
- package/dist/components/internal/DateControl.js +11 -11
- package/dist/components/internal/FormScope.d.ts +2 -0
- package/dist/components/internal/FormScope.js +8 -0
- package/dist/components/internal/ListBoxGroup.d.ts +12 -0
- package/dist/components/internal/ListBoxGroup.js +46 -0
- package/dist/components/internal/ListBoxOption.d.ts +2 -2
- package/dist/components/internal/ListBoxOption.js +5 -5
- package/dist/components/internal/Locale.js +2 -2
- package/dist/components/internal/PopoverSurface.js +5 -4
- package/dist/components/internal/SelectionCheckbox.js +5 -5
- package/dist/components/internal/Slot.js +1 -1
- package/dist/components/internal/ToggleButton.js +4 -4
- package/dist/components/internal/Trigger.js +2 -2
- package/dist/components/internal/useDragDrop.js +2 -2
- package/dist/components/types.d.ts +4 -0
- package/dist/components.d.ts +3 -0
- package/dist/components.js +3 -0
- package/dist/core/Client.js +12 -1
- package/dist/core/Config.d.ts +6 -0
- package/dist/core/Config.js +12 -0
- package/dist/core/DashboardEntry.d.ts +19 -0
- package/dist/core/DashboardEntry.js +0 -0
- package/dist/core/Document.d.ts +2 -2
- package/dist/core/Document.js +10 -3
- package/dist/core/EntryFields.d.ts +8 -2
- package/dist/core/Field.d.ts +5 -0
- package/dist/core/Filter.d.ts +19 -2
- package/dist/core/Filter.js +5 -0
- package/dist/core/Graph.d.ts +10 -2
- package/dist/core/Overview.d.ts +74 -5
- package/dist/core/Overview.js +1 -0
- package/dist/core/Root.js +1 -1
- package/dist/core/Scope.d.ts +5 -0
- package/dist/core/Scope.js +22 -5
- package/dist/core/Type.d.ts +25 -6
- package/dist/core/Type.js +25 -7
- package/dist/core/db/LocalStore.d.ts +7 -0
- package/dist/core/field/CreateField.d.ts +1 -2
- package/dist/core/source/Source.d.ts +2 -0
- package/dist/core/source/Source.js +11 -0
- package/dist/core/util/Async.d.ts +2 -0
- package/dist/core/util/Async.js +12 -1
- package/dist/core/util/Checks.js +1 -1
- package/dist/core/util/Slugs.js +4 -3
- package/dist/dashboard/App.css +13 -11
- package/dist/dashboard/App.d.ts +1 -0
- package/dist/dashboard/App.js +22 -6
- package/dist/dashboard/Href.d.ts +37 -0
- package/dist/dashboard/Href.js +46 -0
- package/dist/dashboard/app/ActivityStatus.js +34 -12
- package/dist/dashboard/app/AuthView.js +2 -2
- package/dist/dashboard/app/BlockSettings.d.ts +9 -0
- package/dist/dashboard/app/BlockSettings.js +16 -0
- package/dist/dashboard/app/BlockSheet.js +3 -3
- package/dist/dashboard/app/BlockSheetStoryFrame.js +2 -2
- package/dist/dashboard/app/CompactField.js +15 -15
- package/dist/dashboard/app/CroppedImage.js +2 -2
- package/dist/dashboard/app/DashboardLayout.d.ts +1 -1
- package/dist/dashboard/app/DashboardLayout.js +12 -0
- package/dist/dashboard/app/EntryActions.d.ts +11 -0
- package/dist/dashboard/app/EntryActions.js +30 -0
- package/dist/dashboard/app/EntryFields.d.ts +15 -2
- package/dist/dashboard/app/EntryFields.js +26 -5
- package/dist/dashboard/app/EntryHeader.js +17 -7
- package/dist/dashboard/app/EntryReferences.js +2 -2
- package/dist/dashboard/app/EntrySidebar.js +25 -23
- package/dist/dashboard/app/EntrySidebarPreview.js +2 -2
- package/dist/dashboard/app/EntryValidationModal.js +3 -3
- package/dist/dashboard/app/Explorer.js +84 -45
- package/dist/dashboard/app/ExplorerBatchActions.js +4 -4
- package/dist/dashboard/app/ExplorerControls.js +5 -5
- package/dist/dashboard/app/ExplorerList.js +2 -2
- package/dist/dashboard/app/ExplorerModal.js +3 -3
- package/dist/dashboard/app/ExplorerOverviewHeader.d.ts +6 -0
- package/dist/dashboard/app/ExplorerOverviewHeader.js +28 -0
- package/dist/dashboard/app/ExplorerTable.js +7 -7
- package/dist/dashboard/app/ExplorerTabs.d.ts +12 -0
- package/dist/dashboard/app/ExplorerTabs.js +42 -0
- package/dist/dashboard/app/ImageEditor.js +31 -31
- package/dist/dashboard/app/LinkPicker.js +3 -3
- package/dist/dashboard/app/LocaleMenu.js +9 -9
- package/dist/dashboard/app/MediaPreviewCell.js +5 -5
- package/dist/dashboard/app/OverviewCell.js +12 -10
- package/dist/dashboard/app/RemoveDialog.js +5 -0
- package/dist/dashboard/app/SearchBar.js +4 -4
- package/dist/dashboard/app/SettingsTab.d.ts +6 -0
- package/dist/dashboard/app/SettingsTab.js +27 -0
- package/dist/dashboard/app/SidebarTree.js +19 -19
- package/dist/dashboard/app/WorkspaceMenu.js +6 -6
- package/dist/dashboard/app/WorkspaceRoots.js +102 -98
- package/dist/dashboard/app/editor/FileEditor.js +18 -18
- package/dist/dashboard/app/pages/EntryPage.js +42 -39
- package/dist/dashboard/app/pages/RootPage.js +3 -3
- package/dist/dashboard/app/pages/SplashPage.js +94 -79
- package/dist/dashboard/app/pages/UsersPage.js +9 -9
- package/dist/dashboard/app/ui/DashboardModal.js +14 -14
- package/dist/dashboard/atoms/activity.d.ts +1 -0
- package/dist/dashboard/atoms/activity.js +8 -5
- package/dist/dashboard/atoms/config.d.ts +2 -0
- package/dist/dashboard/atoms/dashboard.d.ts +11 -0
- package/dist/dashboard/atoms/dashboard.js +8 -0
- package/dist/dashboard/atoms/editor.d.ts +7 -1
- package/dist/dashboard/atoms/editor.js +14 -2
- package/dist/dashboard/atoms/explorer.d.ts +15 -0
- package/dist/dashboard/atoms/explorer.js +43 -14
- package/dist/dashboard/atoms/graph.d.ts +5 -0
- package/dist/dashboard/atoms/graph.js +26 -1
- package/dist/dashboard/atoms/nav.d.ts +16 -10
- package/dist/dashboard/atoms/nav.js +96 -36
- package/dist/dashboard/atoms/overview.d.ts +26 -4
- package/dist/dashboard/atoms/overview.js +41 -12
- package/dist/dashboard/atoms/root.js +7 -1
- package/dist/dashboard/boot/ActivityEvent.d.ts +1 -1
- package/dist/dashboard/boot/Boot.js +6 -0
- package/dist/dashboard/boot/DashboardWorker.d.ts +6 -0
- package/dist/dashboard/boot/DashboardWorker.js +89 -8
- package/dist/dashboard/boot/LoadWorker.js +3 -0
- package/dist/dashboard/boot/SyncEvent.d.ts +7 -0
- package/dist/dashboard/boot/SyncEvent.js +14 -0
- package/dist/dashboard/boot/WorkerDB.d.ts +1 -0
- package/dist/dashboard/boot/WorkerDB.js +3 -0
- package/dist/dashboard/cms/EntryTable.d.ts +4 -3
- package/dist/dashboard/cms/EntryTable.js +2 -2
- package/dist/dashboard/cms/ViewProps.d.ts +3 -2
- package/dist/dashboard/cms/hooks.d.ts +34 -18
- package/dist/dashboard/cms/hooks.js +43 -18
- package/dist/dashboard/contexts.d.ts +3 -2
- package/dist/dashboard/contexts.js +3 -2
- package/dist/dashboard/hook/UseEntryEditor.d.ts +1 -1
- package/dist/dashboard/hook/UseEntryEditor.js +7 -3
- package/dist/dashboard/icons.d.ts +1 -0
- package/dist/dashboard/icons.js +15 -0
- package/dist/database/BrowserEntryStore.js +35 -13
- package/dist/database/DatabaseTables.js +1 -1
- package/dist/database/EntryDatabase.d.ts +10 -1
- package/dist/database/EntryDatabase.js +31 -10
- package/dist/database/EntryStore.js +1 -11
- package/dist/database/entry/EntryTable.d.ts +5 -3
- package/dist/database/entry/EntryTable.js +25 -8
- package/dist/database/query/Condition.d.ts +4 -1
- package/dist/database/query/Condition.js +16 -5
- package/dist/database/query/EntryQuery.js +59 -7
- package/dist/database/query/Relation.d.ts +13 -1
- package/dist/database/query/Relation.js +19 -1
- package/dist/database/query/Search.d.ts +7 -1
- package/dist/database/query/Search.js +54 -9
- package/dist/database/sync/EntrySyncer.d.ts +2 -0
- package/dist/database/sync/EntrySyncer.js +4 -2
- package/dist/database/sync/Ingest.d.ts +2 -1
- package/dist/database/sync/Ingest.js +20 -6
- package/dist/field/code/CodeField.view.js +12 -12
- package/dist/field/link/EntryLink.d.ts +4 -5
- package/dist/field/link/FileLink.d.ts +2 -2
- package/dist/field/link/ImageLink.d.ts +2 -5
- package/dist/field/link/ImageLink.js +0 -1
- package/dist/field/link/LinkField.view.js +18 -15
- package/dist/field/list/ListField.view.js +50 -35
- package/dist/field/metadata/MetadataField.view.js +14 -14
- package/dist/field/richtext/RichTextBlock.js +39 -35
- package/dist/field/richtext/RichTextExtensions.js +23 -23
- package/dist/field/richtext/RichTextField.view.js +6 -6
- package/dist/field/richtext/RichTextInsertMenu.js +5 -5
- package/dist/field/richtext/RichTextToolbar.js +26 -1
- package/dist/field/richtext/Toolbar.d.ts +9 -1
- package/dist/field/richtext/Toolbar.js +12 -2
- package/dist/field/select/SelectField.view.js +1 -0
- package/dist/index.css +174 -23
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/next.d.ts +2 -0
- package/dist/next.edge.d.ts +2 -0
- package/dist/picker/entry/EntryPicker.d.ts +3 -1
- package/dist/picker/entry/EntryPicker.js +15 -1
- package/dist/preview/react.js +3 -0
- package/dist/query.d.ts +26 -14
- package/dist/query.js +4 -0
- package/dist/types.d.ts +8 -5
- package/dist/ui/Stack.d.ts +4 -2
- package/docs/ai-setup.md +3 -3
- package/docs/cli.md +4 -2
- package/docs/components/combo-box.md +105 -16
- package/docs/components/date-field.md +1 -1
- package/docs/components/dialog.md +51 -0
- package/docs/components/form.md +67 -0
- package/docs/components/link.md +10 -0
- package/docs/components/multiple-select.md +9 -17
- package/docs/components/number-field.md +5 -1
- package/docs/components/select.md +9 -20
- package/docs/components/stack.md +42 -0
- package/docs/components/table.md +83 -0
- package/docs/components/text-field.md +9 -1
- package/docs/components/time-field.md +5 -1
- package/docs/components.md +39 -1
- package/docs/configuration.md +3 -1
- package/docs/custom-fields.md +135 -7
- package/docs/deploy/self-host.md +2 -0
- package/docs/deploy.md +7 -4
- package/docs/fields/image.md +0 -1
- package/docs/fields/list.md +19 -0
- package/docs/fields/object.md +5 -3
- package/docs/fields/rich-text.md +31 -0
- package/docs/index.md +8 -6
- package/docs/instant-publishing.md +23 -2
- package/docs/overviews.md +128 -4
- package/docs/query/filtering.md +2 -0
- package/docs/query/related.md +58 -9
- package/docs/query.md +52 -1
- package/docs/quickstart.md +5 -5
- package/docs/schema/document.md +2 -0
- package/docs/schema/type.md +3 -1
- package/docs/upgrading.md +100 -19
- package/llms-full.txt +1022 -125
- package/package.json +1 -1
- package/readme.md +2 -2
- package/dist/chunks/{chunk-4ZA6KZHS.js → chunk-6FQ5IMNA.js} +3 -3
|
@@ -30,7 +30,7 @@ import { MediaFile, MediaLibrary } from "alinea/core/media/MediaTypes";
|
|
|
30
30
|
import { assert } from "alinea/core/util/Assert";
|
|
31
31
|
import { typeAtoms } from "alinea/dashboard/atoms/config";
|
|
32
32
|
import { configAtom } from "alinea/dashboard/atoms/core";
|
|
33
|
-
import {
|
|
33
|
+
import { entrySidebarOpen } from "alinea/dashboard/atoms/dashboard";
|
|
34
34
|
import {
|
|
35
35
|
entryAtoms,
|
|
36
36
|
MissingEntryError
|
|
@@ -56,6 +56,7 @@ import { FileEditor } from "./../editor/FileEditor.js";
|
|
|
56
56
|
import { CreateEntryButton } from "./../DashboardLayout.js";
|
|
57
57
|
import { EntryFields } from "./../EntryFields.js";
|
|
58
58
|
import { NodeEditor } from "./../NodeEditor.js";
|
|
59
|
+
import { withSettingsTab } from "../SettingsTab.js";
|
|
59
60
|
import { EntryHeader } from "./../EntryHeader.js";
|
|
60
61
|
import { entryDirtyActions } from "./../EntryHeaderActions.js";
|
|
61
62
|
import {
|
|
@@ -79,23 +80,28 @@ import {
|
|
|
79
80
|
|
|
80
81
|
// src/dashboard/app/pages/EntryPage.module.css
|
|
81
82
|
var EntryPage_default = {
|
|
82
|
-
"EntryEditor
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
83
|
+
"EntryEditor": "alinea-EntryEditor",
|
|
84
|
+
"EntryEditor-banner": "alinea-EntryEditor-banner",
|
|
85
|
+
"EntryEditorBanner": "alinea-EntryEditor-banner",
|
|
86
|
+
"EntryOverview-mobileActions": "alinea-EntryOverview-mobileActions",
|
|
87
|
+
"EntryOverviewMobileActions": "alinea-EntryOverview-mobileActions",
|
|
88
|
+
"EntryEditor-fields": "alinea-EntryEditor-fields",
|
|
89
|
+
"EntryEditorFields": "alinea-EntryEditor-fields",
|
|
90
|
+
"EntryEditor-view": "alinea-EntryEditor-view",
|
|
91
|
+
"EntryEditorView": "alinea-EntryEditor-view",
|
|
86
92
|
"EntryEditorLayout-sidebar": "alinea-EntryEditorLayout-sidebar",
|
|
87
93
|
"EntryEditorLayoutSidebar": "alinea-EntryEditorLayout-sidebar",
|
|
88
|
-
"EntryEditor-toolbar": "alinea-EntryEditor-toolbar",
|
|
89
|
-
"EntryEditorToolbar": "alinea-EntryEditor-toolbar",
|
|
90
94
|
"EntryEditorContent-navigationActions": "alinea-EntryEditorContent-navigationActions",
|
|
91
95
|
"EntryEditorContentNavigationActions": "alinea-EntryEditorContent-navigationActions",
|
|
92
|
-
"EntryEditor-fields": "alinea-EntryEditor-fields",
|
|
93
|
-
"EntryEditorFields": "alinea-EntryEditor-fields",
|
|
94
|
-
"EntryEditor-banner": "alinea-EntryEditor-banner",
|
|
95
|
-
"EntryEditorBanner": "alinea-EntryEditor-banner",
|
|
96
96
|
"MissingEntry": "alinea-MissingEntry",
|
|
97
|
-
"
|
|
98
|
-
"
|
|
97
|
+
"MissingEntry-media": "alinea-MissingEntry-media",
|
|
98
|
+
"MissingEntryMedia": "alinea-MissingEntry-media",
|
|
99
|
+
"EntryEditor-body": "alinea-EntryEditor-body",
|
|
100
|
+
"EntryEditorBody": "alinea-EntryEditor-body",
|
|
101
|
+
"EntryEditor-viewBanner": "alinea-EntryEditor-viewBanner",
|
|
102
|
+
"EntryEditorViewBanner": "alinea-EntryEditor-viewBanner",
|
|
103
|
+
"EntryEditor-toolbar": "alinea-EntryEditor-toolbar",
|
|
104
|
+
"EntryEditorToolbar": "alinea-EntryEditor-toolbar"
|
|
99
105
|
};
|
|
100
106
|
|
|
101
107
|
// src/dashboard/app/pages/EntryPage.tsx
|
|
@@ -125,10 +131,10 @@ var entryPage = page(async (page2, get) => {
|
|
|
125
131
|
}
|
|
126
132
|
const selectedNode = await get(localeData.selectedNode);
|
|
127
133
|
const richTextImages = await get(localeData.richTextImages);
|
|
128
|
-
const parentNeedsTranslation =
|
|
134
|
+
const parentNeedsTranslation = await get(localeData.parentNeedsTranslation);
|
|
129
135
|
const sourceLocale = get(localeData.translationSourceLocale);
|
|
130
136
|
const copyTranslationSource = get(localeData.copyTranslationSource);
|
|
131
|
-
const isSidebarOpen = get(
|
|
137
|
+
const isSidebarOpen = get(entrySidebarOpen(Boolean(get(entry.preview))));
|
|
132
138
|
const sidebar = await entrySidebar(get, entry, localeData, isSidebarOpen);
|
|
133
139
|
return /* @__PURE__ */ jsx(
|
|
134
140
|
EntryEditorContent,
|
|
@@ -288,7 +294,9 @@ function EntryEditorContent({
|
|
|
288
294
|
const reset = useSetAtom(node.reset);
|
|
289
295
|
const [routeBlock, setRouteBlock] = useAtom(routeBlockAtom);
|
|
290
296
|
const setRouteGuard = useSetAtom(routeGuardAtom);
|
|
291
|
-
const setSidebarOpen = useSetAtom(
|
|
297
|
+
const setSidebarOpen = useSetAtom(
|
|
298
|
+
entrySidebarOpen(Boolean(useAtomValueRaw(entry.preview)))
|
|
299
|
+
);
|
|
292
300
|
const editorBodyRef = useRef(null);
|
|
293
301
|
const isMediaFile = type.type === MediaFile;
|
|
294
302
|
const isMediaLibrary = type.type === MediaLibrary;
|
|
@@ -324,6 +332,17 @@ function EntryEditorContent({
|
|
|
324
332
|
useLayoutEffect(() => {
|
|
325
333
|
if (editorBodyRef.current) editorBodyRef.current.scrollTop = 0;
|
|
326
334
|
}, [entry.id]);
|
|
335
|
+
const translationBanner = isUntranslated && /* @__PURE__ */ jsx(
|
|
336
|
+
EntryTranslationBanner,
|
|
337
|
+
{
|
|
338
|
+
copyFromSource: copyTranslationSource,
|
|
339
|
+
parentNeedsTranslation,
|
|
340
|
+
sourceLocale,
|
|
341
|
+
sourceLocales,
|
|
342
|
+
onCopyFromSourceChange: setCopyTranslationSource,
|
|
343
|
+
onSourceLocaleChange: setSourceLocale
|
|
344
|
+
}
|
|
345
|
+
);
|
|
327
346
|
let editorBody = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
328
347
|
PageContent,
|
|
329
348
|
{
|
|
@@ -331,18 +350,8 @@ function EntryEditorContent({
|
|
|
331
350
|
contained: true,
|
|
332
351
|
className: styles.EntryEditor.body(),
|
|
333
352
|
children: /* @__PURE__ */ jsxs("div", { className: styles.EntryEditor.fields(), children: [
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
{
|
|
337
|
-
copyFromSource: copyTranslationSource,
|
|
338
|
-
parentNeedsTranslation,
|
|
339
|
-
sourceLocale,
|
|
340
|
-
sourceLocales,
|
|
341
|
-
onCopyFromSourceChange: setCopyTranslationSource,
|
|
342
|
-
onSourceLocaleChange: setSourceLocale
|
|
343
|
-
}
|
|
344
|
-
) }),
|
|
345
|
-
/* @__PURE__ */ jsx(NodeEditor, { node, type: type.type, children: /* @__PURE__ */ jsx(EntryFields, {}) })
|
|
353
|
+
translationBanner && /* @__PURE__ */ jsx("div", { className: styles.EntryEditor.banner(), children: translationBanner }),
|
|
354
|
+
/* @__PURE__ */ jsx(NodeEditor, { node, type: withSettingsTab(type.type), children: /* @__PURE__ */ jsx(EntryFields, {}) })
|
|
346
355
|
] })
|
|
347
356
|
}
|
|
348
357
|
) });
|
|
@@ -356,18 +365,12 @@ function EntryEditorContent({
|
|
|
356
365
|
) }) }) });
|
|
357
366
|
}
|
|
358
367
|
if (View) {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
{
|
|
362
|
-
|
|
363
|
-
localeData,
|
|
364
|
-
richTextImages,
|
|
365
|
-
selectedEntry,
|
|
366
|
-
children: /* @__PURE__ */ jsx(View, { type: type.type })
|
|
367
|
-
}
|
|
368
|
-
);
|
|
368
|
+
editorBody = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
369
|
+
translationBanner && /* @__PURE__ */ jsx("div", { className: styles.EntryEditor.viewBanner(), children: translationBanner }),
|
|
370
|
+
/* @__PURE__ */ jsx(PageContent, { ref: editorBodyRef, className: styles.EntryEditor.view(), children: /* @__PURE__ */ jsx(NodeEditor, { node, type: withSettingsTab(type.type), children: /* @__PURE__ */ jsx(View, { type: type.type }) }) })
|
|
371
|
+
] });
|
|
369
372
|
}
|
|
370
|
-
const mainEditor = /* @__PURE__ */ jsxs(PageLayout, { children: [
|
|
373
|
+
const mainEditor = /* @__PURE__ */ jsxs(PageLayout, { className: styles.EntryEditor(), children: [
|
|
371
374
|
/* @__PURE__ */ jsx(
|
|
372
375
|
EntryHeader,
|
|
373
376
|
{
|
|
@@ -19,10 +19,10 @@ import { NotFoundPanel } from "./EntryPage.js";
|
|
|
19
19
|
|
|
20
20
|
// src/dashboard/app/pages/RootPage.module.css
|
|
21
21
|
var RootPage_default = {
|
|
22
|
-
"RootPage-customView": "alinea-RootPage-customView",
|
|
23
|
-
"RootPageCustomView": "alinea-RootPage-customView",
|
|
24
22
|
"RootPage-mobileActions": "alinea-RootPage-mobileActions",
|
|
25
|
-
"RootPageMobileActions": "alinea-RootPage-mobileActions"
|
|
23
|
+
"RootPageMobileActions": "alinea-RootPage-mobileActions",
|
|
24
|
+
"RootPage-customView": "alinea-RootPage-customView",
|
|
25
|
+
"RootPageCustomView": "alinea-RootPage-customView"
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
// src/dashboard/app/pages/RootPage.tsx
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useSetAtom
|
|
3
3
|
} from "../../../chunks/chunk-D6UJHBJJ.js";
|
|
4
|
-
import
|
|
4
|
+
import {
|
|
5
|
+
atom
|
|
6
|
+
} from "../../../chunks/chunk-CFNRVI3Y.js";
|
|
5
7
|
import {
|
|
6
8
|
styler
|
|
7
9
|
} from "../../../chunks/chunk-I4OYYAX5.js";
|
|
@@ -30,6 +32,7 @@ import { routeAtom } from "alinea/dashboard/atoms/nav";
|
|
|
30
32
|
import { rootAtoms } from "alinea/dashboard/atoms/root";
|
|
31
33
|
import { workspaceAtom, workspacesAtom } from "alinea/dashboard/atoms/config";
|
|
32
34
|
import { canManageMembersAtom, policyAtom } from "alinea/dashboard/atoms/user";
|
|
35
|
+
import { dispense } from "alinea/dashboard/atoms/utils";
|
|
33
36
|
import { useUser } from "alinea/dashboard/hooks";
|
|
34
37
|
import {
|
|
35
38
|
IcBaselineAccountCircle,
|
|
@@ -44,70 +47,117 @@ import { GlobalSearch, WorkspaceAvatar } from "../WorkspaceMenu.js";
|
|
|
44
47
|
|
|
45
48
|
// src/dashboard/app/pages/SplashPage.module.css
|
|
46
49
|
var SplashPage_default = {
|
|
47
|
-
"SplashPage-
|
|
48
|
-
"
|
|
49
|
-
"SplashPage-
|
|
50
|
-
"
|
|
51
|
-
"SplashPage-
|
|
52
|
-
"
|
|
53
|
-
"SplashPage-
|
|
54
|
-
"
|
|
55
|
-
"SplashPage-sidebar-content": "alinea-SplashPage-sidebar-content",
|
|
56
|
-
"SplashPageSidebarContent": "alinea-SplashPage-sidebar-content",
|
|
57
|
-
"SplashPage-entry": "alinea-SplashPage-entry",
|
|
58
|
-
"SplashPageEntry": "alinea-SplashPage-entry",
|
|
59
|
-
"SplashPage-entry-user": "alinea-SplashPage-entry-user",
|
|
60
|
-
"SplashPageEntryUser": "alinea-SplashPage-entry-user",
|
|
50
|
+
"SplashPage-entry-visual": "alinea-SplashPage-entry-visual",
|
|
51
|
+
"SplashPageEntryVisual": "alinea-SplashPage-entry-visual",
|
|
52
|
+
"SplashPage-grid": "alinea-SplashPage-grid",
|
|
53
|
+
"SplashPageGrid": "alinea-SplashPage-grid",
|
|
54
|
+
"SplashPage-entry-visual-icon": "alinea-SplashPage-entry-visual-icon",
|
|
55
|
+
"SplashPageEntryVisualIcon": "alinea-SplashPage-entry-visual-icon",
|
|
56
|
+
"SplashPage-root": "alinea-SplashPage-root",
|
|
57
|
+
"SplashPageRoot": "alinea-SplashPage-root",
|
|
61
58
|
"SplashPage-entry-content": "alinea-SplashPage-entry-content",
|
|
62
59
|
"SplashPageEntryContent": "alinea-SplashPage-entry-content",
|
|
60
|
+
"SplashPage-action": "alinea-SplashPage-action",
|
|
61
|
+
"SplashPageAction": "alinea-SplashPage-action",
|
|
63
62
|
"SplashPage-entry-primary": "alinea-SplashPage-entry-primary",
|
|
64
63
|
"SplashPageEntryPrimary": "alinea-SplashPage-entry-primary",
|
|
65
|
-
"SplashPage
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"SplashPageCardHeaderButton": "alinea-SplashPage-card-header-button",
|
|
69
|
-
"SplashPage-sidebar": "alinea-SplashPage-sidebar",
|
|
70
|
-
"SplashPageSidebar": "alinea-SplashPage-sidebar",
|
|
64
|
+
"SplashPage": "alinea-SplashPage",
|
|
65
|
+
"SplashPage-entry-title": "alinea-SplashPage-entry-title",
|
|
66
|
+
"SplashPageEntryTitle": "alinea-SplashPage-entry-title",
|
|
71
67
|
"SplashPage-entry-meta": "alinea-SplashPage-entry-meta",
|
|
72
68
|
"SplashPageEntryMeta": "alinea-SplashPage-entry-meta",
|
|
73
|
-
"SplashPage-actionIcon": "alinea-SplashPage-actionIcon",
|
|
74
|
-
"SplashPageActionIcon": "alinea-SplashPage-actionIcon",
|
|
75
|
-
"SplashPage-entry-visual": "alinea-SplashPage-entry-visual",
|
|
76
|
-
"SplashPageEntryVisual": "alinea-SplashPage-entry-visual",
|
|
77
69
|
"SplashPage-entries": "alinea-SplashPage-entries",
|
|
78
70
|
"SplashPageEntries": "alinea-SplashPage-entries",
|
|
79
|
-
"SplashPage-
|
|
80
|
-
"
|
|
81
|
-
"SplashPage-
|
|
82
|
-
"
|
|
83
|
-
"SplashPage-
|
|
84
|
-
"
|
|
71
|
+
"SplashPage-card-header-button": "alinea-SplashPage-card-header-button",
|
|
72
|
+
"SplashPageCardHeaderButton": "alinea-SplashPage-card-header-button",
|
|
73
|
+
"SplashPage-card-header": "alinea-SplashPage-card-header",
|
|
74
|
+
"SplashPageCardHeader": "alinea-SplashPage-card-header",
|
|
75
|
+
"SplashPage-actionIcon": "alinea-SplashPage-actionIcon",
|
|
76
|
+
"SplashPageActionIcon": "alinea-SplashPage-actionIcon",
|
|
77
|
+
"SplashPage-entry": "alinea-SplashPage-entry",
|
|
78
|
+
"SplashPageEntry": "alinea-SplashPage-entry",
|
|
79
|
+
"SplashPage-card-footer": "alinea-SplashPage-card-footer",
|
|
80
|
+
"SplashPageCardFooter": "alinea-SplashPage-card-footer",
|
|
81
|
+
"SplashPage-card-header-content": "alinea-SplashPage-card-header-content",
|
|
82
|
+
"SplashPageCardHeaderContent": "alinea-SplashPage-card-header-content",
|
|
83
|
+
"SplashPage-entry-user": "alinea-SplashPage-entry-user",
|
|
84
|
+
"SplashPageEntryUser": "alinea-SplashPage-entry-user",
|
|
85
|
+
"SplashPage-card": "alinea-SplashPage-card",
|
|
86
|
+
"SplashPageCard": "alinea-SplashPage-card",
|
|
85
87
|
"SplashPage-card-header-title": "alinea-SplashPage-card-header-title",
|
|
86
88
|
"SplashPageCardHeaderTitle": "alinea-SplashPage-card-header-title",
|
|
87
|
-
"SplashPage-
|
|
88
|
-
"
|
|
89
|
-
"SplashPage-
|
|
90
|
-
"
|
|
89
|
+
"SplashPage-sidebar": "alinea-SplashPage-sidebar",
|
|
90
|
+
"SplashPageSidebar": "alinea-SplashPage-sidebar",
|
|
91
|
+
"SplashPage-content": "alinea-SplashPage-content",
|
|
92
|
+
"SplashPageContent": "alinea-SplashPage-content",
|
|
93
|
+
"SplashPage-sidebar-content": "alinea-SplashPage-sidebar-content",
|
|
94
|
+
"SplashPageSidebarContent": "alinea-SplashPage-sidebar-content",
|
|
95
|
+
"SplashPage-card-header-label": "alinea-SplashPage-card-header-label",
|
|
96
|
+
"SplashPageCardHeaderLabel": "alinea-SplashPage-card-header-label",
|
|
91
97
|
"SplashPage-appearance": "alinea-SplashPage-appearance",
|
|
92
98
|
"SplashPageAppearance": "alinea-SplashPage-appearance",
|
|
93
|
-
"SplashPage-
|
|
94
|
-
"
|
|
95
|
-
"SplashPage": "alinea-SplashPage",
|
|
96
|
-
"SplashPage-card-header": "alinea-SplashPage-card-header",
|
|
97
|
-
"SplashPageCardHeader": "alinea-SplashPage-card-header"
|
|
99
|
+
"SplashPage-user": "alinea-SplashPage-user",
|
|
100
|
+
"SplashPageUser": "alinea-SplashPage-user"
|
|
98
101
|
};
|
|
99
102
|
|
|
100
103
|
// src/dashboard/app/pages/SplashPage.tsx
|
|
101
104
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
102
105
|
var styles = styler(SplashPage_default);
|
|
103
106
|
var recentEntryCount = 3;
|
|
104
|
-
var recentCandidateWindowSize = recentEntryCount;
|
|
105
107
|
var visibleRootCount = 2;
|
|
106
108
|
var futureTimestampTolerance = 24 * 60 * 60 * 1e3;
|
|
109
|
+
var recentEntriesAtom = dispense(
|
|
110
|
+
(key) => atom(async (get) => {
|
|
111
|
+
await get(shaAtom);
|
|
112
|
+
const graph = get(graphAtom);
|
|
113
|
+
const policy = get(policyAtom);
|
|
114
|
+
const workspace = get(workspaceAtom(key));
|
|
115
|
+
const readableRoots = Object.keys(workspace.roots).filter(
|
|
116
|
+
(root) => policy.canRead({ workspace: key, root })
|
|
117
|
+
);
|
|
118
|
+
if (!readableRoots.length) return [];
|
|
119
|
+
const everyRoot = readableRoots.length === Object.keys(workspace.roots).length;
|
|
120
|
+
const locales = Math.max(
|
|
121
|
+
1,
|
|
122
|
+
...readableRoots.map(
|
|
123
|
+
(root) => getRoot(workspace.roots[root]).i18n?.locales.length ?? 1
|
|
124
|
+
)
|
|
125
|
+
);
|
|
126
|
+
const candidates = await Promise.all(
|
|
127
|
+
[
|
|
128
|
+
{ orderBy: { desc: Entry.updatedAt } },
|
|
129
|
+
{ orderBy: { desc: Entry.id }, filter: { _updatedAt: null } }
|
|
130
|
+
].map(
|
|
131
|
+
(order) => graph.find({
|
|
132
|
+
...order,
|
|
133
|
+
workspace: key,
|
|
134
|
+
root: everyRoot ? void 0 : { in: readableRoots },
|
|
135
|
+
status: "preferDraft",
|
|
136
|
+
take: recentEntryCount * locales,
|
|
137
|
+
select: recentEntrySelection
|
|
138
|
+
})
|
|
139
|
+
)
|
|
140
|
+
);
|
|
141
|
+
const readable = candidates.flat().filter((entry) => policy.canRead(entry));
|
|
142
|
+
const now = Date.now();
|
|
143
|
+
const trustsIdTimestamps = readable.every((entry) => {
|
|
144
|
+
const timestamp = timestampFromId(entry.id);
|
|
145
|
+
return timestamp === void 0 || timestamp <= now + futureTimestampTolerance;
|
|
146
|
+
});
|
|
147
|
+
const latest = /* @__PURE__ */ new Map();
|
|
148
|
+
for (const row of readable) {
|
|
149
|
+
const entry = toRecentEntry(row, trustsIdTimestamps, now);
|
|
150
|
+
if (!entry) continue;
|
|
151
|
+
const seen = latest.get(entry.id);
|
|
152
|
+
if (!seen || entry.changedAt > seen.changedAt) latest.set(entry.id, entry);
|
|
153
|
+
}
|
|
154
|
+
return Array.from(latest.values()).sort(
|
|
155
|
+
(a, b) => b.changedAt - a.changedAt || (a.id < b.id ? 1 : a.id > b.id ? -1 : 0)
|
|
156
|
+
).slice(0, recentEntryCount);
|
|
157
|
+
})
|
|
158
|
+
);
|
|
107
159
|
async function splashPage(get) {
|
|
108
160
|
const canManageMembers = await get(canManageMembersAtom);
|
|
109
|
-
await get(shaAtom);
|
|
110
|
-
const graph = get(graphAtom);
|
|
111
161
|
const config = get(configAtom);
|
|
112
162
|
const policy = get(policyAtom);
|
|
113
163
|
const summaries = await Promise.all(
|
|
@@ -121,42 +171,7 @@ async function splashPage(get) {
|
|
|
121
171
|
return [{ icon, key: rootKey, label }];
|
|
122
172
|
}
|
|
123
173
|
);
|
|
124
|
-
const
|
|
125
|
-
roots.flatMap(({ key: root }) => [
|
|
126
|
-
graph.find({
|
|
127
|
-
workspace: key,
|
|
128
|
-
root,
|
|
129
|
-
status: "preferDraft",
|
|
130
|
-
groupBy: Entry.id,
|
|
131
|
-
orderBy: { desc: Entry.updatedAt },
|
|
132
|
-
take: recentCandidateWindowSize,
|
|
133
|
-
select: recentEntrySelection
|
|
134
|
-
}),
|
|
135
|
-
graph.find({
|
|
136
|
-
workspace: key,
|
|
137
|
-
root,
|
|
138
|
-
status: "preferDraft",
|
|
139
|
-
groupBy: Entry.id,
|
|
140
|
-
orderBy: { desc: Entry.id },
|
|
141
|
-
take: recentCandidateWindowSize,
|
|
142
|
-
select: recentEntrySelection
|
|
143
|
-
})
|
|
144
|
-
])
|
|
145
|
-
);
|
|
146
|
-
const readableCandidates = candidates.flat().filter((entry) => policy.canRead(entry));
|
|
147
|
-
const now = Date.now();
|
|
148
|
-
const trustsIdTimestamps = readableCandidates.every((entry) => {
|
|
149
|
-
const timestamp = timestampFromId(entry.id);
|
|
150
|
-
return timestamp === void 0 || timestamp <= now + futureTimestampTolerance;
|
|
151
|
-
});
|
|
152
|
-
const recentEntries = Array.from(
|
|
153
|
-
new Map(
|
|
154
|
-
readableCandidates.map((entry) => [
|
|
155
|
-
entry.id,
|
|
156
|
-
toRecentEntry(entry, trustsIdTimestamps, now)
|
|
157
|
-
])
|
|
158
|
-
).values()
|
|
159
|
-
).filter((entry) => Boolean(entry)).sort((a, b) => b.changedAt - a.changedAt).slice(0, recentEntryCount);
|
|
174
|
+
const recentEntries = await get(recentEntriesAtom(key));
|
|
160
175
|
const entries = recentEntries.map((entry) => {
|
|
161
176
|
const type = config.schema[entry.type];
|
|
162
177
|
return {
|
|
@@ -61,23 +61,23 @@ import {
|
|
|
61
61
|
|
|
62
62
|
// src/dashboard/app/pages/UsersPage.module.css
|
|
63
63
|
var UsersPage_default = {
|
|
64
|
-
"UsersPage-roles": "alinea-UsersPage-roles",
|
|
65
|
-
"UsersPageRoles": "alinea-UsersPage-roles",
|
|
66
|
-
"UsersPage-identity": "alinea-UsersPage-identity",
|
|
67
|
-
"UsersPageIdentity": "alinea-UsersPage-identity",
|
|
68
|
-
"UsersPage": "alinea-UsersPage",
|
|
69
64
|
"UsersPage-header": "alinea-UsersPage-header",
|
|
70
65
|
"UsersPageHeader": "alinea-UsersPage-header",
|
|
71
|
-
"UsersPage-
|
|
72
|
-
"
|
|
66
|
+
"UsersPage-status": "alinea-UsersPage-status",
|
|
67
|
+
"UsersPageStatus": "alinea-UsersPage-status",
|
|
68
|
+
"UsersPage-identity": "alinea-UsersPage-identity",
|
|
69
|
+
"UsersPageIdentity": "alinea-UsersPage-identity",
|
|
70
|
+
"UsersPage-roles": "alinea-UsersPage-roles",
|
|
71
|
+
"UsersPageRoles": "alinea-UsersPage-roles",
|
|
73
72
|
"UsersPage-search": "alinea-UsersPage-search",
|
|
74
73
|
"UsersPageSearch": "alinea-UsersPage-search",
|
|
74
|
+
"UsersPage-table": "alinea-UsersPage-table",
|
|
75
|
+
"UsersPageTable": "alinea-UsersPage-table",
|
|
76
|
+
"UsersPage": "alinea-UsersPage",
|
|
75
77
|
"UsersPage-createButton": "alinea-UsersPage-createButton",
|
|
76
78
|
"UsersPageCreateButton": "alinea-UsersPage-createButton",
|
|
77
79
|
"UsersPage-content": "alinea-UsersPage-content",
|
|
78
80
|
"UsersPageContent": "alinea-UsersPage-content",
|
|
79
|
-
"UsersPage-status": "alinea-UsersPage-status",
|
|
80
|
-
"UsersPageStatus": "alinea-UsersPage-status",
|
|
81
81
|
"UsersPage-form-fields": "alinea-UsersPage-form-fields",
|
|
82
82
|
"UsersPageFormFields": "alinea-UsersPage-form-fields"
|
|
83
83
|
};
|
|
@@ -25,28 +25,28 @@ import { BlockSheetBoundary } from "../BlockSheet.js";
|
|
|
25
25
|
|
|
26
26
|
// src/dashboard/app/ui/DashboardModal.module.css
|
|
27
27
|
var DashboardModal_default = {
|
|
28
|
-
"DashboardModalFormBody": "alinea-DashboardModalFormBody",
|
|
29
|
-
"DashboardModalDialog-loader": "alinea-DashboardModalDialog-loader",
|
|
30
|
-
"DashboardModalDialogLoader": "alinea-DashboardModalDialog-loader",
|
|
31
|
-
"DashboardModalFormHeader": "alinea-DashboardModalFormHeader",
|
|
32
|
-
"is-loading": "alinea-is-loading",
|
|
33
|
-
"isLoading": "alinea-is-loading",
|
|
34
|
-
"DashboardModalCloseButton": "alinea-DashboardModalCloseButton",
|
|
35
|
-
"DashboardModalContent": "alinea-DashboardModalContent",
|
|
36
|
-
"DashboardModalTitle": "alinea-DashboardModalTitle",
|
|
37
|
-
"DashboardModalFormFooter": "alinea-DashboardModalFormFooter",
|
|
38
|
-
"DashboardModalDialog": "alinea-DashboardModalDialog",
|
|
39
28
|
"DashboardModalFooter": "alinea-DashboardModalFooter",
|
|
40
29
|
"DashboardModal": "alinea-DashboardModal",
|
|
41
|
-
"DashboardModalForm": "alinea-DashboardModalForm",
|
|
42
30
|
"DashboardModalDialog-header": "alinea-DashboardModalDialog-header",
|
|
43
31
|
"DashboardModalDialogHeader": "alinea-DashboardModalDialog-header",
|
|
32
|
+
"DashboardModal-surface": "alinea-DashboardModal-surface",
|
|
33
|
+
"DashboardModalSurface": "alinea-DashboardModal-surface",
|
|
44
34
|
"DashboardModal-enter": "alinea-DashboardModal-enter",
|
|
45
35
|
"DashboardModalEnter": "alinea-DashboardModal-enter",
|
|
36
|
+
"DashboardModalDialog-loader": "alinea-DashboardModalDialog-loader",
|
|
37
|
+
"DashboardModalDialogLoader": "alinea-DashboardModalDialog-loader",
|
|
38
|
+
"DashboardModalContent": "alinea-DashboardModalContent",
|
|
46
39
|
"DashboardModalDialog-controls": "alinea-DashboardModalDialog-controls",
|
|
47
40
|
"DashboardModalDialogControls": "alinea-DashboardModalDialog-controls",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
41
|
+
"DashboardModalTitle": "alinea-DashboardModalTitle",
|
|
42
|
+
"DashboardModalFormHeader": "alinea-DashboardModalFormHeader",
|
|
43
|
+
"is-loading": "alinea-is-loading",
|
|
44
|
+
"isLoading": "alinea-is-loading",
|
|
45
|
+
"DashboardModalFormBody": "alinea-DashboardModalFormBody",
|
|
46
|
+
"DashboardModalCloseButton": "alinea-DashboardModalCloseButton",
|
|
47
|
+
"DashboardModalDialog": "alinea-DashboardModalDialog",
|
|
48
|
+
"DashboardModalFormFooter": "alinea-DashboardModalFormFooter",
|
|
49
|
+
"DashboardModalForm": "alinea-DashboardModalForm"
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
// src/dashboard/app/ui/DashboardModal.tsx
|
|
@@ -152,8 +152,8 @@ var uploadProgressAtom = atom(
|
|
|
152
152
|
}
|
|
153
153
|
);
|
|
154
154
|
function activityState(items) {
|
|
155
|
-
const
|
|
156
|
-
(activity) => activity.type
|
|
155
|
+
const hasFailedRetryable = items.some(
|
|
156
|
+
(activity) => activity.type !== "upload" && activity.status === "failed"
|
|
157
157
|
);
|
|
158
158
|
const hasFailedUploads = items.some(
|
|
159
159
|
(activity) => activity.type === "upload" && activity.status === "failed"
|
|
@@ -161,11 +161,14 @@ function activityState(items) {
|
|
|
161
161
|
return {
|
|
162
162
|
items,
|
|
163
163
|
isMutating: items.some(
|
|
164
|
-
(activity) => activity.status === "pending" || activity.status === "running"
|
|
164
|
+
(activity) => activity.type !== "sync" && (activity.status === "pending" || activity.status === "running")
|
|
165
165
|
),
|
|
166
|
-
|
|
166
|
+
isSyncing: items.some(
|
|
167
|
+
(activity) => activity.type === "sync" && activity.status === "running"
|
|
168
|
+
),
|
|
169
|
+
hasFailed: hasFailedRetryable || hasFailedUploads,
|
|
167
170
|
hasBlocked: items.some((activity) => activity.status === "blocked"),
|
|
168
|
-
canRetry:
|
|
171
|
+
canRetry: hasFailedRetryable,
|
|
169
172
|
canDiscard: hasFailedUploads
|
|
170
173
|
};
|
|
171
174
|
}
|
|
@@ -4,8 +4,10 @@ export declare const workspaceAtom: (workspaceKey: string) => import("jotai").At
|
|
|
4
4
|
export declare const viewAtoms: (key: string) => import("jotai").Atom<ComponentType | undefined>;
|
|
5
5
|
export declare const typeAtoms: (typeName: string) => import("jotai").Atom<{
|
|
6
6
|
fields: import("../../core/Type.js").FieldsDefinition;
|
|
7
|
+
settings?: import("../../core/Type.js").FieldsDefinition | undefined;
|
|
7
8
|
contains?: Array<string | import("../../types.js").Type>;
|
|
8
9
|
overview?: import("../../types.js").OverviewOptions;
|
|
10
|
+
actions?: Array<import("../../core/View.js").View<import("../../types.js").EntryActionProps>>;
|
|
9
11
|
orderChildrenBy?: import("../../core/OrderBy.js").OrderBy | Array<import("../../core/OrderBy.js").OrderBy>;
|
|
10
12
|
hidden?: true;
|
|
11
13
|
collapsed?: boolean;
|
|
@@ -17,6 +17,17 @@ export declare const entrySidebarTabAtom: import("jotai").PrimitiveAtom<EntrySid
|
|
|
17
17
|
export declare const entrySidebarOpenAtom: import("jotai").PrimitiveAtom<boolean> & {
|
|
18
18
|
init: boolean;
|
|
19
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Entries without a preview only have history and references in the sidebar,
|
|
22
|
+
* so it starts closed for them (like the 1.x preview pane) and remembers its
|
|
23
|
+
* own state, leaving the room to the form and wide custom views
|
|
24
|
+
*/
|
|
25
|
+
export declare const entrySidebarOpenWithoutPreviewAtom: import("jotai").PrimitiveAtom<boolean> & {
|
|
26
|
+
init: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare function entrySidebarOpen(hasPreview: boolean): import("jotai").PrimitiveAtom<boolean> & {
|
|
29
|
+
init: boolean;
|
|
30
|
+
};
|
|
20
31
|
export declare const themeAtom: import("jotai").WritableAtom<DashboardTheme, [update: SetStateAction<DashboardTheme>], void> & {
|
|
21
32
|
onMount(setTheme: (update: SetStateAction<DashboardTheme>) => void): void;
|
|
22
33
|
};
|
|
@@ -34,6 +34,10 @@ var entrySidebarTabAtom = atom("preview");
|
|
|
34
34
|
var entrySidebarOpenAtom = atom(
|
|
35
35
|
typeof window === "undefined" || !window.matchMedia?.("(max-width: 768px)").matches
|
|
36
36
|
);
|
|
37
|
+
var entrySidebarOpenWithoutPreviewAtom = atom(false);
|
|
38
|
+
function entrySidebarOpen(hasPreview) {
|
|
39
|
+
return hasPreview ? entrySidebarOpenAtom : entrySidebarOpenWithoutPreviewAtom;
|
|
40
|
+
}
|
|
37
41
|
var themeAtom = Object.assign(
|
|
38
42
|
atom(
|
|
39
43
|
(get) => get(themeStorageAtom),
|
|
@@ -76,13 +80,17 @@ function applyDashboardTheme(theme) {
|
|
|
76
80
|
});
|
|
77
81
|
});
|
|
78
82
|
}
|
|
83
|
+
if (!documentElement.hasAttribute("data-alinea-theme"))
|
|
84
|
+
documentElement.setAttribute("data-alinea-theme", "");
|
|
79
85
|
if (theme === "system") documentElement.removeAttribute("data-theme");
|
|
80
86
|
else documentElement.dataset.theme = theme;
|
|
81
87
|
}
|
|
82
88
|
export {
|
|
83
89
|
canLogoutAtom,
|
|
84
90
|
dashboardMobileAtom,
|
|
91
|
+
entrySidebarOpen,
|
|
85
92
|
entrySidebarOpenAtom,
|
|
93
|
+
entrySidebarOpenWithoutPreviewAtom,
|
|
86
94
|
entrySidebarTabAtom,
|
|
87
95
|
entrySidebarWidthAtom,
|
|
88
96
|
logoutAtom,
|
|
@@ -32,8 +32,12 @@ export interface EditorSection {
|
|
|
32
32
|
}> | ((props: {
|
|
33
33
|
section: Section;
|
|
34
34
|
}) => ReactNode) | undefined>;
|
|
35
|
+
/** The section has a view or at least one field that is not hidden */
|
|
36
|
+
visible: Atom<boolean>;
|
|
35
37
|
}
|
|
36
38
|
export interface EditorField {
|
|
39
|
+
/** The editor of the entry, row or object the field belongs to */
|
|
40
|
+
editor: EditorModel;
|
|
37
41
|
key: string;
|
|
38
42
|
value: WritableAtom<unknown, [unknown], void>;
|
|
39
43
|
options: Atom<FieldOptions<unknown>>;
|
|
@@ -61,13 +65,15 @@ export declare class EntryEditor implements EditorModel {
|
|
|
61
65
|
}
|
|
62
66
|
export declare function rootEditor(editor: EditorModel): EditorModel;
|
|
63
67
|
export declare class EntryEditorSection implements EditorSection {
|
|
68
|
+
editor: EditorModel;
|
|
64
69
|
section: Section;
|
|
65
|
-
constructor(section: Section);
|
|
70
|
+
constructor(editor: EditorModel, section: Section);
|
|
66
71
|
view: Atom<((props: {
|
|
67
72
|
section: Section;
|
|
68
73
|
}) => ReactNode) | ComponentType<{
|
|
69
74
|
section: Section;
|
|
70
75
|
}> | undefined>;
|
|
76
|
+
visible: Atom<boolean>;
|
|
71
77
|
}
|
|
72
78
|
declare class EntryEditorField implements EditorField {
|
|
73
79
|
#private;
|
|
@@ -8,6 +8,7 @@ import { Field } from "alinea/core/Field";
|
|
|
8
8
|
import { Section } from "alinea/core/Section";
|
|
9
9
|
import { Type } from "alinea/core/Type";
|
|
10
10
|
import { assert } from "alinea/core/util/Assert";
|
|
11
|
+
import { HiddenField } from "alinea/field/hidden";
|
|
11
12
|
import {
|
|
12
13
|
fieldError,
|
|
13
14
|
policyFieldOptions,
|
|
@@ -32,7 +33,7 @@ var EntryEditor = class {
|
|
|
32
33
|
(get) => Type.anchors(type, get(node.value))
|
|
33
34
|
);
|
|
34
35
|
this.sections = Type.sections(type).map(
|
|
35
|
-
(section) => new EntryEditorSection(section)
|
|
36
|
+
(section) => new EntryEditorSection(this, section)
|
|
36
37
|
);
|
|
37
38
|
}
|
|
38
39
|
type;
|
|
@@ -62,9 +63,11 @@ function rootEditor(editor) {
|
|
|
62
63
|
return editor;
|
|
63
64
|
}
|
|
64
65
|
var EntryEditorSection = class {
|
|
65
|
-
constructor(section) {
|
|
66
|
+
constructor(editor, section) {
|
|
67
|
+
this.editor = editor;
|
|
66
68
|
this.section = section;
|
|
67
69
|
}
|
|
70
|
+
editor;
|
|
68
71
|
section;
|
|
69
72
|
view = atom((get) => {
|
|
70
73
|
const view = Section.view(this.section);
|
|
@@ -72,6 +75,15 @@ var EntryEditorSection = class {
|
|
|
72
75
|
return get(viewsAtom)[view];
|
|
73
76
|
return view;
|
|
74
77
|
});
|
|
78
|
+
visible = atom((get) => {
|
|
79
|
+
if (Section.view(this.section)) return true;
|
|
80
|
+
return Object.values(Section.definition(this.section)).some((value) => {
|
|
81
|
+
if (!Field.isField(value)) return true;
|
|
82
|
+
if (value instanceof HiddenField) return false;
|
|
83
|
+
const info = this.editor.get(value);
|
|
84
|
+
return !info || !get(info.options).hidden;
|
|
85
|
+
});
|
|
86
|
+
});
|
|
75
87
|
};
|
|
76
88
|
var EntryEditorField = class {
|
|
77
89
|
constructor(editor, key, field) {
|