alinea 2.0.0-preview.0 → 2.0.0-preview.2
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/LICENSES.md +134 -80
- package/dist/adapter/next/DevRemote.d.ts +3 -0
- package/dist/adapter/next/DevRemote.js +37 -0
- package/dist/adapter/next/ForwardCredentials.d.ts +1 -0
- package/dist/adapter/next/ForwardCredentials.js +17 -0
- package/dist/adapter/next/cms.js +86 -38
- package/dist/adapter/next/context.d.ts +1 -1
- package/dist/adapter/next/context.js +11 -3
- package/dist/adapter/next/handler.d.ts +2 -0
- package/dist/adapter/next/handler.js +23 -16
- package/dist/adapter/next/with-alinea.js +18 -16
- package/dist/backend/Handler.d.ts +14 -13
- package/dist/backend/Handler.js +70 -36
- package/dist/backend/resolver/ParsePreview.d.ts +8 -4
- package/dist/backend/resolver/ParsePreview.js +40 -43
- package/dist/backend/router/Router.d.ts +1 -0
- package/dist/backend/router/Router.js +21 -15
- package/dist/bundled.d.ts +369 -99
- package/dist/chunks/chunk-6UT4N4CO.js +919 -0
- package/dist/chunks/{chunk-LUBOGJCG.js → chunk-6V4TAD2N.js} +1 -1
- package/dist/chunks/{chunk-TL7ZW6BX.js → chunk-A3XXZBOQ.js} +2535 -2999
- package/dist/chunks/chunk-AC5ATYI3.js +1434 -0
- package/dist/chunks/{chunk-7ORQ7BYK.js → chunk-KMLLLZ6X.js} +202 -269
- package/dist/chunks/{chunk-IWN3T3FL.js → chunk-O7XWTMCB.js} +1 -1
- package/dist/chunks/{chunk-53DZYORR.js → chunk-PAYSVIYI.js} +76 -176
- package/dist/chunks/{chunk-YK3OSMDM.js → chunk-S4AU6SRS.js} +188 -158
- package/dist/chunks/{chunk-EQ3TDHYD.js → chunk-UVOEM4AH.js} +6 -3
- package/dist/chunks/{chunk-I7X64JTZ.js → chunk-VXZM6V4P.js} +4 -4
- package/dist/cli/Generate.js +3 -13
- package/dist/cli/Serve.js +7 -3
- package/dist/cli/bin.js +8 -5
- package/dist/cli/generate/CompileConfig.js +3 -2
- package/dist/cli/generate/CopyStaticFiles.js +2 -3
- package/dist/cli/generate/DevDB.d.ts +1 -1
- package/dist/cli/generate/DevDB.js +3 -5
- package/dist/cli/serve/CreateLocalServer.d.ts +1 -1
- package/dist/cli/serve/CreateLocalServer.js +3 -2
- package/dist/cli/serve/DevServer.d.ts +3 -2
- package/dist/cli/serve/DevServer.js +60 -3
- package/dist/cli/serve/ServeContext.d.ts +1 -0
- package/dist/cli/serve/StartServer.d.ts +1 -0
- package/dist/cli/serve/StartServer.js +6 -1
- package/dist/cli/util/EnsureLibs.js +2 -2
- package/dist/cli/util/EnsureNode.js +2 -2
- package/dist/cloud/CloudRemote.d.ts +2 -1
- package/dist/cloud/CloudRemote.js +3 -2
- package/dist/components/Breadcrumbs.js +8 -8
- package/dist/components/Button.js +6 -6
- package/dist/components/Calendar.js +11 -11
- package/dist/components/Checkbox.js +7 -7
- package/dist/components/CheckboxGroup.js +6 -6
- package/dist/components/ColorSwatch.js +6 -6
- package/dist/components/ColorSwatchPicker.js +6 -6
- package/dist/components/ComboBox.js +17 -17
- package/dist/components/DateField.js +9 -9
- package/dist/components/DatePicker.js +10 -10
- package/dist/components/DateRangePicker.js +14 -14
- package/dist/components/Dialog.js +6 -6
- package/dist/components/Disclosure.js +13 -13
- package/dist/components/DropZone.js +6 -6
- package/dist/components/Label.js +16 -16
- package/dist/components/Link.js +6 -6
- package/dist/components/List.js +34 -34
- package/dist/components/Menu.js +10 -10
- package/dist/components/Modal.js +8 -8
- package/dist/components/MultipleSelect.js +33 -33
- package/dist/components/NumberField.d.ts +2 -1
- package/dist/components/NumberField.js +21 -11
- package/dist/components/Popover.js +6 -6
- package/dist/components/ProgressCircle.js +10 -10
- package/dist/components/RadioGroup.js +6 -6
- package/dist/components/SearchField.js +11 -11
- package/dist/components/Select.js +13 -13
- package/dist/components/Surface.js +3 -3
- package/dist/components/Switch.js +6 -6
- package/dist/components/Table.js +13 -13
- package/dist/components/Tabs.js +8 -8
- package/dist/components/TagGroup.js +7 -7
- package/dist/components/TextField.js +10 -10
- package/dist/components/TimeField.js +6 -6
- package/dist/components/Toggle.js +6 -6
- package/dist/components/Toolbar.js +7 -7
- package/dist/components/Tooltip.js +10 -10
- package/dist/components/Tree.js +9 -9
- package/dist/core/BlobTransport.d.ts +5 -0
- package/dist/core/BlobTransport.js +79 -0
- package/dist/core/Client.d.ts +2 -1
- package/dist/core/Client.js +17 -12
- package/dist/core/Config.d.ts +4 -0
- package/dist/core/Config.js +6 -0
- package/dist/core/Connection.d.ts +4 -3
- package/dist/core/Connection.js +7 -0
- package/dist/core/Graph.d.ts +3 -4
- package/dist/core/ListRow.d.ts +2 -0
- package/dist/core/OrderBy.d.ts +7 -3
- package/dist/core/TextDoc.d.ts +11 -0
- package/dist/core/Trace.d.ts +8 -0
- package/dist/core/Trace.js +32 -0
- package/dist/core/Type.d.ts +7 -1
- package/dist/core/db/CommitRequest.d.ts +0 -3
- package/dist/core/db/CommitRequest.js +0 -9
- package/dist/core/db/EntryDB.js +1 -1
- package/dist/core/db/EntryIndex.d.ts +12 -2
- package/dist/core/db/EntryIndex.js +131 -22
- package/dist/core/db/EntryResolver.js +104 -29
- package/dist/core/db/EntryTransaction.d.ts +1 -2
- package/dist/core/db/EntryTransaction.js +29 -22
- package/dist/core/db/LocalDB.d.ts +5 -5
- package/dist/core/db/LocalDB.js +27 -12
- package/dist/core/field/RichTextField.d.ts +30 -3
- package/dist/core/field/RichTextField.js +124 -56
- package/dist/core/media/MediaAltField.d.ts +1 -0
- package/dist/core/media/MediaAltField.js +9 -1
- package/dist/core/media/MediaLocation.d.ts +5 -2
- package/dist/core/media/MediaLocation.js +6 -7
- package/dist/core/media/MediaTypes.js +11 -0
- package/dist/core/source/CombinedSource.d.ts +2 -2
- package/dist/core/source/CombinedSource.js +6 -3
- package/dist/core/source/FSSource.d.ts +4 -3
- package/dist/core/source/FSSource.js +59 -27
- package/dist/core/source/GithubSource.d.ts +2 -2
- package/dist/core/source/GithubSource.js +21 -9
- package/dist/core/source/IndexedDBSource.d.ts +2 -2
- package/dist/core/source/IndexedDBSource.js +3 -1
- package/dist/core/source/MemorySource.d.ts +2 -2
- package/dist/core/source/MemorySource.js +3 -1
- package/dist/core/source/OverlaySource.d.ts +12 -0
- package/dist/core/source/OverlaySource.js +50 -0
- package/dist/core/source/Source.d.ts +5 -2
- package/dist/core/source/Source.js +3 -3
- package/dist/core/util/Async.d.ts +8 -2
- package/dist/core/util/Async.js +67 -0
- package/dist/core/util/EntryFilenames.d.ts +2 -2
- package/dist/core/util/EntryFilenames.js +3 -3
- package/dist/dashboard/App.css +158 -0
- package/dist/dashboard/App.js +2 -2
- package/dist/dashboard/app/AccessDenied.js +3 -3
- package/dist/dashboard/app/ActivityStatus.js +15 -15
- package/dist/dashboard/app/AppShell.js +1 -1
- package/dist/dashboard/app/AuthView.js +11 -11
- package/dist/dashboard/app/CompactField.js +10 -10
- package/dist/dashboard/app/DashboardErrorBoundary.js +5 -5
- package/dist/dashboard/app/DashboardLayout.js +22 -19
- package/dist/dashboard/app/EntryHeader.js +12 -12
- package/dist/dashboard/app/EntryReferences.js +9 -9
- package/dist/dashboard/app/EntrySidebar.d.ts +1 -1
- package/dist/dashboard/app/EntrySidebar.js +17 -16
- package/dist/dashboard/app/EntrySidebarPreview.d.ts +1 -1
- package/dist/dashboard/app/EntrySidebarPreview.js +19 -14
- package/dist/dashboard/app/EntryTranslationBanner.js +7 -7
- package/dist/dashboard/app/Explorer.js +51 -43
- package/dist/dashboard/app/ExplorerCards.js +34 -34
- package/dist/dashboard/app/ExplorerFileCard.js +18 -18
- package/dist/dashboard/app/ExplorerList.js +13 -13
- package/dist/dashboard/app/ExplorerModal.js +3 -3
- package/dist/dashboard/app/ExplorerTable.js +76 -61
- package/dist/dashboard/app/ExternalLinkPicker.js +15 -4
- package/dist/dashboard/app/LinkPicker.js +8 -8
- package/dist/dashboard/app/LocaleMenu.js +12 -12
- package/dist/dashboard/app/SidebarLayout.d.ts +8 -0
- package/dist/dashboard/app/SidebarLayout.js +1169 -0
- package/dist/dashboard/app/SidebarTree.js +46 -46
- package/dist/dashboard/app/WorkspaceMenu.js +17 -17
- package/dist/dashboard/app/WorkspaceRoots.js +23 -23
- package/dist/dashboard/app/editor/FileEditor.d.ts +2 -1
- package/dist/dashboard/app/editor/FileEditor.js +41 -32
- package/dist/dashboard/app/editor/FilePreview.js +4 -4
- package/dist/dashboard/app/editor/MediaAltField.view.d.ts +1 -1
- package/dist/dashboard/app/editor/MediaAltField.view.js +6 -9
- package/dist/dashboard/app/modals/CreateEntry.js +4 -4
- package/dist/dashboard/app/pages/EntryPage.js +57 -31
- package/dist/dashboard/app/pages/UsersPage.js +33 -33
- package/dist/dashboard/app/ui/DashboardModal.js +23 -23
- package/dist/dashboard/app/ui/Rail.js +3 -3
- package/dist/dashboard/app/ui/Sidebar.js +2 -2
- package/dist/dashboard/atoms/auth.js +2 -0
- package/dist/dashboard/atoms/dashboard.d.ts +9 -0
- package/dist/dashboard/atoms/dashboard.js +17 -0
- package/dist/dashboard/atoms/editor.d.ts +7 -1
- package/dist/dashboard/atoms/editor.js +4 -1
- package/dist/dashboard/atoms/entry.d.ts +48 -2
- package/dist/dashboard/atoms/entry.js +222 -17
- package/dist/dashboard/atoms/explorer.js +4 -9
- package/dist/dashboard/atoms/preview.d.ts +3 -0
- package/dist/dashboard/atoms/preview.js +18 -1
- package/dist/dashboard/atoms/root.d.ts +4 -1
- package/dist/dashboard/atoms/root.js +96 -157
- package/dist/dashboard/hooks.d.ts +4 -2
- package/dist/dashboard/hooks.js +9 -5
- package/dist/dashboard/icons.d.ts +1 -0
- package/dist/dashboard/icons.js +10 -0
- package/dist/field/check/CheckField.view.js +2 -2
- package/dist/field/code/CodeField.view.js +12 -12
- package/dist/field/date/DateField.view.js +12 -2
- package/dist/field/link/FileLink.d.ts +2 -2
- package/dist/field/link/FileLink.js +5 -3
- package/dist/field/link/ImageLink.d.ts +1 -1
- package/dist/field/link/ImageLink.js +1 -1
- package/dist/field/link/Link.js +2 -2
- package/dist/field/link/LinkField.view.js +155 -128
- package/dist/field/list/ListField.view.js +22 -33
- package/dist/field/metadata/MetadataField.view.js +19 -19
- package/dist/field/number/NumberField.d.ts +2 -0
- package/dist/field/number/NumberField.view.js +4 -2
- package/dist/field/richtext/PickTextLink.d.ts +7 -0
- package/dist/field/richtext/PickTextLink.js +104 -2
- package/dist/field/richtext/ReferenceLink.d.ts +4 -1
- package/dist/field/richtext/ReferenceLink.js +18 -4
- package/dist/field/richtext/RichTextDocument.d.ts +7 -2
- package/dist/field/richtext/RichTextDocument.js +34 -5
- package/dist/field/richtext/RichTextExtensions.d.ts +3 -1
- package/dist/field/richtext/RichTextExtensions.js +2704 -7467
- package/dist/field/richtext/RichTextField.d.ts +4 -0
- package/dist/field/richtext/RichTextField.story.d.ts +4 -0
- package/dist/field/richtext/RichTextField.view.js +43 -20
- package/dist/field/richtext/RichTextInsertMenu.js +281 -495
- package/dist/field/richtext/RichTextToolbar.d.ts +5 -2
- package/dist/field/richtext/RichTextToolbar.js +38 -3
- package/dist/field/richtext/Toolbar.d.ts +19 -1
- package/dist/field/richtext/Toolbar.js +18 -13
- package/dist/field/richtext/extensions/Anchor.js +1 -1
- package/dist/field/richtext/extensions/Link.js +1 -1
- package/dist/field/richtext/extensions/Small.js +1 -1
- package/dist/field/select/SelectField.view.js +8 -6
- package/dist/index.css +227 -16
- package/dist/next.cjs +18 -16
- package/dist/next.d.ts +2 -1
- package/dist/next.edge.d.ts +2 -1
- package/dist/picker/entry/EntryPicker.js +9 -35
- package/dist/preview/PreviewPayload.js +35 -250
- package/dist/ui/RichText.d.ts +1 -0
- package/dist/ui/RichText.js +29 -2
- package/package.json +6 -3
- package/dist/cli/util/ExternalPlugin.d.ts +0 -2
- package/dist/cli/util/ExternalPlugin.js +0 -919
- package/dist/chunks/{chunk-JFROOUG6.js → chunk-NIVGVRDS.js} +17 -17
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import "../../../chunks/chunk-CQ52GEHY.js";
|
|
11
11
|
|
|
12
12
|
// src/dashboard/app/pages/EntryPage.tsx
|
|
13
|
-
import { Button, Icon, Surface } from "alinea/components";
|
|
13
|
+
import { Button, Icon, Surface, Tooltip } from "alinea/components";
|
|
14
14
|
import { MediaFile, MediaLibrary } from "alinea/core/media/MediaTypes";
|
|
15
15
|
import { assert } from "alinea/core/util/Assert";
|
|
16
16
|
import { typeAtoms } from "alinea/dashboard/atoms/config";
|
|
@@ -31,7 +31,9 @@ import { EntryScope } from "../../hooks.js";
|
|
|
31
31
|
import {
|
|
32
32
|
IcBaselineErrorOutline,
|
|
33
33
|
IcOutlineViewList,
|
|
34
|
-
IcRoundEdit
|
|
34
|
+
IcRoundEdit,
|
|
35
|
+
IcRoundCheck,
|
|
36
|
+
IcRoundSave
|
|
35
37
|
} from "../../icons.js";
|
|
36
38
|
import { FileEditor } from "./../editor/FileEditor.js";
|
|
37
39
|
import { CreateEntryButton } from "./../DashboardLayout.js";
|
|
@@ -43,6 +45,7 @@ import {
|
|
|
43
45
|
} from "./../EntrySidebar.js";
|
|
44
46
|
import { EntryTranslationBanner } from "./../EntryTranslationBanner.js";
|
|
45
47
|
import { Explorer } from "./../Explorer.js";
|
|
48
|
+
import { SidebarLayout } from "../SidebarLayout.js";
|
|
46
49
|
import {
|
|
47
50
|
DashboardModal,
|
|
48
51
|
DashboardModalContent,
|
|
@@ -53,31 +56,31 @@ import { Rail, RailBody, RailContent } from "./../ui/Rail.js";
|
|
|
53
56
|
|
|
54
57
|
// src/dashboard/app/pages/EntryPage.module.css
|
|
55
58
|
var EntryPage_default = {
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"EntryEditor-
|
|
59
|
-
"
|
|
60
|
-
"EntryEditor-header": "alinea-EntryEditor-header",
|
|
61
|
-
"EntryEditorHeader": "alinea-EntryEditor-header",
|
|
59
|
+
"EntryEditor-fields": "alinea-EntryEditor-fields",
|
|
60
|
+
"EntryEditorFields": "alinea-EntryEditor-fields",
|
|
61
|
+
"EntryEditor-title": "alinea-EntryEditor-title",
|
|
62
|
+
"EntryEditorTitle": "alinea-EntryEditor-title",
|
|
62
63
|
"EntryEditor-toolbar": "alinea-EntryEditor-toolbar",
|
|
63
64
|
"EntryEditorToolbar": "alinea-EntryEditor-toolbar",
|
|
65
|
+
"EntryOverview-mobileActions": "alinea-EntryOverview-mobileActions",
|
|
66
|
+
"EntryOverviewMobileActions": "alinea-EntryOverview-mobileActions",
|
|
67
|
+
"EntryEditor-header": "alinea-EntryEditor-header",
|
|
68
|
+
"EntryEditorHeader": "alinea-EntryEditor-header",
|
|
64
69
|
"MissingEntry-card": "alinea-MissingEntry-card",
|
|
65
70
|
"MissingEntryCard": "alinea-MissingEntry-card",
|
|
66
71
|
"MissingEntry": "alinea-MissingEntry",
|
|
67
|
-
"EntryEditor-
|
|
68
|
-
"
|
|
69
|
-
"MissingEntry-message": "alinea-MissingEntry-message",
|
|
70
|
-
"MissingEntryMessage": "alinea-MissingEntry-message",
|
|
71
|
-
"EntryEditor-banner": "alinea-EntryEditor-banner",
|
|
72
|
-
"EntryEditorBanner": "alinea-EntryEditor-banner",
|
|
73
|
-
"EntryOverview-mobileActions": "alinea-EntryOverview-mobileActions",
|
|
74
|
-
"EntryOverviewMobileActions": "alinea-EntryOverview-mobileActions",
|
|
75
|
-
"EntryEditor-fields": "alinea-EntryEditor-fields",
|
|
76
|
-
"EntryEditorFields": "alinea-EntryEditor-fields",
|
|
72
|
+
"EntryEditor-body": "alinea-EntryEditor-body",
|
|
73
|
+
"EntryEditorBody": "alinea-EntryEditor-body",
|
|
77
74
|
"MissingEntry-icon": "alinea-MissingEntry-icon",
|
|
78
75
|
"MissingEntryIcon": "alinea-MissingEntry-icon",
|
|
79
76
|
"MissingEntry-title": "alinea-MissingEntry-title",
|
|
80
|
-
"MissingEntryTitle": "alinea-MissingEntry-title"
|
|
77
|
+
"MissingEntryTitle": "alinea-MissingEntry-title",
|
|
78
|
+
"MissingEntry-message": "alinea-MissingEntry-message",
|
|
79
|
+
"MissingEntryMessage": "alinea-MissingEntry-message",
|
|
80
|
+
"MissingEntry-id": "alinea-MissingEntry-id",
|
|
81
|
+
"MissingEntryId": "alinea-MissingEntry-id",
|
|
82
|
+
"EntryEditor-banner": "alinea-EntryEditor-banner",
|
|
83
|
+
"EntryEditorBanner": "alinea-EntryEditor-banner"
|
|
81
84
|
};
|
|
82
85
|
|
|
83
86
|
// src/dashboard/app/pages/EntryPage.tsx
|
|
@@ -106,17 +109,21 @@ var entryPage = page(async (page2, get) => {
|
|
|
106
109
|
);
|
|
107
110
|
}
|
|
108
111
|
const selectedNode = await get(localeData.selectedNode);
|
|
112
|
+
const richTextImages = await get(localeData.richTextImages);
|
|
109
113
|
const parentNeedsTranslation = type.customView ? false : await get(localeData.parentNeedsTranslation);
|
|
110
114
|
const sourceLocale = get(localeData.translationSourceLocale);
|
|
111
|
-
const
|
|
115
|
+
const isSidebarOpen = get(entrySidebarOpenAtom);
|
|
116
|
+
const sidebar = await entrySidebar(get, entry, localeData, isSidebarOpen);
|
|
112
117
|
return /* @__PURE__ */ jsx(
|
|
113
118
|
EntryEditorContent,
|
|
114
119
|
{
|
|
115
120
|
entry,
|
|
121
|
+
isSidebarOpen: Boolean(sidebar && isSidebarOpen),
|
|
116
122
|
localeData,
|
|
117
123
|
node: selectedNode,
|
|
118
124
|
page: page2,
|
|
119
125
|
parentNeedsTranslation,
|
|
126
|
+
richTextImages,
|
|
120
127
|
selectedEntry,
|
|
121
128
|
sidebar,
|
|
122
129
|
sourceLocale
|
|
@@ -175,8 +182,9 @@ function EntryViewToggle({ entry, page: page2 }) {
|
|
|
175
182
|
const [isPending, startTransition] = useTransition();
|
|
176
183
|
const nextView = view === "overview" ? "edit" : "overview";
|
|
177
184
|
const label = nextView === "overview" ? "Show overview" : "Edit entry";
|
|
185
|
+
const tooltip = nextView === "overview" ? "Overview view" : "Edit view";
|
|
178
186
|
const ViewIcon = nextView === "overview" ? IcOutlineViewList : IcRoundEdit;
|
|
179
|
-
return /* @__PURE__ */ jsx(
|
|
187
|
+
return /* @__PURE__ */ jsx(Tooltip, { delay: 300, tooltip, children: /* @__PURE__ */ jsx(
|
|
180
188
|
Button,
|
|
181
189
|
{
|
|
182
190
|
"aria-label": label,
|
|
@@ -192,7 +200,7 @@ function EntryViewToggle({ entry, page: page2 }) {
|
|
|
192
200
|
view: nextView
|
|
193
201
|
})
|
|
194
202
|
}
|
|
195
|
-
);
|
|
203
|
+
) });
|
|
196
204
|
}
|
|
197
205
|
function EntryOverview({
|
|
198
206
|
entry,
|
|
@@ -228,8 +236,10 @@ function EntryOverview({
|
|
|
228
236
|
function EntryEditorContent({
|
|
229
237
|
page: page2,
|
|
230
238
|
entry,
|
|
239
|
+
isSidebarOpen,
|
|
231
240
|
localeData,
|
|
232
241
|
parentNeedsTranslation,
|
|
242
|
+
richTextImages,
|
|
233
243
|
selectedEntry,
|
|
234
244
|
sidebar,
|
|
235
245
|
sourceLocale,
|
|
@@ -240,6 +250,7 @@ function EntryEditorContent({
|
|
|
240
250
|
const hasChildren = useAtomValue(entry.hasChildren);
|
|
241
251
|
const defaultView = useAtomValue(entry.view);
|
|
242
252
|
const sourceLocales = useAtomValue(entry.translationSourceLocales);
|
|
253
|
+
const parentPaths = useAtomValue(entry.parentPaths);
|
|
243
254
|
const View = type.customView;
|
|
244
255
|
const { locale } = page2;
|
|
245
256
|
const isUntranslated = selectedEntry.locale !== locale;
|
|
@@ -250,7 +261,7 @@ function EntryEditorContent({
|
|
|
250
261
|
const reset = useSetAtom(node.reset);
|
|
251
262
|
const [routeBlock, setRouteBlock] = useAtom(routeBlockAtom);
|
|
252
263
|
const setRouteGuard = useSetAtom(routeGuardAtom);
|
|
253
|
-
const
|
|
264
|
+
const setSidebarOpen = useSetAtom(entrySidebarOpenAtom);
|
|
254
265
|
const editorBodyRef = useRef(null);
|
|
255
266
|
const isMediaFile = type.type === MediaFile;
|
|
256
267
|
const isMediaLibrary = type.type === MediaLibrary;
|
|
@@ -289,7 +300,7 @@ function EntryEditorContent({
|
|
|
289
300
|
/* @__PURE__ */ jsx(NodeEditor, { node, type: type.type, children: /* @__PURE__ */ jsx(EntryFields, {}) })
|
|
290
301
|
] }) }) });
|
|
291
302
|
if (isMediaFile) {
|
|
292
|
-
editorBody = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(RailBody, { ref: editorBodyRef, className: styles.EntryEditor.body(), children: /* @__PURE__ */ jsx(NodeEditor, { node, type: type.type, children: /* @__PURE__ */ jsx(FileEditor, { entry: selectedEntry }) }) }) });
|
|
303
|
+
editorBody = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(RailBody, { ref: editorBodyRef, className: styles.EntryEditor.body(), children: /* @__PURE__ */ jsx(NodeEditor, { node, type: type.type, children: /* @__PURE__ */ jsx(FileEditor, { entry: selectedEntry, parentPaths }) }) }) });
|
|
293
304
|
}
|
|
294
305
|
if (View) {
|
|
295
306
|
return /* @__PURE__ */ jsx(
|
|
@@ -297,6 +308,7 @@ function EntryEditorContent({
|
|
|
297
308
|
{
|
|
298
309
|
entry,
|
|
299
310
|
localeData,
|
|
311
|
+
richTextImages,
|
|
300
312
|
selectedEntry,
|
|
301
313
|
children: /* @__PURE__ */ jsx(View, { type: type.type })
|
|
302
314
|
}
|
|
@@ -328,22 +340,36 @@ function EntryEditorContent({
|
|
|
328
340
|
children: routeBlock && /* @__PURE__ */ jsxs(DashboardModalDialog, { label: "Confirm navigation", children: [
|
|
329
341
|
/* @__PURE__ */ jsx(DashboardModalContent, { children: "This entry has unsaved changes" }),
|
|
330
342
|
/* @__PURE__ */ jsxs(DashboardModalFooter, { children: [
|
|
331
|
-
/* @__PURE__ */ jsx(Button, { onPress: discardAndConfirm,
|
|
332
|
-
/* @__PURE__ */ jsx(
|
|
343
|
+
/* @__PURE__ */ jsx(Button, { onPress: discardAndConfirm, appearance: "plain", children: "Discard my changes" }),
|
|
344
|
+
/* @__PURE__ */ jsx(
|
|
345
|
+
Button,
|
|
346
|
+
{
|
|
347
|
+
onPress: saveAndConfirm,
|
|
348
|
+
intent: "primary",
|
|
349
|
+
icon: mediaDraftsDisabled ? IcRoundCheck : IcRoundSave,
|
|
350
|
+
children: mediaDraftsDisabled ? "Publish" : "Save as draft"
|
|
351
|
+
}
|
|
352
|
+
)
|
|
333
353
|
] })
|
|
334
354
|
] })
|
|
335
355
|
}
|
|
336
356
|
),
|
|
337
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ jsx(
|
|
338
358
|
EntryScope,
|
|
339
359
|
{
|
|
340
360
|
entry,
|
|
341
361
|
localeData,
|
|
362
|
+
richTextImages,
|
|
342
363
|
selectedEntry,
|
|
343
|
-
children:
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
364
|
+
children: /* @__PURE__ */ jsx(
|
|
365
|
+
SidebarLayout,
|
|
366
|
+
{
|
|
367
|
+
side: "right",
|
|
368
|
+
visible: Boolean(sidebar && isSidebarOpen),
|
|
369
|
+
sidebar: sidebar && isSidebarOpen && /* @__PURE__ */ jsx(EntrySidebar, { ...sidebar, onOpenChange: setSidebarOpen }),
|
|
370
|
+
children: mainEditor
|
|
371
|
+
}
|
|
372
|
+
)
|
|
347
373
|
}
|
|
348
374
|
)
|
|
349
375
|
] });
|
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
} from "../../../chunks/chunk-Y7XOMJOC.js";
|
|
10
10
|
import {
|
|
11
11
|
$232f8dea1b0a4f2f$export$762f73dccccd255d
|
|
12
|
-
} from "../../../chunks/chunk-
|
|
13
|
-
import "../../../chunks/chunk-SJBZFMQ2.js";
|
|
12
|
+
} from "../../../chunks/chunk-NIVGVRDS.js";
|
|
14
13
|
import "../../../chunks/chunk-IYAQC63Y.js";
|
|
14
|
+
import "../../../chunks/chunk-SJBZFMQ2.js";
|
|
15
15
|
import "../../../chunks/chunk-AC4U3IMS.js";
|
|
16
16
|
import {
|
|
17
17
|
dist_default
|
|
@@ -56,54 +56,54 @@ import { SidebarHeader } from "../ui/Sidebar.js";
|
|
|
56
56
|
|
|
57
57
|
// src/dashboard/app/pages/UsersPage.module.css
|
|
58
58
|
var UsersPage_default = {
|
|
59
|
-
"UsersPage-header": "alinea-UsersPage-header",
|
|
60
|
-
"UsersPageHeader": "alinea-UsersPage-header",
|
|
61
|
-
"UsersPage-status-text": "alinea-UsersPage-status-text",
|
|
62
|
-
"UsersPageStatusText": "alinea-UsersPage-status-text",
|
|
63
|
-
"UsersPage-rolesCell": "alinea-UsersPage-rolesCell",
|
|
64
|
-
"UsersPageRolesCell": "alinea-UsersPage-rolesCell",
|
|
65
|
-
"UsersPage-roles": "alinea-UsersPage-roles",
|
|
66
|
-
"UsersPageRoles": "alinea-UsersPage-roles",
|
|
67
|
-
"UsersPage": "alinea-UsersPage",
|
|
68
59
|
"UsersPage-createButton": "alinea-UsersPage-createButton",
|
|
69
60
|
"UsersPageCreateButton": "alinea-UsersPage-createButton",
|
|
70
|
-
"UsersPage-
|
|
71
|
-
"
|
|
61
|
+
"UsersPage-noRoles": "alinea-UsersPage-noRoles",
|
|
62
|
+
"UsersPageNoRoles": "alinea-UsersPage-noRoles",
|
|
63
|
+
"UsersPageSidebar-item": "alinea-UsersPageSidebar-item",
|
|
64
|
+
"UsersPageSidebarItem": "alinea-UsersPageSidebar-item",
|
|
72
65
|
"UsersPage-identity-text": "alinea-UsersPage-identity-text",
|
|
73
66
|
"UsersPageIdentityText": "alinea-UsersPage-identity-text",
|
|
74
|
-
"UsersPage-form-fields": "alinea-UsersPage-form-fields",
|
|
75
|
-
"UsersPageFormFields": "alinea-UsersPage-form-fields",
|
|
76
67
|
"UsersPageSidebar-footer": "alinea-UsersPageSidebar-footer",
|
|
77
68
|
"UsersPageSidebarFooter": "alinea-UsersPageSidebar-footer",
|
|
78
|
-
"UsersPage-
|
|
79
|
-
"
|
|
69
|
+
"UsersPage-header": "alinea-UsersPage-header",
|
|
70
|
+
"UsersPageHeader": "alinea-UsersPage-header",
|
|
71
|
+
"UsersPage-identity-email": "alinea-UsersPage-identity-email",
|
|
72
|
+
"UsersPageIdentityEmail": "alinea-UsersPage-identity-email",
|
|
80
73
|
"UsersPage-table": "alinea-UsersPage-table",
|
|
81
74
|
"UsersPageTable": "alinea-UsersPage-table",
|
|
82
|
-
"UsersPage-
|
|
83
|
-
"
|
|
75
|
+
"UsersPage-header-title": "alinea-UsersPage-header-title",
|
|
76
|
+
"UsersPageHeaderTitle": "alinea-UsersPage-header-title",
|
|
84
77
|
"UsersPage-content": "alinea-UsersPage-content",
|
|
85
78
|
"UsersPageContent": "alinea-UsersPage-content",
|
|
79
|
+
"UsersPage-empty": "alinea-UsersPage-empty",
|
|
80
|
+
"UsersPageEmpty": "alinea-UsersPage-empty",
|
|
81
|
+
"UsersPage-status": "alinea-UsersPage-status",
|
|
82
|
+
"UsersPageStatus": "alinea-UsersPage-status",
|
|
83
|
+
"UsersPage": "alinea-UsersPage",
|
|
84
|
+
"UsersPage-roles": "alinea-UsersPage-roles",
|
|
85
|
+
"UsersPageRoles": "alinea-UsersPage-roles",
|
|
86
|
+
"UsersPage-status-text": "alinea-UsersPage-status-text",
|
|
87
|
+
"UsersPageStatusText": "alinea-UsersPage-status-text",
|
|
88
|
+
"UsersPage-form-fields": "alinea-UsersPage-form-fields",
|
|
89
|
+
"UsersPageFormFields": "alinea-UsersPage-form-fields",
|
|
90
|
+
"UsersPage-identity": "alinea-UsersPage-identity",
|
|
91
|
+
"UsersPageIdentity": "alinea-UsersPage-identity",
|
|
86
92
|
"UsersPage-identity-title": "alinea-UsersPage-identity-title",
|
|
87
93
|
"UsersPageIdentityTitle": "alinea-UsersPage-identity-title",
|
|
88
|
-
"UsersPage-
|
|
89
|
-
"
|
|
90
|
-
"UsersPage-noRoles": "alinea-UsersPage-noRoles",
|
|
91
|
-
"UsersPageNoRoles": "alinea-UsersPage-noRoles",
|
|
92
|
-
"UsersPage-header-title": "alinea-UsersPage-header-title",
|
|
93
|
-
"UsersPageHeaderTitle": "alinea-UsersPage-header-title",
|
|
94
|
-
"UsersPageSidebar-nav": "alinea-UsersPageSidebar-nav",
|
|
95
|
-
"UsersPageSidebarNav": "alinea-UsersPageSidebar-nav",
|
|
94
|
+
"UsersPage-rolesCell": "alinea-UsersPage-rolesCell",
|
|
95
|
+
"UsersPageRolesCell": "alinea-UsersPage-rolesCell",
|
|
96
96
|
"UsersPage-form-error": "alinea-UsersPage-form-error",
|
|
97
97
|
"UsersPageFormError": "alinea-UsersPage-form-error",
|
|
98
|
-
"UsersPageSidebar-icon": "alinea-UsersPageSidebar-icon",
|
|
99
|
-
"UsersPageSidebarIcon": "alinea-UsersPageSidebar-icon",
|
|
100
|
-
"UsersPageSidebar-item": "alinea-UsersPageSidebar-item",
|
|
101
|
-
"UsersPageSidebarItem": "alinea-UsersPageSidebar-item",
|
|
102
98
|
"UsersPage-confirmation": "alinea-UsersPage-confirmation",
|
|
103
99
|
"UsersPageConfirmation": "alinea-UsersPage-confirmation",
|
|
104
100
|
"UsersPageSidebar": "alinea-UsersPageSidebar",
|
|
105
|
-
"
|
|
106
|
-
"
|
|
101
|
+
"UsersPageSidebar-nav": "alinea-UsersPageSidebar-nav",
|
|
102
|
+
"UsersPageSidebarNav": "alinea-UsersPageSidebar-nav",
|
|
103
|
+
"UsersPageSidebar-icon": "alinea-UsersPageSidebar-icon",
|
|
104
|
+
"UsersPageSidebarIcon": "alinea-UsersPageSidebar-icon",
|
|
105
|
+
"UsersPage-search": "alinea-UsersPage-search",
|
|
106
|
+
"UsersPageSearch": "alinea-UsersPage-search"
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
// src/dashboard/app/pages/UsersPage.tsx
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
$f2ff30fde7b014be$export$d2f961adcb0afbe
|
|
4
|
-
} from "../../../chunks/chunk-
|
|
5
|
-
import "../../../chunks/chunk-
|
|
4
|
+
} from "../../../chunks/chunk-VXZM6V4P.js";
|
|
5
|
+
import "../../../chunks/chunk-O7XWTMCB.js";
|
|
6
6
|
import "../../../chunks/chunk-RKDPDEF7.js";
|
|
7
|
-
import "../../../chunks/chunk-
|
|
8
|
-
import "../../../chunks/chunk-SJBZFMQ2.js";
|
|
7
|
+
import "../../../chunks/chunk-NIVGVRDS.js";
|
|
9
8
|
import "../../../chunks/chunk-IYAQC63Y.js";
|
|
10
|
-
import "../../../chunks/chunk-
|
|
11
|
-
import "../../../chunks/chunk-
|
|
9
|
+
import "../../../chunks/chunk-SJBZFMQ2.js";
|
|
10
|
+
import "../../../chunks/chunk-6V4TAD2N.js";
|
|
11
|
+
import "../../../chunks/chunk-S4AU6SRS.js";
|
|
12
12
|
import "../../../chunks/chunk-AC4U3IMS.js";
|
|
13
13
|
import {
|
|
14
14
|
dist_default
|
|
@@ -24,32 +24,32 @@ import { IcRoundClose } from "../../icons.js";
|
|
|
24
24
|
|
|
25
25
|
// src/dashboard/app/ui/DashboardModal.module.css
|
|
26
26
|
var DashboardModal_default = {
|
|
27
|
-
"DashboardModalFormHeader": "alinea-DashboardModalFormHeader",
|
|
28
27
|
"DashboardModalContent": "alinea-DashboardModalContent",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"DashboardModalDialog-controls": "alinea-DashboardModalDialog-controls",
|
|
33
|
-
"DashboardModalDialogControls": "alinea-DashboardModalDialog-controls",
|
|
28
|
+
"is-explorer": "alinea-is-explorer",
|
|
29
|
+
"isExplorer": "alinea-is-explorer",
|
|
30
|
+
"DashboardModal": "alinea-DashboardModal",
|
|
34
31
|
"DashboardModalDialog-header": "alinea-DashboardModalDialog-header",
|
|
35
32
|
"DashboardModalDialogHeader": "alinea-DashboardModalDialog-header",
|
|
36
|
-
"DashboardModalCloseButton": "alinea-DashboardModalCloseButton",
|
|
37
33
|
"DashboardModalSeparator": "alinea-DashboardModalSeparator",
|
|
38
|
-
"
|
|
39
|
-
"isExplorer": "alinea-is-explorer",
|
|
34
|
+
"DashboardModalFormFooter": "alinea-DashboardModalFormFooter",
|
|
40
35
|
"DashboardModalDialog": "alinea-DashboardModalDialog",
|
|
36
|
+
"DashboardModalForm": "alinea-DashboardModalForm",
|
|
37
|
+
"DashboardModalOverlay": "alinea-DashboardModalOverlay",
|
|
38
|
+
"DashboardModal-surface": "alinea-DashboardModal-surface",
|
|
39
|
+
"DashboardModalSurface": "alinea-DashboardModal-surface",
|
|
40
|
+
"DashboardModalCloseButton": "alinea-DashboardModalCloseButton",
|
|
41
|
+
"DashboardModalFooter": "alinea-DashboardModalFooter",
|
|
41
42
|
"DashboardModal-enter": "alinea-DashboardModal-enter",
|
|
42
43
|
"DashboardModalEnter": "alinea-DashboardModal-enter",
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"isLoading": "alinea-is-loading",
|
|
47
|
-
"DashboardModal": "alinea-DashboardModal",
|
|
48
|
-
"DashboardModalTitle": "alinea-DashboardModalTitle",
|
|
44
|
+
"DashboardModalDialog-controls": "alinea-DashboardModalDialog-controls",
|
|
45
|
+
"DashboardModalDialogControls": "alinea-DashboardModalDialog-controls",
|
|
46
|
+
"DashboardModalFormBody": "alinea-DashboardModalFormBody",
|
|
49
47
|
"DashboardModalDialog-loader": "alinea-DashboardModalDialog-loader",
|
|
50
48
|
"DashboardModalDialogLoader": "alinea-DashboardModalDialog-loader",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
49
|
+
"DashboardModalFormHeader": "alinea-DashboardModalFormHeader",
|
|
50
|
+
"is-loading": "alinea-is-loading",
|
|
51
|
+
"isLoading": "alinea-is-loading",
|
|
52
|
+
"DashboardModalTitle": "alinea-DashboardModalTitle"
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
// src/dashboard/app/ui/DashboardModal.tsx
|
|
@@ -5,13 +5,13 @@ import "../../../chunks/chunk-CQ52GEHY.js";
|
|
|
5
5
|
|
|
6
6
|
// src/dashboard/app/ui/Rail.module.css
|
|
7
7
|
var Rail_default = {
|
|
8
|
+
"RailFooter": "alinea-RailFooter",
|
|
8
9
|
"is-main": "alinea-is-main",
|
|
9
10
|
"isMain": "alinea-is-main",
|
|
10
|
-
"
|
|
11
|
+
"RailBody": "alinea-RailBody",
|
|
11
12
|
"RailHeader": "alinea-RailHeader",
|
|
12
13
|
"Rail": "alinea-Rail",
|
|
13
|
-
"
|
|
14
|
-
"RailFooter": "alinea-RailFooter"
|
|
14
|
+
"RailContent": "alinea-RailContent"
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
// src/dashboard/app/ui/Rail.tsx
|
|
@@ -8,9 +8,9 @@ import { Rail, RailHeader } from "./Rail.js";
|
|
|
8
8
|
|
|
9
9
|
// src/dashboard/app/ui/Sidebar.module.css
|
|
10
10
|
var Sidebar_default = {
|
|
11
|
-
"
|
|
11
|
+
"SidebarHeader": "alinea-SidebarHeader",
|
|
12
12
|
"SidebarBody": "alinea-SidebarBody",
|
|
13
|
-
"
|
|
13
|
+
"Sidebar": "alinea-Sidebar"
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
// src/dashboard/app/ui/Sidebar.tsx
|
|
@@ -23,6 +23,8 @@ var authAtom = Object.assign(
|
|
|
23
23
|
atom(
|
|
24
24
|
(get) => {
|
|
25
25
|
if (!get(authRequiredAtom)) {
|
|
26
|
+
const state = get(authState);
|
|
27
|
+
if (state.status === "authenticated") return state;
|
|
26
28
|
const userData = typeof process !== "undefined" && process.env.ALINEA_USER;
|
|
27
29
|
return {
|
|
28
30
|
status: "authenticated",
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { SetStateAction } from 'react';
|
|
2
2
|
export type DashboardTheme = 'system' | 'light' | 'dark';
|
|
3
|
+
export declare const dashboardMobileAtom: import("jotai").PrimitiveAtom<boolean> & {
|
|
4
|
+
init: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const navigationSidebarWidthAtom: import("jotai").PrimitiveAtom<number> & {
|
|
7
|
+
init: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const entrySidebarWidthAtom: import("jotai").PrimitiveAtom<number> & {
|
|
10
|
+
init: number;
|
|
11
|
+
};
|
|
3
12
|
export declare const entrySidebarOpenAtom: import("jotai").PrimitiveAtom<boolean> & {
|
|
4
13
|
init: boolean;
|
|
5
14
|
};
|
|
@@ -15,6 +15,20 @@ var themeStorageAtom = atomWithStorage(
|
|
|
15
15
|
"system",
|
|
16
16
|
void 0
|
|
17
17
|
);
|
|
18
|
+
var mobileMediaQuery = "(max-width: 768px)";
|
|
19
|
+
var dashboardMobileAtom = atom(
|
|
20
|
+
typeof window !== "undefined" && (window.matchMedia?.(mobileMediaQuery).matches ?? false)
|
|
21
|
+
);
|
|
22
|
+
dashboardMobileAtom.onMount = (setMobile) => {
|
|
23
|
+
const media = window.matchMedia?.(mobileMediaQuery);
|
|
24
|
+
if (!media) return;
|
|
25
|
+
const update = () => setMobile(media.matches);
|
|
26
|
+
update();
|
|
27
|
+
media.addEventListener("change", update);
|
|
28
|
+
return () => media.removeEventListener("change", update);
|
|
29
|
+
};
|
|
30
|
+
var navigationSidebarWidthAtom = atom(320);
|
|
31
|
+
var entrySidebarWidthAtom = atom(320);
|
|
18
32
|
var entrySidebarOpenAtom = atom(
|
|
19
33
|
typeof window === "undefined" || !window.matchMedia?.("(max-width: 768px)").matches
|
|
20
34
|
);
|
|
@@ -65,7 +79,10 @@ function applyDashboardTheme(theme) {
|
|
|
65
79
|
}
|
|
66
80
|
export {
|
|
67
81
|
canLogoutAtom,
|
|
82
|
+
dashboardMobileAtom,
|
|
68
83
|
entrySidebarOpenAtom,
|
|
84
|
+
entrySidebarWidthAtom,
|
|
69
85
|
logoutAtom,
|
|
86
|
+
navigationSidebarWidthAtom,
|
|
70
87
|
themeAtom
|
|
71
88
|
};
|
|
@@ -5,6 +5,10 @@ import { Section } from 'alinea/core/Section';
|
|
|
5
5
|
import { Type } from 'alinea/core/Type';
|
|
6
6
|
import type { Atom, WritableAtom } from 'jotai';
|
|
7
7
|
import type { ComponentType, ReactNode } from 'react';
|
|
8
|
+
export interface ResolvedEditorImage {
|
|
9
|
+
src: string;
|
|
10
|
+
alt: string;
|
|
11
|
+
}
|
|
8
12
|
export interface EditorNode {
|
|
9
13
|
readOnly: boolean;
|
|
10
14
|
nodes: WritableAtom<unknown, [unknown], void>;
|
|
@@ -15,6 +19,7 @@ export interface EditorModel {
|
|
|
15
19
|
anchors: Atom<Array<EntryAnchorTarget>>;
|
|
16
20
|
node: EditorNode;
|
|
17
21
|
parent?: EditorModel;
|
|
22
|
+
resolvedImages: ReadonlyMap<string, ResolvedEditorImage>;
|
|
18
23
|
sections: Array<EditorSection>;
|
|
19
24
|
type: Type;
|
|
20
25
|
field(key: string): EditorField | undefined;
|
|
@@ -45,10 +50,11 @@ export declare class EntryEditor implements EditorModel {
|
|
|
45
50
|
parent?: EntryEditor | undefined;
|
|
46
51
|
resource?: Resource | undefined;
|
|
47
52
|
policy?: Policy | undefined;
|
|
53
|
+
resolvedImages: ReadonlyMap<string, ResolvedEditorImage>;
|
|
48
54
|
anchors: Atom<Array<EntryAnchorTarget>>;
|
|
49
55
|
value: Atom<object>;
|
|
50
56
|
sections: Array<EntryEditorSection>;
|
|
51
|
-
constructor(type: Type, node: EditorNode, parent?: EntryEditor | undefined, resource?: Resource | undefined, policy?: Policy | undefined);
|
|
57
|
+
constructor(type: Type, node: EditorNode, parent?: EntryEditor | undefined, resource?: Resource | undefined, policy?: Policy | undefined, resolvedImages?: ReadonlyMap<string, ResolvedEditorImage>);
|
|
52
58
|
field: (key: string) => EntryEditorField | undefined;
|
|
53
59
|
get(field: Field): EntryEditorField | undefined;
|
|
54
60
|
}
|
|
@@ -12,13 +12,15 @@ import { Type } from "alinea/core/Type";
|
|
|
12
12
|
import { assert } from "alinea/core/util/Assert";
|
|
13
13
|
import { configAtom, viewsAtom } from "./core.js";
|
|
14
14
|
import { dispense } from "./utils.js";
|
|
15
|
+
var emptyResolvedImages = /* @__PURE__ */ new Map();
|
|
15
16
|
var EntryEditor = class {
|
|
16
|
-
constructor(type, node, parent, resource, policy) {
|
|
17
|
+
constructor(type, node, parent, resource, policy, resolvedImages = parent?.resolvedImages ?? emptyResolvedImages) {
|
|
17
18
|
this.type = type;
|
|
18
19
|
this.node = node;
|
|
19
20
|
this.parent = parent;
|
|
20
21
|
this.resource = resource;
|
|
21
22
|
this.policy = policy;
|
|
23
|
+
this.resolvedImages = resolvedImages;
|
|
22
24
|
this.resource ??= parent?.resource;
|
|
23
25
|
this.policy ??= parent?.policy;
|
|
24
26
|
this.value = node.value;
|
|
@@ -34,6 +36,7 @@ var EntryEditor = class {
|
|
|
34
36
|
parent;
|
|
35
37
|
resource;
|
|
36
38
|
policy;
|
|
39
|
+
resolvedImages;
|
|
37
40
|
anchors;
|
|
38
41
|
value;
|
|
39
42
|
sections;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { EntryReference, EntryReferenceScan } from 'alinea/core/db/EntryReference';
|
|
2
2
|
import { Entry, EntryStatus } from 'alinea/core/Entry';
|
|
3
|
+
import type { Order } from 'alinea/core/Graph';
|
|
3
4
|
import { type EntryDefaultView } from 'alinea/core/Type';
|
|
4
|
-
import { Atom } from 'jotai';
|
|
5
|
+
import { Atom, Getter } from 'jotai';
|
|
6
|
+
import type { ResolvedEditorImage } from './editor.js';
|
|
5
7
|
import { ReactiveNode } from './ReactiveNode.js';
|
|
6
8
|
interface EntryData {
|
|
7
9
|
id: string;
|
|
@@ -67,6 +69,7 @@ export declare class EntryLocaleAtoms {
|
|
|
67
69
|
historyReady: Atom<Promise<import("../../core/Connection.js").Revision[]>>;
|
|
68
70
|
history: Atom<import("../../core/Connection.js").Revision[]>;
|
|
69
71
|
selectedNode: Atom<Promise<ReactiveNode<object>>>;
|
|
72
|
+
richTextImages: Atom<Promise<Map<string, ResolvedEditorImage>>>;
|
|
70
73
|
anchors: Atom<Promise<import("alinea/core/Field").EntryAnchorTarget[]>>;
|
|
71
74
|
retryPreviewUrl: import("jotai").WritableAtom<null, [], void> & {
|
|
72
75
|
init: null;
|
|
@@ -122,7 +125,7 @@ export declare class EntryLocaleAtoms {
|
|
|
122
125
|
searchableText: string;
|
|
123
126
|
} | undefined>;
|
|
124
127
|
previewUrlReady: Atom<Promise<string | undefined>>;
|
|
125
|
-
|
|
128
|
+
previewUrlState: Atom<readonly [false, string | undefined] | readonly [true, string | undefined]>;
|
|
126
129
|
previewPayloadSignal: Atom<(object | null | undefined)[]>;
|
|
127
130
|
updatePreviewPayload: import("jotai").WritableAtom<null, [], Promise<string | undefined>> & {
|
|
128
131
|
init: null;
|
|
@@ -206,6 +209,7 @@ export declare class EntryAtoms {
|
|
|
206
209
|
parentId: Atom<string | null>;
|
|
207
210
|
workspace: Atom<string>;
|
|
208
211
|
root: Atom<string>;
|
|
212
|
+
parentPaths: Atom<string[]>;
|
|
209
213
|
hasChildren: Atom<boolean>;
|
|
210
214
|
canPublishParents: Atom<boolean>;
|
|
211
215
|
parentUnpublished: Atom<boolean>;
|
|
@@ -220,4 +224,46 @@ export declare class MissingEntryError extends Error {
|
|
|
220
224
|
id: string;
|
|
221
225
|
constructor(id: string);
|
|
222
226
|
}
|
|
227
|
+
export interface TreeEntrySummary {
|
|
228
|
+
id: string;
|
|
229
|
+
title: string;
|
|
230
|
+
type: string;
|
|
231
|
+
status: EntryStatus;
|
|
232
|
+
main: boolean;
|
|
233
|
+
locale: string | null;
|
|
234
|
+
parentId: string | null;
|
|
235
|
+
parents: Array<string>;
|
|
236
|
+
workspace: string;
|
|
237
|
+
root: string;
|
|
238
|
+
hasChildren: boolean;
|
|
239
|
+
}
|
|
240
|
+
interface TreeChildrenLocation {
|
|
241
|
+
workspace: string;
|
|
242
|
+
root: string;
|
|
243
|
+
parentId: string | null;
|
|
244
|
+
}
|
|
245
|
+
export declare function loadTreeChildren(get: Getter, location: TreeChildrenLocation, locale: string | null, orderBy?: Order | Array<Order>): Promise<Array<TreeEntryAtoms>>;
|
|
246
|
+
export declare class TreeEntryAtoms {
|
|
247
|
+
#private;
|
|
248
|
+
readonly id: string;
|
|
249
|
+
constructor(id: string);
|
|
250
|
+
ready: Atom<Promise<this>>;
|
|
251
|
+
raw: (locale: string | null) => Atom<Promise<Omit<TreeEntrySummary, "hasChildren">>>;
|
|
252
|
+
summary: (locale: string | null) => Atom<Promise<{
|
|
253
|
+
id: string;
|
|
254
|
+
title: string;
|
|
255
|
+
type: string;
|
|
256
|
+
status: EntryStatus;
|
|
257
|
+
main: boolean;
|
|
258
|
+
locale: string | null;
|
|
259
|
+
parentId: string | null;
|
|
260
|
+
parents: Array<string>;
|
|
261
|
+
workspace: string;
|
|
262
|
+
root: string;
|
|
263
|
+
hasChildren: boolean;
|
|
264
|
+
}>>;
|
|
265
|
+
parents: Atom<Promise<TreeEntryAtoms[]>>;
|
|
266
|
+
children: (locale: string | null) => Atom<Promise<TreeEntryAtoms[]>>;
|
|
267
|
+
}
|
|
268
|
+
export declare const treeEntryAtoms: (id: string) => TreeEntryAtoms;
|
|
223
269
|
export {};
|