alinea 2.0.0-preview.2 → 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 +157 -103
- package/dist/adapter/next/DevRemote.js +10 -2
- package/dist/adapter/next/previews.js +4 -1
- package/dist/adapter/next/previews.spec.d.ts +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 +159 -42
- 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-UVOEM4AH.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/Breadcrumbs.js +2 -2
- package/dist/components/Calendar.js +6 -6
- package/dist/components/Checkbox.js +3 -3
- package/dist/components/ComboBox.js +11 -11
- package/dist/components/DateField.js +3 -3
- package/dist/components/DatePicker.js +4 -4
- package/dist/components/DateRangePicker.js +6 -6
- package/dist/components/Disclosure.js +8 -8
- package/dist/components/Label.js +5 -5
- package/dist/components/List.js +34 -34
- package/dist/components/Menu.js +4 -4
- package/dist/components/Modal.js +3 -3
- package/dist/components/MultipleSelect.js +25 -25
- package/dist/components/NumberField.js +6 -6
- package/dist/components/ProgressCircle.js +2 -2
- package/dist/components/RadioGroup.js +2 -2
- package/dist/components/SearchField.js +3 -3
- package/dist/components/Select.js +7 -7
- package/dist/components/Surface.js +2 -2
- package/dist/components/Table.js +7 -7
- package/dist/components/Tabs.js +4 -4
- package/dist/components/TagGroup.js +2 -2
- package/dist/components/TextField.js +6 -6
- package/dist/components/TimeField.js +2 -2
- package/dist/components/Toggle.d.ts +1 -1
- package/dist/components/Toggle.js +2 -2
- package/dist/components/Toolbar.js +2 -2
- package/dist/components/Tooltip.js +3 -3
- package/dist/components/Tree.d.ts +4 -2
- package/dist/components/Tree.js +18 -4
- 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/Graph.d.ts +1 -1
- package/dist/core/Id.d.ts +1 -0
- package/dist/core/Id.js +8 -0
- package/dist/core/Infer.d.ts +8 -1
- package/dist/core/db/EntryAliases.js +1 -4
- package/dist/core/db/EntryResolver.js +6 -6
- package/dist/core/db/EntryTransaction.js +1 -0
- package/dist/core/db/Operation.d.ts +2 -2
- package/dist/core/db/Operation.js +15 -4
- package/dist/dashboard/App.js +37 -17
- package/dist/dashboard/StoryProvider.js +2 -2
- package/dist/dashboard/app/AccessDenied.d.ts +16 -1
- package/dist/dashboard/app/AccessDenied.js +21 -12
- package/dist/dashboard/app/ActivityStatus.js +19 -19
- 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 +16 -18
- package/dist/dashboard/app/Badge.js +2 -2
- package/dist/dashboard/app/CompactField.js +17 -17
- package/dist/dashboard/app/DashboardErrorBoundary.js +22 -10
- 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 +25 -25
- package/dist/dashboard/app/EntryReferences.js +16 -16
- package/dist/dashboard/app/EntrySidebar.js +26 -26
- package/dist/dashboard/app/EntrySidebarPreview.js +61 -34
- package/dist/dashboard/app/EntrySidebarPreview.story.d.ts +6 -1
- package/dist/dashboard/app/EntryTranslationBanner.js +8 -8
- package/dist/dashboard/app/Explorer.d.ts +2 -1
- package/dist/dashboard/app/Explorer.js +79 -67
- package/dist/dashboard/app/ExplorerCards.js +62 -66
- package/dist/dashboard/app/ExplorerFileCard.js +20 -20
- package/dist/dashboard/app/ExplorerList.js +22 -22
- package/dist/dashboard/app/ExplorerModal.js +3 -3
- package/dist/dashboard/app/ExplorerPickerContent.js +2 -2
- package/dist/dashboard/app/ExplorerTable.js +68 -68
- package/dist/dashboard/app/ImagePicker.js +7 -7
- package/dist/dashboard/app/LinkPicker.js +44 -24
- package/dist/dashboard/app/LocaleMenu.js +5 -7
- package/dist/dashboard/app/SidebarLayout.js +7 -7
- package/dist/dashboard/app/SidebarTree.js +66 -74
- package/dist/dashboard/app/WorkspaceMenu.d.ts +10 -3
- package/dist/dashboard/app/WorkspaceMenu.js +85 -64
- 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 +82 -107
- package/dist/dashboard/app/editor/FileEditor.js +31 -31
- package/dist/dashboard/app/editor/FilePreview.js +4 -4
- package/dist/dashboard/app/editor/MediaAltField.view.js +4 -4
- package/dist/dashboard/app/modals/CreateEntry.js +14 -14
- package/dist/dashboard/app/pages/EntryPage.js +28 -30
- 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 +35 -35
- package/dist/dashboard/app/ui/DashboardModal.js +19 -19
- package/dist/dashboard/app/ui/Rail.js +3 -3
- 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/check/CheckField.view.js +2 -2
- package/dist/field/code/CodeField.view.js +15 -15
- package/dist/field/link/EntryLink.d.ts +1 -1
- package/dist/field/link/EntryLink.js +1 -0
- package/dist/field/link/Link.js +1 -0
- package/dist/field/link/LinkField.d.ts +5 -0
- package/dist/field/link/LinkField.view.js +81 -64
- package/dist/field/list/ListField.view.js +26 -26
- package/dist/field/localiser/LocalisedField.view.js +76 -5
- package/dist/field/metadata/MetadataField.d.ts +2 -0
- package/dist/field/metadata/MetadataField.js +2 -1
- package/dist/field/metadata/MetadataField.view.js +20 -20
- package/dist/field/richtext/PickTextLink.js +6 -6
- package/dist/field/richtext/RichTextBlock.js +6 -6
- package/dist/field/richtext/RichTextBlocks.js +1 -1
- package/dist/field/richtext/RichTextExtensions.js +23 -23
- package/dist/field/richtext/RichTextField.view.js +9 -9
- package/dist/field/richtext/RichTextState.js +1 -1
- package/dist/field/text/TextField.view.js +2 -2
- package/dist/index.css +436 -28
- package/dist/preview/PreviewMessage.d.ts +3 -0
- package/dist/preview/PreviewMessage.js +1 -0
- package/dist/preview/RegisterPreview.d.ts +1 -1
- package/dist/preview/RegisterPreview.js +28 -10
- package/dist/preview/react.d.ts +5 -1
- package/dist/preview/react.js +12 -9
- package/dist/preview/widget.js +6 -12
- package/dist/query.d.ts +7 -7
- package/package.json +1 -1
- package/dist/chunks/chunk-STAJCW4Z.js +0 -322
- package/dist/chunks/chunk-U4VOHNR2.js +0 -210
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
useAtomValueRaw,
|
|
3
3
|
useSetAtom
|
|
4
|
-
} from "../../chunks/chunk-
|
|
4
|
+
} from "../../chunks/chunk-D6UJHBJJ.js";
|
|
5
5
|
import {
|
|
6
6
|
atom
|
|
7
|
-
} from "../../chunks/chunk-
|
|
7
|
+
} from "../../chunks/chunk-CFNRVI3Y.js";
|
|
8
8
|
import "../../chunks/chunk-CQ52GEHY.js";
|
|
9
9
|
|
|
10
10
|
// src/dashboard/app/ImagePicker.tsx
|
|
@@ -57,7 +57,7 @@ function ImagePicker(options) {
|
|
|
57
57
|
function ImagePickerModalContent({ label, options }) {
|
|
58
58
|
const modal = useDashboardModal();
|
|
59
59
|
const { page, root, workspace } = useDashboardContext();
|
|
60
|
-
const policy =
|
|
60
|
+
const policy = useAtomValueRaw(policyAtom);
|
|
61
61
|
const mediaRoot = Object.entries(workspace.roots).find(
|
|
62
62
|
([key, value]) => policy.canRead({ workspace: root.workspace, root: key }) && Boolean(getRoot(value).isMediaRoot)
|
|
63
63
|
)?.[0];
|
|
@@ -66,7 +66,7 @@ function ImagePickerModalContent({ label, options }) {
|
|
|
66
66
|
root: mediaRoot ?? root.key
|
|
67
67
|
};
|
|
68
68
|
const pickerRoot = rootAtoms(location.workspace, location.root ?? root.key);
|
|
69
|
-
const pickerI18n =
|
|
69
|
+
const pickerI18n = useAtomValueRaw(pickerRoot.i18n);
|
|
70
70
|
const initialLocale = normalizePickerLocale(
|
|
71
71
|
location.locale ?? options.selectedLocale ?? page.locale,
|
|
72
72
|
pickerI18n?.locales ?? []
|
|
@@ -93,9 +93,9 @@ function ImagePickerModalContent({ label, options }) {
|
|
|
93
93
|
});
|
|
94
94
|
return { explorer: explorer2, tree: tree2 };
|
|
95
95
|
}, [explorerIdentity]);
|
|
96
|
-
const explorerPage =
|
|
96
|
+
const explorerPage = useAtomValueRaw(explorer.page);
|
|
97
97
|
const onConfirm = useSetAtom(explorer.onConfirm);
|
|
98
|
-
const selection =
|
|
98
|
+
const selection = useAtomValueRaw(explorer.selection);
|
|
99
99
|
const selectedItems = selection === "all" ? 0 : selection.size;
|
|
100
100
|
if (!explorerPage)
|
|
101
101
|
return /* @__PURE__ */ jsx(DashboardModalDialog, { "aria-label": label, variant: "explorer", isLoading: true });
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
useAtomValueRaw,
|
|
3
3
|
useSetAtom
|
|
4
|
-
} from "../../chunks/chunk-
|
|
4
|
+
} from "../../chunks/chunk-D6UJHBJJ.js";
|
|
5
5
|
import {
|
|
6
6
|
atom
|
|
7
|
-
} from "../../chunks/chunk-
|
|
7
|
+
} from "../../chunks/chunk-CFNRVI3Y.js";
|
|
8
8
|
import {
|
|
9
9
|
dist_default
|
|
10
10
|
} from "../../chunks/chunk-I4OYYAX5.js";
|
|
@@ -19,7 +19,6 @@ import { rootAtoms } from "alinea/dashboard/atoms/root";
|
|
|
19
19
|
import { useDashboardContext } from "alinea/dashboard/hooks";
|
|
20
20
|
import {
|
|
21
21
|
Suspense,
|
|
22
|
-
startTransition,
|
|
23
22
|
useMemo,
|
|
24
23
|
useState
|
|
25
24
|
} from "react";
|
|
@@ -40,9 +39,13 @@ import {
|
|
|
40
39
|
|
|
41
40
|
// src/dashboard/app/LinkPicker.module.css
|
|
42
41
|
var LinkPicker_default = {
|
|
42
|
+
"LinkPickerCompact-footer": "alinea-LinkPickerCompact-footer",
|
|
43
|
+
"LinkPickerCompactFooter": "alinea-LinkPickerCompact-footer",
|
|
44
|
+
"LinkPickerCompact-selection": "alinea-LinkPickerCompact-selection",
|
|
45
|
+
"LinkPickerCompactSelection": "alinea-LinkPickerCompact-selection",
|
|
46
|
+
"LinkPickerCompact": "alinea-LinkPickerCompact",
|
|
43
47
|
"LinkPicker-popover": "alinea-LinkPicker-popover",
|
|
44
48
|
"LinkPickerPopover": "alinea-LinkPicker-popover",
|
|
45
|
-
"LinkPickerCompact": "alinea-LinkPickerCompact",
|
|
46
49
|
"LinkPickerCompact-header": "alinea-LinkPickerCompact-header",
|
|
47
50
|
"LinkPickerCompactHeader": "alinea-LinkPickerCompact-header"
|
|
48
51
|
};
|
|
@@ -92,7 +95,7 @@ function LinkPickerModalLoading() {
|
|
|
92
95
|
}
|
|
93
96
|
function LinkPickerModalContent({ options }) {
|
|
94
97
|
const { explorer, tree } = useLinkPickerExplorer(options);
|
|
95
|
-
const page =
|
|
98
|
+
const page = useAtomValueRaw(explorer.page);
|
|
96
99
|
if (!page) return /* @__PURE__ */ jsx(LinkPickerModalLoading, {});
|
|
97
100
|
return /* @__PURE__ */ jsx(
|
|
98
101
|
LinkPickerExpanded,
|
|
@@ -129,7 +132,7 @@ function LinkPickerReady({
|
|
|
129
132
|
options
|
|
130
133
|
}) {
|
|
131
134
|
const { explorer, tree } = useLinkPickerExplorer(options);
|
|
132
|
-
const page =
|
|
135
|
+
const page = useAtomValueRaw(explorer.page);
|
|
133
136
|
if (!page)
|
|
134
137
|
return /* @__PURE__ */ jsx(
|
|
135
138
|
LinkPickerLoading,
|
|
@@ -174,7 +177,7 @@ function useLinkPickerExplorer(options) {
|
|
|
174
177
|
root: root.key
|
|
175
178
|
};
|
|
176
179
|
const pickerRoot = rootAtoms(location.workspace, location.root ?? root.key);
|
|
177
|
-
const pickerI18n =
|
|
180
|
+
const pickerI18n = useAtomValueRaw(pickerRoot.i18n);
|
|
178
181
|
const initialLocale = normalizePickerLocale(
|
|
179
182
|
location.locale ?? options.selectedLocale ?? page.locale,
|
|
180
183
|
pickerI18n?.locales ?? []
|
|
@@ -210,18 +213,27 @@ function LinkPickerCompact({
|
|
|
210
213
|
onExpand
|
|
211
214
|
}) {
|
|
212
215
|
const popover = useDashboardModal();
|
|
216
|
+
const selection = useAtomValueRaw(explorer.selection);
|
|
213
217
|
const setSelection = useSetAtom(explorer.selection);
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
const selectsMultiple = explorer.selectionMode === "multiple";
|
|
219
|
+
const selectedItems = selection === "all" ? 0 : selection.size;
|
|
220
|
+
function commitSelection(selection2) {
|
|
221
|
+
if (selection2 === "all" || selection2.size === 0 && explorer.selectionMode !== "multiple")
|
|
222
|
+
return;
|
|
223
|
+
onCommit?.([...selection2].map(String));
|
|
224
|
+
popover.close();
|
|
220
225
|
}
|
|
221
226
|
function commitEntry(entry) {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
227
|
+
if (selectsMultiple) {
|
|
228
|
+
const nextSelection2 = selection === "all" ? /* @__PURE__ */ new Set() : new Set(selection);
|
|
229
|
+
if (nextSelection2.has(entry.id)) nextSelection2.delete(entry.id);
|
|
230
|
+
else nextSelection2.add(entry.id);
|
|
231
|
+
setSelection(nextSelection2);
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
const nextSelection = /* @__PURE__ */ new Set([entry.id]);
|
|
235
|
+
setSelection(nextSelection);
|
|
236
|
+
commitSelection(nextSelection);
|
|
225
237
|
}
|
|
226
238
|
function openExpanded() {
|
|
227
239
|
onExpand();
|
|
@@ -254,10 +266,19 @@ function LinkPickerCompact({
|
|
|
254
266
|
{
|
|
255
267
|
compactTable: true,
|
|
256
268
|
explorer,
|
|
257
|
-
onSelectionChange: commitSelection,
|
|
269
|
+
onSelectionChange: selectsMultiple ? void 0 : commitSelection,
|
|
258
270
|
page
|
|
259
271
|
}
|
|
260
|
-
)
|
|
272
|
+
),
|
|
273
|
+
selectsMultiple && /* @__PURE__ */ jsxs("div", { className: styles.LinkPickerCompact.footer(), children: [
|
|
274
|
+
/* @__PURE__ */ jsxs("span", { className: styles.LinkPickerCompact.selection(), children: [
|
|
275
|
+
selectedItems,
|
|
276
|
+
" ",
|
|
277
|
+
selectedItems === 1 ? "item" : "items",
|
|
278
|
+
" selected"
|
|
279
|
+
] }),
|
|
280
|
+
/* @__PURE__ */ jsx(Button, { intent: "primary", onPress: () => commitSelection(selection), children: "Select" })
|
|
281
|
+
] })
|
|
261
282
|
] });
|
|
262
283
|
}
|
|
263
284
|
function LinkPickerExpanded({
|
|
@@ -268,19 +289,18 @@ function LinkPickerExpanded({
|
|
|
268
289
|
}) {
|
|
269
290
|
const modal = useDashboardModal();
|
|
270
291
|
const onConfirm = useSetAtom(explorer.onConfirm);
|
|
271
|
-
const selection =
|
|
292
|
+
const selection = useAtomValueRaw(explorer.selection);
|
|
272
293
|
const selectedItems = selection === "all" ? 0 : selection.size;
|
|
273
294
|
function onSubmit() {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
modal.close();
|
|
277
|
-
});
|
|
295
|
+
onConfirm();
|
|
296
|
+
modal.close();
|
|
278
297
|
}
|
|
279
298
|
return /* @__PURE__ */ jsx(DashboardModalDialog, { "aria-label": expandedPickerLabel, variant: "explorer", children: /* @__PURE__ */ jsx(ExplorerModalSuspense, { children: /* @__PURE__ */ jsxs(ExplorerModal, { children: [
|
|
280
299
|
/* @__PURE__ */ jsx(
|
|
281
300
|
ExplorerHeader,
|
|
282
301
|
{
|
|
283
302
|
autoFocusSearch: true,
|
|
303
|
+
canBrowse: options.enableNavigation !== false,
|
|
284
304
|
controls: /* @__PURE__ */ jsx(DashboardModalCloseButton, {}),
|
|
285
305
|
explorer,
|
|
286
306
|
navigate: true,
|
|
@@ -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
|
$7705c033048f6da7$export$353f5b6fc5456de1
|
|
7
7
|
} from "../../chunks/chunk-VXZM6V4P.js";
|
|
@@ -20,7 +20,6 @@ import "../../chunks/chunk-CQ52GEHY.js";
|
|
|
20
20
|
|
|
21
21
|
// src/dashboard/app/LocaleMenu.tsx
|
|
22
22
|
import { Icon, Menu, MenuItem } from "alinea/components";
|
|
23
|
-
import { useTransition } from "react";
|
|
24
23
|
import { IcRoundUnfoldMore } from "../icons.js";
|
|
25
24
|
|
|
26
25
|
// src/dashboard/app/LocaleMenu.module.css
|
|
@@ -68,15 +67,14 @@ function LocaleLabel({ locale }) {
|
|
|
68
67
|
] });
|
|
69
68
|
}
|
|
70
69
|
function LocaleMenu({ root, locale, onLocaleChange }) {
|
|
71
|
-
const i18n =
|
|
72
|
-
const [isPending, startTransition] = useTransition();
|
|
70
|
+
const i18n = useAtomValueRaw(root.i18n);
|
|
73
71
|
if (!i18n || i18n.locales.length === 0) return null;
|
|
74
72
|
const activeLocale = locale ?? i18n.locales[0];
|
|
75
73
|
if (!activeLocale) return null;
|
|
76
74
|
return /* @__PURE__ */ jsx(
|
|
77
75
|
Menu,
|
|
78
76
|
{
|
|
79
|
-
label: /* @__PURE__ */ jsxs($7705c033048f6da7$export$353f5b6fc5456de1, { className: styles.LocaleMenu.trigger(),
|
|
77
|
+
label: /* @__PURE__ */ jsxs($7705c033048f6da7$export$353f5b6fc5456de1, { className: styles.LocaleMenu.trigger(), children: [
|
|
80
78
|
/* @__PURE__ */ jsx(LocaleLabel, { locale: activeLocale }),
|
|
81
79
|
/* @__PURE__ */ jsx(
|
|
82
80
|
Icon,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAtom,
|
|
3
|
-
|
|
4
|
-
} from "../../chunks/chunk-
|
|
5
|
-
import "../../chunks/chunk-
|
|
3
|
+
useAtomValueRaw
|
|
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";
|
|
@@ -1100,7 +1100,7 @@ function SidebarLayout({
|
|
|
1100
1100
|
side,
|
|
1101
1101
|
visible = true
|
|
1102
1102
|
}) {
|
|
1103
|
-
const isMobile =
|
|
1103
|
+
const isMobile = useAtomValueRaw(dashboardMobileAtom);
|
|
1104
1104
|
const [width, setWidth] = useAtom(
|
|
1105
1105
|
side === "left" ? navigationSidebarWidthAtom : entrySidebarWidthAtom
|
|
1106
1106
|
);
|
|
@@ -1126,7 +1126,6 @@ function SidebarLayout({
|
|
|
1126
1126
|
maxSize: isMobile ? Infinity : side === "left" ? 480 : 640,
|
|
1127
1127
|
preferredSize: width,
|
|
1128
1128
|
priority: de.Low,
|
|
1129
|
-
visible: sidebarVisible,
|
|
1130
1129
|
children: sidebar
|
|
1131
1130
|
},
|
|
1132
1131
|
"sidebar"
|
|
@@ -1135,11 +1134,12 @@ function SidebarLayout({
|
|
|
1135
1134
|
Ve,
|
|
1136
1135
|
{
|
|
1137
1136
|
ref: allotment,
|
|
1137
|
+
defaultSizes: sidebarVisible ? side === "left" ? [width, 500] : [200, width] : [500],
|
|
1138
1138
|
proportionalLayout: false,
|
|
1139
1139
|
onDragEnd: saveWidth,
|
|
1140
1140
|
onReset: resetWidth,
|
|
1141
1141
|
children: [
|
|
1142
|
-
side === "left" && sidebarPane,
|
|
1142
|
+
sidebarVisible && side === "left" && sidebarPane,
|
|
1143
1143
|
/* @__PURE__ */ jsx(
|
|
1144
1144
|
Ve.Pane,
|
|
1145
1145
|
{
|
|
@@ -1150,7 +1150,7 @@ function SidebarLayout({
|
|
|
1150
1150
|
},
|
|
1151
1151
|
"content"
|
|
1152
1152
|
),
|
|
1153
|
-
side === "right" && sidebarPane
|
|
1153
|
+
sidebarVisible && side === "right" && sidebarPane
|
|
1154
1154
|
]
|
|
1155
1155
|
}
|
|
1156
1156
|
) });
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAtom,
|
|
3
|
-
|
|
3
|
+
useAtomValueRaw,
|
|
4
4
|
useSetAtom
|
|
5
|
-
} from "../../chunks/chunk-
|
|
6
|
-
import "../../chunks/chunk-
|
|
5
|
+
} from "../../chunks/chunk-D6UJHBJJ.js";
|
|
6
|
+
import "../../chunks/chunk-CFNRVI3Y.js";
|
|
7
7
|
import {
|
|
8
8
|
$143fb904d86051ce$export$89be5a243e59c4b2
|
|
9
9
|
} from "../../chunks/chunk-VXZM6V4P.js";
|
|
@@ -43,62 +43,62 @@ import { LocaleMenu } from "./LocaleMenu.js";
|
|
|
43
43
|
|
|
44
44
|
// src/dashboard/app/SidebarTree.module.css
|
|
45
45
|
var SidebarTree_default = {
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"SidebarTree-
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"SidebarTree-rootButton-label": "alinea-SidebarTree-rootButton-label",
|
|
53
|
-
"SidebarTreeRootButtonLabel": "alinea-SidebarTree-rootButton-label",
|
|
46
|
+
"is-short": "alinea-is-short",
|
|
47
|
+
"isShort": "alinea-is-short",
|
|
48
|
+
"SidebarTree-skeleton-row": "alinea-SidebarTree-skeleton-row",
|
|
49
|
+
"SidebarTreeSkeletonRow": "alinea-SidebarTree-skeleton-row",
|
|
50
|
+
"SidebarTree-itemLoading": "alinea-SidebarTree-itemLoading",
|
|
51
|
+
"SidebarTreeItemLoading": "alinea-SidebarTree-itemLoading",
|
|
54
52
|
"SidebarTree-root": "alinea-SidebarTree-root",
|
|
55
53
|
"SidebarTreeRoot": "alinea-SidebarTree-root",
|
|
56
54
|
"SidebarTree-rootButton-locale": "alinea-SidebarTree-rootButton-locale",
|
|
57
55
|
"SidebarTreeRootButtonLocale": "alinea-SidebarTree-rootButton-locale",
|
|
58
|
-
"is-
|
|
59
|
-
"
|
|
60
|
-
"SidebarTree-
|
|
61
|
-
"
|
|
62
|
-
"SidebarTree-
|
|
63
|
-
"
|
|
64
|
-
"SidebarTree-
|
|
65
|
-
"
|
|
66
|
-
"SidebarTree-skeleton-row": "alinea-SidebarTree-skeleton-row",
|
|
67
|
-
"SidebarTreeSkeletonRow": "alinea-SidebarTree-skeleton-row",
|
|
56
|
+
"is-loading": "alinea-is-loading",
|
|
57
|
+
"isLoading": "alinea-is-loading",
|
|
58
|
+
"SidebarTree-rootButton-action": "alinea-SidebarTree-rootButton-action",
|
|
59
|
+
"SidebarTreeRootButtonAction": "alinea-SidebarTree-rootButton-action",
|
|
60
|
+
"SidebarTree-entryLink": "alinea-SidebarTree-entryLink",
|
|
61
|
+
"SidebarTreeEntryLink": "alinea-SidebarTree-entryLink",
|
|
62
|
+
"SidebarTree-tree-viewport": "alinea-SidebarTree-tree-viewport",
|
|
63
|
+
"SidebarTreeTreeViewport": "alinea-SidebarTree-tree-viewport",
|
|
68
64
|
"is-archived": "alinea-is-archived",
|
|
69
65
|
"isArchived": "alinea-is-archived",
|
|
70
66
|
"is-untranslated": "alinea-is-untranslated",
|
|
71
67
|
"isUntranslated": "alinea-is-untranslated",
|
|
72
|
-
"SidebarTree-entryLink": "alinea-SidebarTree-entryLink",
|
|
73
|
-
"SidebarTreeEntryLink": "alinea-SidebarTree-entryLink",
|
|
74
|
-
"SidebarTree-skeleton": "alinea-SidebarTree-skeleton",
|
|
75
|
-
"SidebarTreeSkeleton": "alinea-SidebarTree-skeleton",
|
|
76
|
-
"is-short": "alinea-is-short",
|
|
77
|
-
"isShort": "alinea-is-short",
|
|
78
|
-
"SidebarTree-loading": "alinea-SidebarTree-loading",
|
|
79
|
-
"SidebarTreeLoading": "alinea-SidebarTree-loading",
|
|
80
|
-
"SidebarTree-itemLoading": "alinea-SidebarTree-itemLoading",
|
|
81
|
-
"SidebarTreeItemLoading": "alinea-SidebarTree-itemLoading",
|
|
82
|
-
"SidebarTree-itemLoading-pulse": "alinea-SidebarTree-itemLoading-pulse",
|
|
83
|
-
"SidebarTreeItemLoadingPulse": "alinea-SidebarTree-itemLoading-pulse",
|
|
84
|
-
"SidebarTree-item": "alinea-SidebarTree-item",
|
|
85
|
-
"SidebarTreeItem": "alinea-SidebarTree-item",
|
|
86
68
|
"SidebarTree-skeleton-chevron": "alinea-SidebarTree-skeleton-chevron",
|
|
87
69
|
"SidebarTreeSkeletonChevron": "alinea-SidebarTree-skeleton-chevron",
|
|
88
|
-
"SidebarTree-skeleton-
|
|
89
|
-
"
|
|
90
|
-
"is-loading": "alinea-is-loading",
|
|
91
|
-
"isLoading": "alinea-is-loading",
|
|
92
|
-
"SidebarTree-tree-viewport": "alinea-SidebarTree-tree-viewport",
|
|
93
|
-
"SidebarTreeTreeViewport": "alinea-SidebarTree-tree-viewport",
|
|
94
|
-
"is-unpublished": "alinea-is-unpublished",
|
|
95
|
-
"isUnpublished": "alinea-is-unpublished",
|
|
70
|
+
"SidebarTree-skeleton-pulse": "alinea-SidebarTree-skeleton-pulse",
|
|
71
|
+
"SidebarTreeSkeletonPulse": "alinea-SidebarTree-skeleton-pulse",
|
|
96
72
|
"is-parentSelected": "alinea-is-parentSelected",
|
|
97
73
|
"isParentSelected": "alinea-is-parentSelected",
|
|
98
74
|
"SidebarTree-status": "alinea-SidebarTree-status",
|
|
99
75
|
"SidebarTreeStatus": "alinea-SidebarTree-status",
|
|
100
|
-
"
|
|
101
|
-
"
|
|
76
|
+
"is-selected": "alinea-is-selected",
|
|
77
|
+
"isSelected": "alinea-is-selected",
|
|
78
|
+
"SidebarTree-skeleton-icon": "alinea-SidebarTree-skeleton-icon",
|
|
79
|
+
"SidebarTreeSkeletonIcon": "alinea-SidebarTree-skeleton-icon",
|
|
80
|
+
"is-draft": "alinea-is-draft",
|
|
81
|
+
"isDraft": "alinea-is-draft",
|
|
82
|
+
"SidebarTree-rootButton-label": "alinea-SidebarTree-rootButton-label",
|
|
83
|
+
"SidebarTreeRootButtonLabel": "alinea-SidebarTree-rootButton-label",
|
|
84
|
+
"is-unpublished": "alinea-is-unpublished",
|
|
85
|
+
"isUnpublished": "alinea-is-unpublished",
|
|
86
|
+
"SidebarTree-rootButton": "alinea-SidebarTree-rootButton",
|
|
87
|
+
"SidebarTreeRootButton": "alinea-SidebarTree-rootButton",
|
|
88
|
+
"SidebarTree-item": "alinea-SidebarTree-item",
|
|
89
|
+
"SidebarTreeItem": "alinea-SidebarTree-item",
|
|
90
|
+
"SidebarTree-itemLoading-pulse": "alinea-SidebarTree-itemLoading-pulse",
|
|
91
|
+
"SidebarTreeItemLoadingPulse": "alinea-SidebarTree-itemLoading-pulse",
|
|
92
|
+
"SidebarTree-loading": "alinea-SidebarTree-loading",
|
|
93
|
+
"SidebarTreeLoading": "alinea-SidebarTree-loading",
|
|
94
|
+
"SidebarTree-skeleton": "alinea-SidebarTree-skeleton",
|
|
95
|
+
"SidebarTreeSkeleton": "alinea-SidebarTree-skeleton",
|
|
96
|
+
"SidebarTree-tree": "alinea-SidebarTree-tree",
|
|
97
|
+
"SidebarTreeTree": "alinea-SidebarTree-tree",
|
|
98
|
+
"SidebarTree-skeleton-label": "alinea-SidebarTree-skeleton-label",
|
|
99
|
+
"SidebarTreeSkeletonLabel": "alinea-SidebarTree-skeleton-label",
|
|
100
|
+
"SidebarTree-itemSkeleton-label": "alinea-SidebarTree-itemSkeleton-label",
|
|
101
|
+
"SidebarTreeItemSkeletonLabel": "alinea-SidebarTree-itemSkeleton-label"
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
// src/dashboard/app/SidebarTree.tsx
|
|
@@ -127,8 +127,8 @@ var SidebarTreeItem = memo(function SidebarTreeItem2({
|
|
|
127
127
|
selectedItem,
|
|
128
128
|
tree
|
|
129
129
|
}) {
|
|
130
|
-
const data =
|
|
131
|
-
const configuredIcon =
|
|
130
|
+
const data = useAtomValueRaw(tree.item(item.id));
|
|
131
|
+
const configuredIcon = useAtomValueRaw(typeAtoms(data.type)).icon;
|
|
132
132
|
const displayStatus = sidebarStatus(data, locale);
|
|
133
133
|
const selectedAncestor = selectedItem && data.parents.includes(selectedItem.id) ? selectedItem : void 0;
|
|
134
134
|
const selectedStatus = selectedAncestor ? sidebarStatus(selectedAncestor, locale) : void 0;
|
|
@@ -136,6 +136,7 @@ var SidebarTreeItem = memo(function SidebarTreeItem2({
|
|
|
136
136
|
const isArchived = rowStatus?.status === "archived";
|
|
137
137
|
const isUnpublished = rowStatus?.status === "unpublished";
|
|
138
138
|
const isUntranslated = displayStatus?.status === "untranslated";
|
|
139
|
+
const link = entryLink?.(data);
|
|
139
140
|
return /* @__PURE__ */ jsx(
|
|
140
141
|
TreeItem,
|
|
141
142
|
{
|
|
@@ -144,6 +145,7 @@ var SidebarTreeItem = memo(function SidebarTreeItem2({
|
|
|
144
145
|
title: data.title,
|
|
145
146
|
hasChildItems: data.hasChildren,
|
|
146
147
|
icon: configuredIcon ?? (data.hasChildren ? LucideFolder : LucideFile),
|
|
148
|
+
iconHref: link ? dashboardHref(link.href) : void 0,
|
|
147
149
|
className: styles.SidebarTree.item({
|
|
148
150
|
archived: isArchived,
|
|
149
151
|
parentSelected: selectedAncestor !== void 0,
|
|
@@ -162,13 +164,7 @@ var SidebarTreeItem = memo(function SidebarTreeItem2({
|
|
|
162
164
|
children: /* @__PURE__ */ jsx(Icon, { icon: displayStatus.icon })
|
|
163
165
|
}
|
|
164
166
|
) : void 0,
|
|
165
|
-
label:
|
|
166
|
-
SidebarTreeEntryLink,
|
|
167
|
-
{
|
|
168
|
-
href: entryLink(data).href,
|
|
169
|
-
title: data.title
|
|
170
|
-
}
|
|
171
|
-
) : data.title,
|
|
167
|
+
label: link ? /* @__PURE__ */ jsx(SidebarTreeEntryLink, { href: link.href, title: data.title }) : data.title,
|
|
172
168
|
children
|
|
173
169
|
}
|
|
174
170
|
);
|
|
@@ -176,15 +172,11 @@ var SidebarTreeItem = memo(function SidebarTreeItem2({
|
|
|
176
172
|
function documentPath() {
|
|
177
173
|
return typeof window === "undefined" ? "" : `${window.location.pathname}${window.location.search}`;
|
|
178
174
|
}
|
|
175
|
+
function dashboardHref(href) {
|
|
176
|
+
return `${documentPath()}#${href}`;
|
|
177
|
+
}
|
|
179
178
|
function SidebarTreeEntryLink({ href, title }) {
|
|
180
|
-
return /* @__PURE__ */ jsx(
|
|
181
|
-
"a",
|
|
182
|
-
{
|
|
183
|
-
className: styles.SidebarTree.entryLink(),
|
|
184
|
-
href: `${documentPath()}#${href}`,
|
|
185
|
-
children: title
|
|
186
|
-
}
|
|
187
|
-
);
|
|
179
|
+
return /* @__PURE__ */ jsx("a", { className: styles.SidebarTree.entryLink(), href: dashboardHref(href), children: title });
|
|
188
180
|
}
|
|
189
181
|
function equalStringSets(left, right) {
|
|
190
182
|
return left.size === right.size && Array.from(left).every((value) => right.has(value));
|
|
@@ -196,15 +188,15 @@ var SidebarTree = memo(function SidebarTree2({
|
|
|
196
188
|
}) {
|
|
197
189
|
const { locale } = page;
|
|
198
190
|
const tree = root.tree(locale);
|
|
199
|
-
const snapshot =
|
|
200
|
-
const selectedItem =
|
|
201
|
-
const label =
|
|
202
|
-
const icon =
|
|
203
|
-
const i18n =
|
|
191
|
+
const snapshot = useAtomValueRaw(tree.snapshot);
|
|
192
|
+
const selectedItem = useAtomValueRaw(tree.selectedItem);
|
|
193
|
+
const label = useAtomValueRaw(root.label);
|
|
194
|
+
const icon = useAtomValueRaw(root.icon);
|
|
195
|
+
const i18n = useAtomValueRaw(root.i18n);
|
|
204
196
|
const setRoute = useSetAtom(routeAtom);
|
|
205
197
|
const setExpandedKeys = useSetAtom(tree.expandedKeys);
|
|
206
198
|
const [collapsed, setCollapsed] = useAtom(tree.collapsedKeys);
|
|
207
|
-
const dragDisabled =
|
|
199
|
+
const dragDisabled = useAtomValueRaw(root.dragDisabled);
|
|
208
200
|
const getItems = useSetAtom(root.getItems);
|
|
209
201
|
const getDropOperation = useSetAtom(root.getDropOperation);
|
|
210
202
|
const drop = useSetAtom(root.onDrop);
|
|
@@ -336,13 +328,13 @@ var SidebarTreeExplorer = memo(function SidebarTreeExplorer2({
|
|
|
336
328
|
tree
|
|
337
329
|
}) {
|
|
338
330
|
const [locale, setLocale] = useAtom(selectedLocale);
|
|
339
|
-
const label =
|
|
340
|
-
const icon =
|
|
341
|
-
const i18n =
|
|
331
|
+
const label = useAtomValueRaw(root.label);
|
|
332
|
+
const icon = useAtomValueRaw(root.icon);
|
|
333
|
+
const i18n = useAtomValueRaw(root.i18n);
|
|
342
334
|
const setExpandedKeys = useSetAtom(tree.expandedKeys);
|
|
343
|
-
const snapshot =
|
|
344
|
-
const selectedItem =
|
|
345
|
-
const dragDisabled =
|
|
335
|
+
const snapshot = useAtomValueRaw(tree.snapshot);
|
|
336
|
+
const selectedItem = useAtomValueRaw(tree.selectedItem);
|
|
337
|
+
const dragDisabled = useAtomValueRaw(root.dragDisabled);
|
|
346
338
|
const getItems = useSetAtom(root.getItems);
|
|
347
339
|
const getDropOperation = useSetAtom(root.getDropOperation);
|
|
348
340
|
const drop = useSetAtom(root.onDrop);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { WorkspaceInternal } from 'alinea/core/Workspace';
|
|
2
2
|
import type { Page } from 'alinea/dashboard/atoms/nav';
|
|
3
3
|
import type { RootAtoms } from 'alinea/dashboard/atoms/root';
|
|
4
|
-
import { type ComponentType } from 'react';
|
|
4
|
+
import { type ComponentType, type ReactNode } from 'react';
|
|
5
5
|
interface WorkspaceMenuProps {
|
|
6
6
|
canManageMembers: boolean;
|
|
7
7
|
page: Page;
|
|
@@ -13,12 +13,19 @@ interface WorkspaceMenuProps {
|
|
|
13
13
|
interface WorkspaceAvatarProps {
|
|
14
14
|
color: string;
|
|
15
15
|
icon?: ComponentType;
|
|
16
|
-
size?: 'default' | 'small';
|
|
16
|
+
size?: 'default' | 'large' | 'small';
|
|
17
17
|
}
|
|
18
18
|
declare function WorkspaceAvatar({ color, icon, size }: WorkspaceAvatarProps): import("react").JSX.Element;
|
|
19
19
|
export { WorkspaceAvatar };
|
|
20
20
|
interface WorkspaceAvatarMenuProps {
|
|
21
21
|
page: Page;
|
|
22
|
+
root: RootAtoms;
|
|
23
|
+
}
|
|
24
|
+
export declare function WorkspaceAvatarMenu({ page, root }: WorkspaceAvatarMenuProps): import("react").JSX.Element;
|
|
25
|
+
interface GlobalSearchProps {
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
initialSearchScope?: 'everything' | 'workspace';
|
|
28
|
+
root: RootAtoms;
|
|
22
29
|
}
|
|
23
|
-
export declare function
|
|
30
|
+
export declare function GlobalSearch({ children, initialSearchScope, root }: GlobalSearchProps): import("react").JSX.Element;
|
|
24
31
|
export declare function WorkspaceMenu({ canManageMembers, page, root, workspace }: WorkspaceMenuProps): import("react").JSX.Element;
|