alinea 2.0.0-preview.3 → 2.0.0-preview.4
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 +144 -90
- package/dist/adapter/next/DevRemote.js +10 -2
- package/dist/adapter/next/previews.js +1 -0
- package/dist/backend/Handler.js +14 -7
- package/dist/backend/api/BasicAuth.d.ts +1 -1
- package/dist/backend/api/BasicAuth.js +14 -14
- package/dist/backend/api/OAuth2.d.ts +3 -3
- package/dist/backend/api/OAuth2.js +7 -4
- package/dist/bundled.d.ts +96 -25
- package/dist/chunks/{chunk-Y7XOMJOC.js → chunk-CFNRVI3Y.js} +220 -247
- package/dist/chunks/chunk-D6UJHBJJ.js +183 -0
- package/dist/chunks/chunk-TIJTT5ZI.js +228 -0
- package/dist/chunks/{chunk-HFBZMKIN.js → chunk-XMOVGDFI.js} +1 -1
- package/dist/cli/Serve.js +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/serve/LocalAuth.js +1 -1
- package/dist/cloud/AuthResult.d.ts +2 -0
- package/dist/cloud/CloudHandshake.d.ts +7 -0
- package/dist/cloud/CloudHandshake.js +64 -0
- package/dist/cloud/CloudRemote.d.ts +4 -1
- package/dist/cloud/CloudRemote.js +21 -3
- package/dist/components/Calendar.js +6 -6
- package/dist/components/Checkbox.js +2 -2
- package/dist/components/ComboBox.js +12 -12
- package/dist/components/DatePicker.js +4 -4
- package/dist/components/DateRangePicker.js +4 -4
- package/dist/components/Disclosure.js +6 -6
- package/dist/components/Label.js +6 -6
- package/dist/components/List.js +37 -37
- package/dist/components/Menu.js +4 -4
- package/dist/components/Modal.js +2 -2
- package/dist/components/MultipleSelect.js +23 -23
- package/dist/components/NumberField.js +5 -5
- package/dist/components/ProgressCircle.js +4 -4
- package/dist/components/SearchField.js +7 -7
- package/dist/components/Select.js +6 -6
- package/dist/components/Surface.js +1 -1
- package/dist/components/Table.js +8 -8
- package/dist/components/TextField.js +4 -4
- package/dist/components/TimeField.js +4 -4
- package/dist/components/Toggle.d.ts +1 -1
- package/dist/components/Toggle.js +2 -2
- package/dist/components/Toolbar.js +3 -3
- package/dist/components/Tooltip.js +2 -2
- package/dist/components/Tree.js +6 -6
- package/dist/core/Connection.d.ts +7 -4
- package/dist/core/Entry.d.ts +6 -0
- package/dist/core/Entry.js +10 -0
- package/dist/core/Id.d.ts +1 -0
- package/dist/core/Id.js +8 -0
- package/dist/core/db/Operation.js +4 -3
- package/dist/dashboard/App.js +30 -16
- package/dist/dashboard/StoryProvider.js +2 -2
- package/dist/dashboard/app/AccessDenied.js +3 -3
- package/dist/dashboard/app/ActivityStatus.js +23 -23
- package/dist/dashboard/app/AppShell.js +2 -2
- package/dist/dashboard/app/AppearanceToggle.d.ts +1 -0
- package/dist/dashboard/app/AppearanceToggle.js +43 -0
- package/dist/dashboard/app/AuthView.d.ts +1 -1
- package/dist/dashboard/app/AuthView.js +17 -19
- package/dist/dashboard/app/Badge.js +2 -2
- package/dist/dashboard/app/CompactField.js +17 -17
- package/dist/dashboard/app/DashboardErrorBoundary.js +23 -11
- package/dist/dashboard/app/DashboardLayout.js +15 -8
- package/dist/dashboard/app/DashboardMeta.d.ts +2 -1
- package/dist/dashboard/app/DashboardMeta.js +20 -5
- package/dist/dashboard/app/EntryFields.js +6 -6
- package/dist/dashboard/app/EntryHeader.js +27 -27
- package/dist/dashboard/app/EntryReferences.js +15 -15
- package/dist/dashboard/app/EntrySidebar.js +24 -24
- package/dist/dashboard/app/EntrySidebarPreview.js +20 -19
- package/dist/dashboard/app/EntryTranslationBanner.js +5 -5
- package/dist/dashboard/app/Explorer.js +64 -64
- package/dist/dashboard/app/ExplorerCards.js +46 -46
- package/dist/dashboard/app/ExplorerFileCard.js +19 -19
- package/dist/dashboard/app/ExplorerList.js +20 -20
- package/dist/dashboard/app/ExplorerModal.js +5 -5
- package/dist/dashboard/app/ExplorerPickerContent.js +2 -2
- package/dist/dashboard/app/ExplorerTable.js +63 -63
- package/dist/dashboard/app/ImagePicker.js +7 -7
- package/dist/dashboard/app/LinkPicker.js +17 -22
- package/dist/dashboard/app/LocaleMenu.js +10 -12
- package/dist/dashboard/app/SidebarLayout.js +4 -4
- package/dist/dashboard/app/SidebarTree.js +58 -58
- package/dist/dashboard/app/WorkspaceMenu.d.ts +10 -3
- package/dist/dashboard/app/WorkspaceMenu.js +88 -67
- package/dist/dashboard/app/WorkspaceMenu.stories.d.ts +2 -0
- package/dist/dashboard/app/WorkspaceRoots.d.ts +3 -1
- package/dist/dashboard/app/WorkspaceRoots.js +86 -111
- package/dist/dashboard/app/editor/FileEditor.js +29 -29
- package/dist/dashboard/app/editor/FilePreview.js +6 -6
- package/dist/dashboard/app/editor/MediaAltField.view.js +4 -4
- package/dist/dashboard/app/modals/CreateEntry.js +15 -15
- package/dist/dashboard/app/pages/EntryPage.js +29 -31
- package/dist/dashboard/app/pages/RootPage.js +4 -4
- package/dist/dashboard/app/pages/SplashPage.d.ts +3 -0
- package/dist/dashboard/app/pages/SplashPage.js +414 -0
- package/dist/dashboard/app/pages/UsersPage.js +42 -42
- package/dist/dashboard/app/ui/DashboardModal.js +16 -16
- package/dist/dashboard/app/ui/Rail.js +3 -3
- package/dist/dashboard/app/ui/Sidebar.js +2 -2
- package/dist/dashboard/atoms/ReactiveNode.js +1 -1
- package/dist/dashboard/atoms/activity.js +2 -3
- package/dist/dashboard/atoms/auth.d.ts +2 -0
- package/dist/dashboard/atoms/auth.js +6 -2
- package/dist/dashboard/atoms/config.js +1 -1
- package/dist/dashboard/atoms/core.js +2 -2
- package/dist/dashboard/atoms/create.js +1 -1
- package/dist/dashboard/atoms/dashboard.js +2 -2
- package/dist/dashboard/atoms/editor.js +1 -1
- package/dist/dashboard/atoms/entry.js +2 -2
- package/dist/dashboard/atoms/explorer.d.ts +1 -3
- package/dist/dashboard/atoms/explorer.js +7 -9
- package/dist/dashboard/atoms/graph.d.ts +1 -0
- package/dist/dashboard/atoms/graph.js +7 -2
- package/dist/dashboard/atoms/link.js +2 -2
- package/dist/dashboard/atoms/nav.d.ts +4 -3
- package/dist/dashboard/atoms/nav.js +10 -5
- package/dist/dashboard/atoms/preview.js +1 -1
- package/dist/dashboard/atoms/root.js +2 -2
- package/dist/dashboard/atoms/upload.js +1 -1
- package/dist/dashboard/atoms/user.d.ts +1 -1
- package/dist/dashboard/atoms/user.js +8 -6
- package/dist/dashboard/atoms/utils.js +2 -2
- package/dist/dashboard/boot/Boot.js +2 -4
- package/dist/dashboard/boot/DashboardWorker.js +34 -29
- package/dist/dashboard/editor/UseField.js +6 -6
- package/dist/dashboard/fixture/cms.d.ts +12 -0
- package/dist/dashboard/fixture/cms.js +53 -2
- package/dist/dashboard/hook/UseGraph.js +4 -4
- package/dist/dashboard/hook/UseRoot.js +4 -4
- package/dist/dashboard/hooks.js +16 -16
- package/dist/field/code/CodeField.view.js +12 -12
- package/dist/field/link/LinkField.view.js +56 -56
- package/dist/field/list/ListField.view.js +24 -24
- package/dist/field/localiser/LocalisedField.view.js +76 -5
- package/dist/field/metadata/MetadataField.view.js +19 -19
- package/dist/field/richtext/PickTextLink.js +6 -6
- package/dist/field/richtext/RichTextBlock.js +4 -4
- package/dist/field/richtext/RichTextBlocks.js +1 -1
- package/dist/field/richtext/RichTextExtensions.js +19 -19
- package/dist/field/richtext/RichTextField.view.js +6 -6
- package/dist/field/richtext/RichTextInsertMenu.js +3 -3
- package/dist/field/richtext/RichTextState.js +1 -1
- package/dist/field/text/TextField.view.js +2 -2
- package/dist/index.css +415 -28
- package/dist/preview/RegisterPreview.d.ts +1 -1
- package/dist/preview/RegisterPreview.js +4 -6
- package/dist/preview/react.d.ts +5 -1
- package/dist/preview/react.js +12 -9
- package/package.json +1 -1
- package/dist/chunks/chunk-STAJCW4Z.js +0 -322
- package/dist/chunks/chunk-U4VOHNR2.js +0 -210
|
@@ -143,8 +143,10 @@ var UploadOperation = class extends Operation {
|
|
|
143
143
|
assertUploadSize(fileName, fileSize, db.config.maxUploadSize);
|
|
144
144
|
const body = Array.isArray(file) ? file[1] : await file.arrayBuffer();
|
|
145
145
|
const contentType = file instanceof Blob ? file.type : "application/octet-stream";
|
|
146
|
-
const
|
|
147
|
-
const
|
|
146
|
+
const originalExtension = extname(fileName);
|
|
147
|
+
const title = basename(fileName, originalExtension);
|
|
148
|
+
const extension = originalExtension.toLowerCase();
|
|
149
|
+
const path = slugify(title);
|
|
148
150
|
const uploadLocation = MediaLocation.storagePath(
|
|
149
151
|
db.config,
|
|
150
152
|
workspace,
|
|
@@ -159,7 +161,6 @@ var UploadOperation = class extends Operation {
|
|
|
159
161
|
await sendUpload(info.url, info.method ?? "POST", contentType, body, {
|
|
160
162
|
onProgress: query.onProgress
|
|
161
163
|
});
|
|
162
|
-
const title = basename(fileName, extension);
|
|
163
164
|
const hash = await createFileHash(new Uint8Array(body));
|
|
164
165
|
const fileLocation = MediaLocation.entryLocation(
|
|
165
166
|
db.config,
|
package/dist/dashboard/App.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Provider,
|
|
3
3
|
useAtom,
|
|
4
|
-
|
|
5
|
-
} from "../chunks/chunk-
|
|
4
|
+
useAtomValueRaw
|
|
5
|
+
} from "../chunks/chunk-D6UJHBJJ.js";
|
|
6
6
|
import {
|
|
7
7
|
atom,
|
|
8
8
|
createStore
|
|
9
|
-
} from "../chunks/chunk-
|
|
9
|
+
} from "../chunks/chunk-CFNRVI3Y.js";
|
|
10
10
|
import {
|
|
11
11
|
styler
|
|
12
12
|
} from "../chunks/chunk-I4OYYAX5.js";
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
// src/dashboard/App.module.css
|
|
24
24
|
var App_default = {
|
|
25
25
|
"AppLoading": "alinea-AppLoading",
|
|
26
|
-
"AppLoading-progress-fade-in": "alinea-AppLoading-progress-fade-in",
|
|
27
|
-
"AppLoadingProgressFadeIn": "alinea-AppLoading-progress-fade-in",
|
|
28
26
|
"AppLoading-progress": "alinea-AppLoading-progress",
|
|
29
|
-
"AppLoadingProgress": "alinea-AppLoading-progress"
|
|
27
|
+
"AppLoadingProgress": "alinea-AppLoading-progress",
|
|
28
|
+
"AppLoading-progress-fade-in": "alinea-AppLoading-progress-fade-in",
|
|
29
|
+
"AppLoadingProgressFadeIn": "alinea-AppLoading-progress-fade-in"
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
// src/dashboard/App.tsx
|
|
@@ -36,17 +36,19 @@ import { DashboardLayout } from "./app/DashboardLayout.js";
|
|
|
36
36
|
import { DashboardMeta } from "./app/DashboardMeta.js";
|
|
37
37
|
import { DashboardErrorBoundary } from "./app/DashboardErrorBoundary.js";
|
|
38
38
|
import { entryPage } from "./app/pages/EntryPage.js";
|
|
39
|
+
import { splashPage } from "./app/pages/SplashPage.js";
|
|
39
40
|
import { MissingRoot, rootPage } from "./app/pages/RootPage.js";
|
|
40
41
|
import { usersPage } from "./app/pages/UsersPage.js";
|
|
41
42
|
import { Rail } from "./app/ui/Rail.js";
|
|
42
43
|
import { activityAtom, activityPendingAtom } from "./atoms/activity.js";
|
|
43
44
|
import { authAtom } from "./atoms/auth.js";
|
|
44
|
-
import { workspaceAtom } from "./atoms/config.js";
|
|
45
|
+
import { workspaceAtom, workspacesAtom } from "./atoms/config.js";
|
|
45
46
|
import { useInitAtoms } from "./atoms/core.js";
|
|
46
47
|
import { entryAtoms, MissingEntryError } from "./atoms/entry.js";
|
|
48
|
+
import { graphReadyAtom } from "./atoms/graph.js";
|
|
47
49
|
import { pageAtom } from "./atoms/nav.js";
|
|
48
50
|
import { rootAtoms } from "./atoms/root.js";
|
|
49
|
-
import {
|
|
51
|
+
import { canManageMembersAtom, userPolicyReadyAtom } from "./atoms/user.js";
|
|
50
52
|
import { atomWithPending } from "./atoms/utils.js";
|
|
51
53
|
import { DashboardModelScope } from "./hooks.js";
|
|
52
54
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -59,18 +61,18 @@ var appAtom = atomWithPending(
|
|
|
59
61
|
})
|
|
60
62
|
);
|
|
61
63
|
var authenticatedAtom = atom(async (get) => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
]);
|
|
64
|
+
await get(graphReadyAtom);
|
|
65
|
+
await get(userPolicyReadyAtom);
|
|
66
|
+
const canManageMembers = await get(canManageMembersAtom);
|
|
66
67
|
const page = get(pageAtom);
|
|
67
68
|
const { entry, workspace, root } = page;
|
|
68
69
|
const workspaceData = workspace ? get(workspaceAtom(workspace)) : void 0;
|
|
69
|
-
const meta = (label) => /* @__PURE__ */ jsx(
|
|
70
|
+
const meta = (label, plain = false) => /* @__PURE__ */ jsx(
|
|
70
71
|
DashboardMeta,
|
|
71
72
|
{
|
|
72
|
-
color: workspaceData?.color ?? "#7c3aed",
|
|
73
|
+
color: plain ? "#6b7280" : workspaceData?.color ?? "#7c3aed",
|
|
73
74
|
icon: workspaceData?.icon,
|
|
75
|
+
plain,
|
|
74
76
|
title: dashboardTitle(workspaceData?.label ?? "Alinea", label)
|
|
75
77
|
}
|
|
76
78
|
);
|
|
@@ -87,6 +89,18 @@ var authenticatedAtom = atom(async (get) => {
|
|
|
87
89
|
content2
|
|
88
90
|
] });
|
|
89
91
|
}
|
|
92
|
+
if (page.type === "splash") {
|
|
93
|
+
if (get(workspacesAtom).length === 0) {
|
|
94
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
95
|
+
meta("No workspace access"),
|
|
96
|
+
/* @__PURE__ */ jsx(AccessDenied, { canManageMembers, scope: "workspace" })
|
|
97
|
+
] });
|
|
98
|
+
}
|
|
99
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
100
|
+
meta("Workspaces", true),
|
|
101
|
+
await splashPage(get)
|
|
102
|
+
] });
|
|
103
|
+
}
|
|
90
104
|
if (!workspace || !workspaceData) {
|
|
91
105
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
92
106
|
meta("No workspace access"),
|
|
@@ -179,8 +193,8 @@ function App(props) {
|
|
|
179
193
|
}
|
|
180
194
|
function DashboardApp(props) {
|
|
181
195
|
useInitAtoms(props);
|
|
182
|
-
const [appPending, app] =
|
|
183
|
-
const activity =
|
|
196
|
+
const [appPending, app] = useAtomValueRaw(appAtom);
|
|
197
|
+
const activity = useAtomValueRaw(activityAtom);
|
|
184
198
|
const [, setActivityPending] = useAtom(activityPendingAtom);
|
|
185
199
|
const pending = appPending || activity.isFetchingUpdates || activity.isMutating;
|
|
186
200
|
useEffect(() => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Provider
|
|
3
|
-
} from "../chunks/chunk-
|
|
3
|
+
} from "../chunks/chunk-D6UJHBJJ.js";
|
|
4
4
|
import {
|
|
5
5
|
createStore
|
|
6
|
-
} from "../chunks/chunk-
|
|
6
|
+
} from "../chunks/chunk-CFNRVI3Y.js";
|
|
7
7
|
import "../chunks/chunk-CQ52GEHY.js";
|
|
8
8
|
|
|
9
9
|
// src/dashboard/StoryProvider.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useSetAtom
|
|
3
|
-
} from "../../chunks/chunk-
|
|
4
|
-
import "../../chunks/chunk-
|
|
3
|
+
} from "../../chunks/chunk-D6UJHBJJ.js";
|
|
4
|
+
import "../../chunks/chunk-CFNRVI3Y.js";
|
|
5
5
|
import {
|
|
6
6
|
styler
|
|
7
7
|
} from "../../chunks/chunk-I4OYYAX5.js";
|
|
@@ -14,11 +14,11 @@ import { AppShell, AppShellContent, AppShellInner } from "./AppShell.js";
|
|
|
14
14
|
|
|
15
15
|
// src/dashboard/app/AccessDenied.module.css
|
|
16
16
|
var AccessDenied_default = {
|
|
17
|
+
"AccessDenied": "alinea-AccessDenied",
|
|
17
18
|
"AccessDenied-card": "alinea-AccessDenied-card",
|
|
18
19
|
"AccessDeniedCard": "alinea-AccessDenied-card",
|
|
19
20
|
"AccessDenied-title": "alinea-AccessDenied-title",
|
|
20
21
|
"AccessDeniedTitle": "alinea-AccessDenied-title",
|
|
21
|
-
"AccessDenied": "alinea-AccessDenied",
|
|
22
22
|
"AccessDenied-message": "alinea-AccessDenied-message",
|
|
23
23
|
"AccessDeniedMessage": "alinea-AccessDenied-message"
|
|
24
24
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
useAtomValueRaw,
|
|
3
3
|
useSetAtom
|
|
4
|
-
} from "../../chunks/chunk-
|
|
5
|
-
import "../../chunks/chunk-
|
|
4
|
+
} from "../../chunks/chunk-D6UJHBJJ.js";
|
|
5
|
+
import "../../chunks/chunk-CFNRVI3Y.js";
|
|
6
6
|
import {
|
|
7
7
|
dist_default
|
|
8
8
|
} from "../../chunks/chunk-I4OYYAX5.js";
|
|
@@ -42,29 +42,29 @@ import { IcRoundCheck, IcRoundHistory, IcRoundWarning } from "../icons.js";
|
|
|
42
42
|
|
|
43
43
|
// src/dashboard/app/ActivityStatus.module.css
|
|
44
44
|
var ActivityStatus_default = {
|
|
45
|
-
"ActivityStatus-icon": "alinea-ActivityStatus-icon",
|
|
46
|
-
"ActivityStatusIcon": "alinea-ActivityStatus-icon",
|
|
47
|
-
"ActivityStatus-popover-item-error": "alinea-ActivityStatus-popover-item-error",
|
|
48
|
-
"ActivityStatusPopoverItemError": "alinea-ActivityStatus-popover-item-error",
|
|
49
|
-
"ActivityStatus-popover-surface": "alinea-ActivityStatus-popover-surface",
|
|
50
|
-
"ActivityStatusPopoverSurface": "alinea-ActivityStatus-popover-surface",
|
|
51
45
|
"is-syncing": "alinea-is-syncing",
|
|
52
46
|
"isSyncing": "alinea-is-syncing",
|
|
53
|
-
"
|
|
54
|
-
"
|
|
47
|
+
"is-failed": "alinea-is-failed",
|
|
48
|
+
"isFailed": "alinea-is-failed",
|
|
49
|
+
"ActivityStatus-label": "alinea-ActivityStatus-label",
|
|
50
|
+
"ActivityStatusLabel": "alinea-ActivityStatus-label",
|
|
51
|
+
"ActivityStatus-popover": "alinea-ActivityStatus-popover",
|
|
52
|
+
"ActivityStatusPopover": "alinea-ActivityStatus-popover",
|
|
55
53
|
"ActivityStatus-popover-header": "alinea-ActivityStatus-popover-header",
|
|
56
54
|
"ActivityStatusPopoverHeader": "alinea-ActivityStatus-popover-header",
|
|
57
|
-
"ActivityStatus
|
|
58
|
-
"
|
|
55
|
+
"ActivityStatus": "alinea-ActivityStatus",
|
|
56
|
+
"ActivityStatus-popover-surface": "alinea-ActivityStatus-popover-surface",
|
|
57
|
+
"ActivityStatusPopoverSurface": "alinea-ActivityStatus-popover-surface",
|
|
59
58
|
"ActivityStatus-popover-list": "alinea-ActivityStatus-popover-list",
|
|
60
59
|
"ActivityStatusPopoverList": "alinea-ActivityStatus-popover-list",
|
|
61
|
-
"ActivityStatus-popover": "alinea-ActivityStatus-popover",
|
|
62
|
-
"
|
|
63
|
-
"ActivityStatus-
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"ActivityStatus": "alinea-ActivityStatus"
|
|
60
|
+
"ActivityStatus-popover-item-error": "alinea-ActivityStatus-popover-item-error",
|
|
61
|
+
"ActivityStatusPopoverItemError": "alinea-ActivityStatus-popover-item-error",
|
|
62
|
+
"ActivityStatus-icon": "alinea-ActivityStatus-icon",
|
|
63
|
+
"ActivityStatusIcon": "alinea-ActivityStatus-icon",
|
|
64
|
+
"ActivityStatus-popover-title": "alinea-ActivityStatus-popover-title",
|
|
65
|
+
"ActivityStatusPopoverTitle": "alinea-ActivityStatus-popover-title",
|
|
66
|
+
"ActivityStatus-popover-actions": "alinea-ActivityStatus-popover-actions",
|
|
67
|
+
"ActivityStatusPopoverActions": "alinea-ActivityStatus-popover-actions"
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
// src/dashboard/app/ActivityStatus.tsx
|
|
@@ -95,8 +95,8 @@ function ActivityStatus({
|
|
|
95
95
|
openOnFail = false,
|
|
96
96
|
placement = "right"
|
|
97
97
|
}) {
|
|
98
|
-
const [appPending] =
|
|
99
|
-
const activity =
|
|
98
|
+
const [appPending] = useAtomValueRaw(appAtom);
|
|
99
|
+
const activity = useAtomValueRaw(activityAtom);
|
|
100
100
|
const retry = useSetAtom(retryActivityAtom);
|
|
101
101
|
const discard = useSetAtom(discardActivityAtom);
|
|
102
102
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -112,7 +112,7 @@ function ActivityStatus({
|
|
|
112
112
|
appPending,
|
|
113
113
|
activity.isMutating
|
|
114
114
|
);
|
|
115
|
-
const showSpinner =
|
|
115
|
+
const showSpinner = useAtomValueRaw(activityPendingAtom);
|
|
116
116
|
if (activityLabel !== void 0) lastActivityLabel.current = activityLabel;
|
|
117
117
|
const visibleActivityLabel = activityLabel ?? (showSpinner ? lastActivityLabel.current : void 0);
|
|
118
118
|
const label = getStatusLabel(
|
|
@@ -6,8 +6,8 @@ import "../../chunks/chunk-CQ52GEHY.js";
|
|
|
6
6
|
// src/dashboard/app/AppShell.module.css
|
|
7
7
|
var AppShell_default = {
|
|
8
8
|
"AppShellContent": "alinea-AppShellContent",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
9
|
+
"AppShellInner": "alinea-AppShellInner",
|
|
10
|
+
"AppShell": "alinea-AppShell"
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
// src/dashboard/app/AppShell.tsx
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AppearanceToggle(): import("react").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useAtom
|
|
3
|
+
} from "../../chunks/chunk-D6UJHBJJ.js";
|
|
4
|
+
import "../../chunks/chunk-CFNRVI3Y.js";
|
|
5
|
+
import "../../chunks/chunk-CQ52GEHY.js";
|
|
6
|
+
|
|
7
|
+
// src/dashboard/app/AppearanceToggle.tsx
|
|
8
|
+
import { ToggleButton, ToggleButtonGroup } from "alinea/components";
|
|
9
|
+
import { themeAtom } from "alinea/dashboard/atoms/dashboard";
|
|
10
|
+
import {
|
|
11
|
+
IcRoundBrightness2,
|
|
12
|
+
IcRoundDesktopWindows,
|
|
13
|
+
IcRoundWbSunny
|
|
14
|
+
} from "../icons.js";
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
function AppearanceToggle() {
|
|
17
|
+
const [theme, setTheme] = useAtom(themeAtom);
|
|
18
|
+
return /* @__PURE__ */ jsxs(
|
|
19
|
+
ToggleButtonGroup,
|
|
20
|
+
{
|
|
21
|
+
"aria-label": "Appearance",
|
|
22
|
+
disallowEmptySelection: true,
|
|
23
|
+
selectedKeys: [theme],
|
|
24
|
+
selectionMode: "single",
|
|
25
|
+
variant: "icon-small",
|
|
26
|
+
onSelectionChange: (keys) => {
|
|
27
|
+
const selectedTheme = [...keys].at(0);
|
|
28
|
+
if (isDashboardTheme(selectedTheme)) setTheme(selectedTheme);
|
|
29
|
+
},
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsx(ToggleButton, { id: "system", "aria-label": "Use system theme", children: /* @__PURE__ */ jsx(IcRoundDesktopWindows, { "aria-hidden": true, "data-slot": "icon" }) }),
|
|
32
|
+
/* @__PURE__ */ jsx(ToggleButton, { id: "light", "aria-label": "Use light theme", children: /* @__PURE__ */ jsx(IcRoundWbSunny, { "aria-hidden": true, "data-slot": "icon" }) }),
|
|
33
|
+
/* @__PURE__ */ jsx(ToggleButton, { id: "dark", "aria-label": "Use dark theme", children: /* @__PURE__ */ jsx(IcRoundBrightness2, { "aria-hidden": true, "data-slot": "icon" }) })
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
function isDashboardTheme(value) {
|
|
39
|
+
return value === "system" || value === "light" || value === "dark";
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
AppearanceToggle
|
|
43
|
+
};
|
|
@@ -5,4 +5,4 @@ export interface AuthViewProps {
|
|
|
5
5
|
action?: DashboardAuthAction
|
|
6
6
|
], unknown>;
|
|
7
7
|
}
|
|
8
|
-
export declare function AuthView({ auth: authState }: AuthViewProps): import("react").JSX.Element
|
|
8
|
+
export declare function AuthView({ auth: authState }: AuthViewProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAtom
|
|
3
|
-
} from "../../chunks/chunk-
|
|
4
|
-
import "../../chunks/chunk-
|
|
3
|
+
} from "../../chunks/chunk-D6UJHBJJ.js";
|
|
4
|
+
import "../../chunks/chunk-CFNRVI3Y.js";
|
|
5
5
|
import {
|
|
6
6
|
dist_default
|
|
7
7
|
} from "../../chunks/chunk-I4OYYAX5.js";
|
|
@@ -16,25 +16,25 @@ import { IcRoundArrowForward, IcRoundPublish } from "../icons.js";
|
|
|
16
16
|
|
|
17
17
|
// src/dashboard/app/AuthView.module.css
|
|
18
18
|
var AuthView_default = {
|
|
19
|
-
"AuthView-
|
|
20
|
-
"
|
|
21
|
-
"AuthView-text": "alinea-AuthView-text",
|
|
22
|
-
"AuthViewText": "alinea-AuthView-text",
|
|
19
|
+
"AuthView-surface": "alinea-AuthView-surface",
|
|
20
|
+
"AuthViewSurface": "alinea-AuthView-surface",
|
|
23
21
|
"AuthView": "alinea-AuthView",
|
|
24
|
-
"AuthView-heading": "alinea-AuthView-heading",
|
|
25
|
-
"AuthViewHeading": "alinea-AuthView-heading",
|
|
26
22
|
"AuthView-link": "alinea-AuthView-link",
|
|
27
23
|
"AuthViewLink": "alinea-AuthView-link",
|
|
28
|
-
"AuthView-
|
|
29
|
-
"
|
|
30
|
-
"AuthView-surface": "alinea-AuthView-surface",
|
|
31
|
-
"AuthViewSurface": "alinea-AuthView-surface",
|
|
24
|
+
"AuthView-actionRow": "alinea-AuthView-actionRow",
|
|
25
|
+
"AuthViewActionRow": "alinea-AuthView-actionRow",
|
|
32
26
|
"AuthView-loader": "alinea-AuthView-loader",
|
|
33
27
|
"AuthViewLoader": "alinea-AuthView-loader",
|
|
28
|
+
"AuthView-panel": "alinea-AuthView-panel",
|
|
29
|
+
"AuthViewPanel": "alinea-AuthView-panel",
|
|
30
|
+
"AuthView-heading": "alinea-AuthView-heading",
|
|
31
|
+
"AuthViewHeading": "alinea-AuthView-heading",
|
|
34
32
|
"AuthView-mark": "alinea-AuthView-mark",
|
|
35
33
|
"AuthViewMark": "alinea-AuthView-mark",
|
|
36
|
-
"AuthView-
|
|
37
|
-
"
|
|
34
|
+
"AuthView-text": "alinea-AuthView-text",
|
|
35
|
+
"AuthViewText": "alinea-AuthView-text",
|
|
36
|
+
"AuthView-title": "alinea-AuthView-title",
|
|
37
|
+
"AuthViewTitle": "alinea-AuthView-title"
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
// src/dashboard/app/AuthView.tsx
|
|
@@ -42,15 +42,13 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
42
42
|
var styles = dist_default(AuthView_default);
|
|
43
43
|
function AuthView({ auth: authState = authAtom }) {
|
|
44
44
|
const [auth, setAuth] = useAtom(authState);
|
|
45
|
-
|
|
45
|
+
const isLoading = auth.status === "loading" || auth.status === "redirecting" || auth.status === "authenticated";
|
|
46
|
+
if (isLoading) {
|
|
46
47
|
return /* @__PURE__ */ jsx(AuthViewLoader, {});
|
|
47
48
|
}
|
|
48
49
|
if (auth.status === "error") {
|
|
49
50
|
throw auth.error;
|
|
50
51
|
}
|
|
51
|
-
if (auth.status === "authenticated") {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
52
|
if (auth.status === "missingHandler") {
|
|
55
53
|
return /* @__PURE__ */ jsx(AuthViewFrame, { title: "Ready to deploy?", children: /* @__PURE__ */ jsxs("p", { className: styles.AuthView.text(), children: [
|
|
56
54
|
"Alinea requires a",
|
|
@@ -95,7 +93,7 @@ function AuthView({ auth: authState = authAtom }) {
|
|
|
95
93
|
] });
|
|
96
94
|
}
|
|
97
95
|
function AuthViewLoader() {
|
|
98
|
-
return /* @__PURE__ */ jsx("div", { className: styles.AuthView(), children: /* @__PURE__ */ jsx("div", { className: styles.AuthView.panel(), children: /* @__PURE__ */ jsx("div", { className: styles.AuthView.loader(), children: /* @__PURE__ */ jsx(ProgressCircle, { isIndeterminate: true, "aria-label": "
|
|
96
|
+
return /* @__PURE__ */ jsx("div", { className: styles.AuthView(), children: /* @__PURE__ */ jsx("div", { className: styles.AuthView.panel(), children: /* @__PURE__ */ jsx("div", { className: styles.AuthView.loader(), children: /* @__PURE__ */ jsx(ProgressCircle, { isIndeterminate: true, "aria-label": "Loading" }) }) }) });
|
|
99
97
|
}
|
|
100
98
|
function AuthViewFrame({ title, children }) {
|
|
101
99
|
return /* @__PURE__ */ jsx("div", { className: styles.AuthView(), children: /* @__PURE__ */ jsx("div", { className: styles.AuthView.panel(), children: /* @__PURE__ */ jsxs(Surface, { className: styles.AuthView.surface(), children: [
|
|
@@ -8,9 +8,9 @@ import { Icon } from "../../components/Icon.js";
|
|
|
8
8
|
|
|
9
9
|
// src/dashboard/app/Badge.module.css
|
|
10
10
|
var Badge_default = {
|
|
11
|
-
"Badge": "alinea-Badge",
|
|
12
11
|
"Badge-label": "alinea-Badge-label",
|
|
13
|
-
"BadgeLabel": "alinea-Badge-label"
|
|
12
|
+
"BadgeLabel": "alinea-Badge-label",
|
|
13
|
+
"Badge": "alinea-Badge"
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
// src/dashboard/app/Badge.tsx
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../../chunks/chunk-
|
|
2
|
+
useAtomValueRaw
|
|
3
|
+
} from "../../chunks/chunk-D6UJHBJJ.js";
|
|
4
4
|
import {
|
|
5
5
|
atom
|
|
6
|
-
} from "../../chunks/chunk-
|
|
6
|
+
} from "../../chunks/chunk-CFNRVI3Y.js";
|
|
7
7
|
import {
|
|
8
8
|
dist_default
|
|
9
9
|
} from "../../chunks/chunk-I4OYYAX5.js";
|
|
@@ -21,23 +21,23 @@ import { Badge } from "./Badge.js";
|
|
|
21
21
|
var CompactField_default = {
|
|
22
22
|
"CompactField-json": "alinea-CompactField-json",
|
|
23
23
|
"CompactFieldJson": "alinea-CompactField-json",
|
|
24
|
-
"CompactField-list-count": "alinea-CompactField-list-count",
|
|
25
|
-
"CompactFieldListCount": "alinea-CompactField-list-count",
|
|
26
|
-
"CompactField-record-field": "alinea-CompactField-record-field",
|
|
27
|
-
"CompactFieldRecordField": "alinea-CompactField-record-field",
|
|
28
|
-
"CompactField-items": "alinea-CompactField-items",
|
|
29
|
-
"CompactFieldItems": "alinea-CompactField-items",
|
|
30
|
-
"CompactField-text": "alinea-CompactField-text",
|
|
31
|
-
"CompactFieldText": "alinea-CompactField-text",
|
|
32
|
-
"CompactField-muted": "alinea-CompactField-muted",
|
|
33
|
-
"CompactFieldMuted": "alinea-CompactField-muted",
|
|
34
24
|
"CompactField-record": "alinea-CompactField-record",
|
|
35
25
|
"CompactFieldRecord": "alinea-CompactField-record",
|
|
36
|
-
"CompactField-record-label": "alinea-CompactField-record-label",
|
|
37
|
-
"CompactFieldRecordLabel": "alinea-CompactField-record-label",
|
|
38
26
|
"CompactField": "alinea-CompactField",
|
|
39
27
|
"CompactField-record-value": "alinea-CompactField-record-value",
|
|
40
|
-
"CompactFieldRecordValue": "alinea-CompactField-record-value"
|
|
28
|
+
"CompactFieldRecordValue": "alinea-CompactField-record-value",
|
|
29
|
+
"CompactField-record-label": "alinea-CompactField-record-label",
|
|
30
|
+
"CompactFieldRecordLabel": "alinea-CompactField-record-label",
|
|
31
|
+
"CompactField-items": "alinea-CompactField-items",
|
|
32
|
+
"CompactFieldItems": "alinea-CompactField-items",
|
|
33
|
+
"CompactField-muted": "alinea-CompactField-muted",
|
|
34
|
+
"CompactFieldMuted": "alinea-CompactField-muted",
|
|
35
|
+
"CompactField-list-count": "alinea-CompactField-list-count",
|
|
36
|
+
"CompactFieldListCount": "alinea-CompactField-list-count",
|
|
37
|
+
"CompactField-text": "alinea-CompactField-text",
|
|
38
|
+
"CompactFieldText": "alinea-CompactField-text",
|
|
39
|
+
"CompactField-record-field": "alinea-CompactField-record-field",
|
|
40
|
+
"CompactFieldRecordField": "alinea-CompactField-record-field"
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
// src/dashboard/app/CompactField.tsx
|
|
@@ -51,7 +51,7 @@ function CompactField({ field, value }) {
|
|
|
51
51
|
),
|
|
52
52
|
[customView]
|
|
53
53
|
);
|
|
54
|
-
const ResolvedView =
|
|
54
|
+
const ResolvedView = useAtomValueRaw(resolvedViewAtom);
|
|
55
55
|
if (typeof customView === "function") return customView({ field, value });
|
|
56
56
|
if (ResolvedView) return /* @__PURE__ */ jsx(ResolvedView, { field, value });
|
|
57
57
|
return /* @__PURE__ */ jsx(CompactFieldFallback, { field, value });
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
useAtomValueRaw,
|
|
3
3
|
useSetAtom
|
|
4
|
-
} from "../../chunks/chunk-
|
|
5
|
-
import "../../chunks/chunk-
|
|
4
|
+
} from "../../chunks/chunk-D6UJHBJJ.js";
|
|
5
|
+
import "../../chunks/chunk-CFNRVI3Y.js";
|
|
6
6
|
import {
|
|
7
7
|
styler
|
|
8
8
|
} from "../../chunks/chunk-I4OYYAX5.js";
|
|
9
9
|
import "../../chunks/chunk-CQ52GEHY.js";
|
|
10
10
|
|
|
11
11
|
// src/dashboard/app/DashboardErrorBoundary.tsx
|
|
12
|
-
import { Icon, Surface } from "alinea/components";
|
|
12
|
+
import { Button, Icon, Surface } from "alinea/components";
|
|
13
13
|
import { MissingEntryError } from "alinea/dashboard/atoms/entry";
|
|
14
14
|
import { routeAtom, routeGuardAtom } from "alinea/dashboard/atoms/nav";
|
|
15
15
|
import { useEffect, useRef } from "react";
|
|
@@ -65,22 +65,24 @@ import { IcRoundWarning } from "../icons.js";
|
|
|
65
65
|
|
|
66
66
|
// src/dashboard/app/DashboardErrorBoundary.module.css
|
|
67
67
|
var DashboardErrorBoundary_default = {
|
|
68
|
+
"DashboardErrorBoundary-title": "alinea-DashboardErrorBoundary-title",
|
|
69
|
+
"DashboardErrorBoundaryTitle": "alinea-DashboardErrorBoundary-title",
|
|
70
|
+
"DashboardErrorBoundary-actions": "alinea-DashboardErrorBoundary-actions",
|
|
71
|
+
"DashboardErrorBoundaryActions": "alinea-DashboardErrorBoundary-actions",
|
|
68
72
|
"DashboardErrorBoundary-message": "alinea-DashboardErrorBoundary-message",
|
|
69
73
|
"DashboardErrorBoundaryMessage": "alinea-DashboardErrorBoundary-message",
|
|
70
74
|
"DashboardErrorBoundary": "alinea-DashboardErrorBoundary",
|
|
71
75
|
"DashboardErrorBoundary-card": "alinea-DashboardErrorBoundary-card",
|
|
72
76
|
"DashboardErrorBoundaryCard": "alinea-DashboardErrorBoundary-card",
|
|
73
77
|
"DashboardErrorBoundary-heading": "alinea-DashboardErrorBoundary-heading",
|
|
74
|
-
"DashboardErrorBoundaryHeading": "alinea-DashboardErrorBoundary-heading"
|
|
75
|
-
"DashboardErrorBoundary-title": "alinea-DashboardErrorBoundary-title",
|
|
76
|
-
"DashboardErrorBoundaryTitle": "alinea-DashboardErrorBoundary-title"
|
|
78
|
+
"DashboardErrorBoundaryHeading": "alinea-DashboardErrorBoundary-heading"
|
|
77
79
|
};
|
|
78
80
|
|
|
79
81
|
// src/dashboard/app/DashboardErrorBoundary.tsx
|
|
80
82
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
81
83
|
var styles = styler(DashboardErrorBoundary_default);
|
|
82
84
|
function DashboardErrorBoundary({ children }) {
|
|
83
|
-
const route =
|
|
85
|
+
const route = useAtomValueRaw(routeAtom);
|
|
84
86
|
const routeKey = JSON.stringify(route);
|
|
85
87
|
return /* @__PURE__ */ jsx(DashboardRouteErrorBoundary, { routeKey, children });
|
|
86
88
|
}
|
|
@@ -89,7 +91,7 @@ function DashboardRouteErrorBoundary({
|
|
|
89
91
|
routeKey
|
|
90
92
|
}) {
|
|
91
93
|
const { ErrorBoundary, didCatch, error, reset } = index_module_default();
|
|
92
|
-
const route =
|
|
94
|
+
const route = useAtomValueRaw(routeAtom);
|
|
93
95
|
const setRoute = useSetAtom(routeAtom);
|
|
94
96
|
const setRouteGuard = useSetAtom(routeGuardAtom);
|
|
95
97
|
const previousRouteKey = useRef(routeKey);
|
|
@@ -106,17 +108,27 @@ function DashboardRouteErrorBoundary({
|
|
|
106
108
|
}, [error, route, setRoute, setRouteGuard]);
|
|
107
109
|
if (didCatch && error instanceof MissingEntryError) return null;
|
|
108
110
|
if (didCatch) {
|
|
109
|
-
const message =
|
|
111
|
+
const message = errorMessage(error);
|
|
110
112
|
return /* @__PURE__ */ jsx("div", { className: styles.DashboardErrorBoundary(), children: /* @__PURE__ */ jsxs(Surface, { className: styles.DashboardErrorBoundary.card(), children: [
|
|
111
113
|
/* @__PURE__ */ jsxs("div", { className: styles.DashboardErrorBoundary.heading(), children: [
|
|
112
114
|
/* @__PURE__ */ jsx(Icon, { icon: IcRoundWarning }),
|
|
113
115
|
/* @__PURE__ */ jsx("h1", { className: styles.DashboardErrorBoundary.title(), children: "Oops, something went wrong" })
|
|
114
116
|
] }),
|
|
115
|
-
/* @__PURE__ */ jsx("pre", { className: styles.DashboardErrorBoundary.message(), children: message })
|
|
117
|
+
/* @__PURE__ */ jsx("pre", { className: styles.DashboardErrorBoundary.message(), children: message }),
|
|
118
|
+
/* @__PURE__ */ jsx("div", { className: styles.DashboardErrorBoundary.actions(), children: /* @__PURE__ */ jsx(Button, { intent: "primary", onPress: reloadDashboard, children: "Reload dashboard" }) })
|
|
116
119
|
] }) });
|
|
117
120
|
}
|
|
118
121
|
return /* @__PURE__ */ jsx(ErrorBoundary, { children });
|
|
119
122
|
}
|
|
123
|
+
function errorMessage(error) {
|
|
124
|
+
if (!(error instanceof Error)) return String(error);
|
|
125
|
+
if (!(error.cause instanceof Error)) return error.message;
|
|
126
|
+
return `${error.message}
|
|
127
|
+
Caused by: ${error.cause.message}`;
|
|
128
|
+
}
|
|
129
|
+
function reloadDashboard() {
|
|
130
|
+
window.location.reload();
|
|
131
|
+
}
|
|
120
132
|
export {
|
|
121
133
|
DashboardErrorBoundary
|
|
122
134
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../../chunks/chunk-
|
|
4
|
-
import "../../chunks/chunk-
|
|
2
|
+
useAtomValueRaw
|
|
3
|
+
} from "../../chunks/chunk-D6UJHBJJ.js";
|
|
4
|
+
import "../../chunks/chunk-CFNRVI3Y.js";
|
|
5
5
|
import {
|
|
6
6
|
styler
|
|
7
7
|
} from "../../chunks/chunk-I4OYYAX5.js";
|
|
@@ -22,10 +22,10 @@ import { Sidebar, SidebarFooter, SidebarHeader } from "./ui/Sidebar.js";
|
|
|
22
22
|
|
|
23
23
|
// src/dashboard/app/DashboardLayout.module.css
|
|
24
24
|
var DashboardLayout_default = {
|
|
25
|
-
"DashboardLayout-create": "alinea-DashboardLayout-create",
|
|
26
|
-
"DashboardLayoutCreate": "alinea-DashboardLayout-create",
|
|
27
25
|
"is-toolbar": "alinea-is-toolbar",
|
|
28
|
-
"isToolbar": "alinea-is-toolbar"
|
|
26
|
+
"isToolbar": "alinea-is-toolbar",
|
|
27
|
+
"DashboardLayout-create": "alinea-DashboardLayout-create",
|
|
28
|
+
"DashboardLayoutCreate": "alinea-DashboardLayout-create"
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
// src/dashboard/app/DashboardLayout.tsx
|
|
@@ -39,7 +39,14 @@ function DashboardLayout({
|
|
|
39
39
|
workspace
|
|
40
40
|
}) {
|
|
41
41
|
return /* @__PURE__ */ jsx(DashboardScope, { value: { page, root, workspace }, children: /* @__PURE__ */ jsx(AppShell, { children: /* @__PURE__ */ jsxs(AppShellInner, { children: [
|
|
42
|
-
/* @__PURE__ */ jsx(
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
WorkspaceRoots,
|
|
44
|
+
{
|
|
45
|
+
canManageMembers,
|
|
46
|
+
page,
|
|
47
|
+
root
|
|
48
|
+
}
|
|
49
|
+
),
|
|
43
50
|
/* @__PURE__ */ jsx(AppShellContent, { children: /* @__PURE__ */ jsx(
|
|
44
51
|
SidebarLayout,
|
|
45
52
|
{
|
|
@@ -69,7 +76,7 @@ function CreateEntryButton({
|
|
|
69
76
|
root,
|
|
70
77
|
toolbar = false
|
|
71
78
|
}) {
|
|
72
|
-
const canCreate =
|
|
79
|
+
const canCreate = useAtomValueRaw(root.canCreate);
|
|
73
80
|
if (!canCreate) return null;
|
|
74
81
|
return /* @__PURE__ */ jsxs(DialogTrigger, { children: [
|
|
75
82
|
/* @__PURE__ */ jsx(
|
|
@@ -2,6 +2,7 @@ import type { ComponentType } from 'react';
|
|
|
2
2
|
export interface DashboardMetaProps {
|
|
3
3
|
color: string;
|
|
4
4
|
icon?: ComponentType;
|
|
5
|
+
plain?: boolean;
|
|
5
6
|
title: string;
|
|
6
7
|
}
|
|
7
|
-
export declare function DashboardMeta({ color, icon, title }: DashboardMetaProps): import("react").JSX.Element;
|
|
8
|
+
export declare function DashboardMeta({ color, icon, plain, title }: DashboardMetaProps): import("react").JSX.Element;
|
|
@@ -7,16 +7,31 @@ import { renderToString } from "react-dom/server";
|
|
|
7
7
|
import { AlineaLogo } from "./AlineaLogo.js";
|
|
8
8
|
import { LogoShape } from "./LogoShape.js";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
function faviconHref(color, Icon) {
|
|
11
|
-
const svg = renderToString(
|
|
10
|
+
function faviconHref(color, Icon, plain) {
|
|
11
|
+
const svg = plain ? renderToString(
|
|
12
|
+
/* @__PURE__ */ jsx(
|
|
13
|
+
AlineaLogo,
|
|
14
|
+
{
|
|
15
|
+
width: "36",
|
|
16
|
+
height: "36",
|
|
17
|
+
viewBox: "-4 -4 32 32",
|
|
18
|
+
style: { color }
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
) : renderToString(
|
|
12
22
|
/* @__PURE__ */ jsx(LogoShape, { width: "36", height: "36", background: color, icon: Icon })
|
|
13
23
|
);
|
|
14
24
|
return `data:image/svg+xml;base64,${btoa(svg)}`;
|
|
15
25
|
}
|
|
16
|
-
function DashboardMeta({
|
|
26
|
+
function DashboardMeta({
|
|
27
|
+
color,
|
|
28
|
+
icon,
|
|
29
|
+
plain = false,
|
|
30
|
+
title
|
|
31
|
+
}) {
|
|
17
32
|
const href = useMemo(
|
|
18
|
-
() => faviconHref(color, icon ?? AlineaLogo),
|
|
19
|
-
[color, icon]
|
|
33
|
+
() => faviconHref(color, icon ?? AlineaLogo, plain),
|
|
34
|
+
[color, icon, plain]
|
|
20
35
|
);
|
|
21
36
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22
37
|
/* @__PURE__ */ jsx("title", { children: title }),
|