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,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
useAtomValueRaw,
|
|
3
|
+
useAtomValueRawSync,
|
|
3
4
|
useSetAtom
|
|
4
|
-
} from "../../chunks/chunk-
|
|
5
|
+
} from "../../chunks/chunk-D6UJHBJJ.js";
|
|
5
6
|
import {
|
|
6
7
|
atom
|
|
7
|
-
} from "../../chunks/chunk-
|
|
8
|
+
} from "../../chunks/chunk-CFNRVI3Y.js";
|
|
8
9
|
import {
|
|
9
10
|
styler
|
|
10
11
|
} from "../../chunks/chunk-I4OYYAX5.js";
|
|
@@ -25,23 +26,23 @@ import {
|
|
|
25
26
|
|
|
26
27
|
// src/dashboard/app/EntrySidebarPreview.module.css
|
|
27
28
|
var EntrySidebarPreview_default = {
|
|
28
|
-
"EntrySidebarPreview-
|
|
29
|
-
"
|
|
29
|
+
"EntrySidebarPreview-empty": "alinea-EntrySidebarPreview-empty",
|
|
30
|
+
"EntrySidebarPreviewEmpty": "alinea-EntrySidebarPreview-empty",
|
|
31
|
+
"EntrySidebarPreview-controls": "alinea-EntrySidebarPreview-controls",
|
|
32
|
+
"EntrySidebarPreviewControls": "alinea-EntrySidebarPreview-controls",
|
|
33
|
+
"EntrySidebarPreview-browser": "alinea-EntrySidebarPreview-browser",
|
|
34
|
+
"EntrySidebarPreviewBrowser": "alinea-EntrySidebarPreview-browser",
|
|
30
35
|
"EntrySidebarPreview-subheader": "alinea-EntrySidebarPreview-subheader",
|
|
31
36
|
"EntrySidebarPreviewSubheader": "alinea-EntrySidebarPreview-subheader",
|
|
37
|
+
"EntrySidebarPreview-loading": "alinea-EntrySidebarPreview-loading",
|
|
38
|
+
"EntrySidebarPreviewLoading": "alinea-EntrySidebarPreview-loading",
|
|
32
39
|
"EntrySidebarPreview-browserMessage": "alinea-EntrySidebarPreview-browserMessage",
|
|
33
40
|
"EntrySidebarPreviewBrowserMessage": "alinea-EntrySidebarPreview-browserMessage",
|
|
41
|
+
"EntrySidebarPreview": "alinea-EntrySidebarPreview",
|
|
34
42
|
"EntrySidebarPreview-iframe": "alinea-EntrySidebarPreview-iframe",
|
|
35
43
|
"EntrySidebarPreviewIframe": "alinea-EntrySidebarPreview-iframe",
|
|
36
|
-
"EntrySidebarPreview-
|
|
37
|
-
"
|
|
38
|
-
"EntrySidebarPreview-browser": "alinea-EntrySidebarPreview-browser",
|
|
39
|
-
"EntrySidebarPreviewBrowser": "alinea-EntrySidebarPreview-browser",
|
|
40
|
-
"EntrySidebarPreview-empty": "alinea-EntrySidebarPreview-empty",
|
|
41
|
-
"EntrySidebarPreviewEmpty": "alinea-EntrySidebarPreview-empty",
|
|
42
|
-
"EntrySidebarPreview": "alinea-EntrySidebarPreview",
|
|
43
|
-
"EntrySidebarPreview-loading": "alinea-EntrySidebarPreview-loading",
|
|
44
|
-
"EntrySidebarPreviewLoading": "alinea-EntrySidebarPreview-loading"
|
|
44
|
+
"EntrySidebarPreview-component": "alinea-EntrySidebarPreview-component",
|
|
45
|
+
"EntrySidebarPreviewComponent": "alinea-EntrySidebarPreview-component"
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
// src/dashboard/app/EntrySidebarPreview.tsx
|
|
@@ -52,7 +53,7 @@ function EntrySidebarPreview({
|
|
|
52
53
|
entry,
|
|
53
54
|
localeData
|
|
54
55
|
}) {
|
|
55
|
-
const preview =
|
|
56
|
+
const preview = useAtomValueRaw(entry.preview);
|
|
56
57
|
if (!preview)
|
|
57
58
|
return /* @__PURE__ */ jsx(EntrySidebarPreviewMessage, { title: "No preview", children: "This entry has no preview." });
|
|
58
59
|
if (preview === true)
|
|
@@ -63,7 +64,7 @@ function EntrySidebarComponentPreview({
|
|
|
63
64
|
localeData,
|
|
64
65
|
preview: Component
|
|
65
66
|
}) {
|
|
66
|
-
const previewEntry =
|
|
67
|
+
const previewEntry = useAtomValueRaw(localeData.previewEntry);
|
|
67
68
|
if (!previewEntry)
|
|
68
69
|
return /* @__PURE__ */ jsx(EntrySidebarPreviewMessage, { title: "Preview unavailable", children: "Preview is currently unavailable." });
|
|
69
70
|
return /* @__PURE__ */ jsx("div", { className: styles.EntrySidebarPreview(), children: /* @__PURE__ */ jsx("div", { className: styles.EntrySidebarPreview.component(), children: /* @__PURE__ */ jsx(Component, { entry: previewEntry }) }) });
|
|
@@ -134,12 +135,12 @@ function EntrySidebarBrowserPreviewHeader({
|
|
|
134
135
|
function EntrySidebarBrowserPreview({
|
|
135
136
|
localeData
|
|
136
137
|
}) {
|
|
137
|
-
const [previewUrlPending, previewUrl] =
|
|
138
|
+
const [previewUrlPending, previewUrl] = useAtomValueRawSync(
|
|
138
139
|
localeData.previewUrlState
|
|
139
140
|
);
|
|
140
141
|
const retryPreviewUrl = useSetAtom(localeData.retryPreviewUrl);
|
|
141
142
|
const payloadSignalAtom = localeData.previewPayloadSignal;
|
|
142
|
-
const payloadSignal =
|
|
143
|
+
const payloadSignal = useAtomValueRaw(
|
|
143
144
|
payloadSignalAtom ?? emptyPayloadSignalAtom
|
|
144
145
|
);
|
|
145
146
|
const updatePreviewPayload = useSetAtom(
|
|
@@ -149,6 +150,7 @@ function EntrySidebarBrowserPreview({
|
|
|
149
150
|
const iframe = useRef(null);
|
|
150
151
|
const previewPayload = useRef();
|
|
151
152
|
const hasPreviewListener = useRef(false);
|
|
153
|
+
const previewWindows = useRef(/* @__PURE__ */ new Set());
|
|
152
154
|
const [frameVersion, setFrameVersion] = useState(0);
|
|
153
155
|
const [loading, setLoading] = useState(true);
|
|
154
156
|
const targetOrigin = useMemo(() => {
|
|
@@ -162,24 +164,43 @@ function EntrySidebarBrowserPreview({
|
|
|
162
164
|
hasPreviewListener.current = false;
|
|
163
165
|
previewPayload.current = void 0;
|
|
164
166
|
}, [previewUrl]);
|
|
167
|
+
useEffect(() => {
|
|
168
|
+
const windows = previewWindows.current;
|
|
169
|
+
previewPayload.current = void 0;
|
|
170
|
+
function disconnect() {
|
|
171
|
+
if (targetOrigin)
|
|
172
|
+
for (const previewWindow of windows) {
|
|
173
|
+
if (!previewWindow.closed)
|
|
174
|
+
previewWindow.postMessage(
|
|
175
|
+
{ action: PreviewAction.Disconnect },
|
|
176
|
+
targetOrigin
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
windows.clear();
|
|
180
|
+
}
|
|
181
|
+
window.addEventListener("pagehide", disconnect);
|
|
182
|
+
return () => {
|
|
183
|
+
window.removeEventListener("pagehide", disconnect);
|
|
184
|
+
disconnect();
|
|
185
|
+
};
|
|
186
|
+
}, [localeData, previewUrl, targetOrigin]);
|
|
165
187
|
useEffect(() => {
|
|
166
188
|
if (!targetOrigin) return;
|
|
167
189
|
function handleMessage(event) {
|
|
168
190
|
if (event.origin !== targetOrigin) return;
|
|
169
|
-
|
|
191
|
+
const source = event.source;
|
|
192
|
+
const isFrame = source === iframe.current?.contentWindow;
|
|
193
|
+
if (!source || !isFrame && !previewWindows.current.has(source)) return;
|
|
170
194
|
if (!event.data || typeof event.data !== "object") return;
|
|
171
195
|
if (event.data.action === PreviewAction.Ping) {
|
|
172
|
-
hasPreviewListener.current = true;
|
|
173
|
-
|
|
174
|
-
{ action: PreviewAction.Pong },
|
|
175
|
-
targetOrigin
|
|
176
|
-
);
|
|
196
|
+
if (isFrame) hasPreviewListener.current = true;
|
|
197
|
+
source.postMessage({ action: PreviewAction.Pong }, targetOrigin);
|
|
177
198
|
if (previewPayload.current)
|
|
178
|
-
|
|
199
|
+
source.postMessage(
|
|
179
200
|
{ action: PreviewAction.Preview, payload: previewPayload.current },
|
|
180
201
|
targetOrigin
|
|
181
202
|
);
|
|
182
|
-
} else if (event.data.action === PreviewAction.Meta) {
|
|
203
|
+
} else if (isFrame && event.data.action === PreviewAction.Meta) {
|
|
183
204
|
setMetadata(event.data);
|
|
184
205
|
}
|
|
185
206
|
}
|
|
@@ -193,11 +214,14 @@ function EntrySidebarBrowserPreview({
|
|
|
193
214
|
void updatePreviewPayload().then((payload) => {
|
|
194
215
|
if (cancelled) return;
|
|
195
216
|
previewPayload.current = payload;
|
|
196
|
-
if (!payload || !targetOrigin
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
targetOrigin
|
|
200
|
-
)
|
|
217
|
+
if (!payload || !targetOrigin) return;
|
|
218
|
+
const message = { action: PreviewAction.Preview, payload };
|
|
219
|
+
if (hasPreviewListener.current)
|
|
220
|
+
iframe.current?.contentWindow?.postMessage(message, targetOrigin);
|
|
221
|
+
for (const previewWindow of previewWindows.current) {
|
|
222
|
+
if (previewWindow.closed) previewWindows.current.delete(previewWindow);
|
|
223
|
+
else previewWindow.postMessage(message, targetOrigin);
|
|
224
|
+
}
|
|
201
225
|
});
|
|
202
226
|
}, 250);
|
|
203
227
|
return () => {
|
|
@@ -205,8 +229,9 @@ function EntrySidebarBrowserPreview({
|
|
|
205
229
|
clearTimeout(timeout);
|
|
206
230
|
};
|
|
207
231
|
}, [
|
|
208
|
-
localeData
|
|
232
|
+
localeData,
|
|
209
233
|
payloadSignal,
|
|
234
|
+
previewUrl,
|
|
210
235
|
targetOrigin,
|
|
211
236
|
updatePreviewPayload
|
|
212
237
|
]);
|
|
@@ -225,8 +250,10 @@ function EntrySidebarBrowserPreview({
|
|
|
225
250
|
}
|
|
226
251
|
function openPreview() {
|
|
227
252
|
if (!previewUrl || typeof window === "undefined") return;
|
|
228
|
-
const href =
|
|
229
|
-
|
|
253
|
+
const href = new URL(previewUrl, location.href);
|
|
254
|
+
href.searchParams.set("full", "");
|
|
255
|
+
const previewWindow = window.open(href.href, "_blank");
|
|
256
|
+
if (previewWindow) previewWindows.current.add(previewWindow);
|
|
230
257
|
}
|
|
231
258
|
return /* @__PURE__ */ jsxs("div", { className: styles.EntrySidebarPreview(), children: [
|
|
232
259
|
/* @__PURE__ */ jsx(
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
interface EntrySidebarPreviewStoryProps {
|
|
2
|
+
previewUrl?: string;
|
|
3
|
+
entryId?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function EntrySidebarPreviewStory({ previewUrl, entryId }: EntrySidebarPreviewStoryProps): import("react").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -9,19 +9,19 @@ import { memo } from "react";
|
|
|
9
9
|
|
|
10
10
|
// src/dashboard/app/EntryTranslationBanner.module.css
|
|
11
11
|
var EntryTranslationBanner_default = {
|
|
12
|
-
"EntryTranslationBanner-actions": "alinea-EntryTranslationBanner-actions",
|
|
13
|
-
"EntryTranslationBannerActions": "alinea-EntryTranslationBanner-actions",
|
|
14
|
-
"EntryTranslationBanner": "alinea-EntryTranslationBanner",
|
|
15
12
|
"EntryTranslationBanner-label": "alinea-EntryTranslationBanner-label",
|
|
16
13
|
"EntryTranslationBannerLabel": "alinea-EntryTranslationBanner-label",
|
|
17
|
-
"EntryTranslationBanner
|
|
18
|
-
"
|
|
14
|
+
"EntryTranslationBanner": "alinea-EntryTranslationBanner",
|
|
15
|
+
"EntryTranslationBanner-message": "alinea-EntryTranslationBanner-message",
|
|
16
|
+
"EntryTranslationBannerMessage": "alinea-EntryTranslationBanner-message",
|
|
17
|
+
"EntryTranslationBanner-actions": "alinea-EntryTranslationBanner-actions",
|
|
18
|
+
"EntryTranslationBannerActions": "alinea-EntryTranslationBanner-actions",
|
|
19
19
|
"EntryTranslationBanner-body": "alinea-EntryTranslationBanner-body",
|
|
20
20
|
"EntryTranslationBannerBody": "alinea-EntryTranslationBanner-body",
|
|
21
|
+
"EntryTranslationBanner-select": "alinea-EntryTranslationBanner-select",
|
|
22
|
+
"EntryTranslationBannerSelect": "alinea-EntryTranslationBanner-select",
|
|
21
23
|
"EntryTranslationBanner-title": "alinea-EntryTranslationBanner-title",
|
|
22
|
-
"EntryTranslationBannerTitle": "alinea-EntryTranslationBanner-title"
|
|
23
|
-
"EntryTranslationBanner-message": "alinea-EntryTranslationBanner-message",
|
|
24
|
-
"EntryTranslationBannerMessage": "alinea-EntryTranslationBanner-message"
|
|
24
|
+
"EntryTranslationBannerTitle": "alinea-EntryTranslationBanner-title"
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
// src/dashboard/app/EntryTranslationBanner.tsx
|
|
@@ -14,6 +14,7 @@ export interface ExplorerHeaderEntry {
|
|
|
14
14
|
onBack(): void;
|
|
15
15
|
}
|
|
16
16
|
export interface ExplorerHeaderProps {
|
|
17
|
+
canBrowse?: boolean;
|
|
17
18
|
autoFocusSearch?: boolean;
|
|
18
19
|
controls?: ReactNode;
|
|
19
20
|
explorer: DashboardExplorer;
|
|
@@ -35,7 +36,7 @@ interface ExplorerSearchProps {
|
|
|
35
36
|
page: ExplorerReadyPage;
|
|
36
37
|
}
|
|
37
38
|
export declare function ExplorerSearch({ autoFocus, explorer, onEntryAction, page }: ExplorerSearchProps): import("react").JSX.Element;
|
|
38
|
-
export declare function ExplorerHeader({ autoFocusSearch, controls, explorer, headerEntry, navigate, page, titleControls }: ExplorerHeaderProps): import("react").JSX.Element;
|
|
39
|
+
export declare function ExplorerHeader({ canBrowse, autoFocusSearch, controls, explorer, headerEntry, navigate, page, titleControls }: ExplorerHeaderProps): import("react").JSX.Element;
|
|
39
40
|
export declare function ExplorerBody({ compactTable, explorer, onSelectionChange, page }: ExplorerBodyProps): import("react").JSX.Element;
|
|
40
41
|
export declare function Explorer({ controls, explorer, headerEntry, page: loadedPage, titleControls }: ExplorerProps): import("react").JSX.Element;
|
|
41
42
|
export {};
|
|
@@ -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
|
$b325d7bd7e74496a$export$6fb4a10d2c950550,
|
|
9
9
|
$f2ff30fde7b014be$export$2e1e1122cf0cba88
|
|
@@ -60,63 +60,63 @@ import { EditorBackButton } from "./EditorBackButton.js";
|
|
|
60
60
|
|
|
61
61
|
// src/dashboard/app/Explorer.module.css
|
|
62
62
|
var Explorer_default = {
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"ExplorerToolbar": "alinea-Explorer-toolbar",
|
|
63
|
+
"is-navigation": "alinea-is-navigation",
|
|
64
|
+
"isNavigation": "alinea-is-navigation",
|
|
65
|
+
"Explorer-toolbar-mediaActions": "alinea-Explorer-toolbar-mediaActions",
|
|
66
|
+
"ExplorerToolbarMediaActions": "alinea-Explorer-toolbar-mediaActions",
|
|
67
|
+
"ExplorerHeader-content": "alinea-ExplorerHeader-content",
|
|
68
|
+
"ExplorerHeaderContent": "alinea-ExplorerHeader-content",
|
|
70
69
|
"Explorer-locationBreadcrumbs": "alinea-Explorer-locationBreadcrumbs",
|
|
71
70
|
"ExplorerLocationBreadcrumbs": "alinea-Explorer-locationBreadcrumbs",
|
|
72
|
-
"Explorer-locationBreadcrumbs-item": "alinea-Explorer-locationBreadcrumbs-item",
|
|
73
|
-
"ExplorerLocationBreadcrumbsItem": "alinea-Explorer-locationBreadcrumbs-item",
|
|
74
|
-
"ExplorerHeader-title": "alinea-ExplorerHeader-title",
|
|
75
|
-
"ExplorerHeaderTitle": "alinea-ExplorerHeader-title",
|
|
76
|
-
"Explorer-locationBreadcrumbs-localeValue": "alinea-Explorer-locationBreadcrumbs-localeValue",
|
|
77
|
-
"ExplorerLocationBreadcrumbsLocaleValue": "alinea-Explorer-locationBreadcrumbs-localeValue",
|
|
78
71
|
"Explorer-locationBreadcrumbs-separator": "alinea-Explorer-locationBreadcrumbs-separator",
|
|
79
72
|
"ExplorerLocationBreadcrumbsSeparator": "alinea-Explorer-locationBreadcrumbs-separator",
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"ExplorerHeader-primary": "alinea-ExplorerHeader-primary",
|
|
83
|
-
"ExplorerHeaderPrimary": "alinea-ExplorerHeader-primary",
|
|
84
|
-
"ExplorerHeader-location": "alinea-ExplorerHeader-location",
|
|
85
|
-
"ExplorerHeaderLocation": "alinea-ExplorerHeader-location",
|
|
86
|
-
"is-navigation": "alinea-is-navigation",
|
|
87
|
-
"isNavigation": "alinea-is-navigation",
|
|
73
|
+
"Explorer-locationBreadcrumbs-root-locale": "alinea-Explorer-locationBreadcrumbs-root-locale",
|
|
74
|
+
"ExplorerLocationBreadcrumbsRootLocale": "alinea-Explorer-locationBreadcrumbs-root-locale",
|
|
88
75
|
"Explorer-toolbar-tools": "alinea-Explorer-toolbar-tools",
|
|
89
76
|
"ExplorerToolbarTools": "alinea-Explorer-toolbar-tools",
|
|
90
|
-
"Explorer-
|
|
91
|
-
"
|
|
92
|
-
"Explorer-breadcrumbs": "alinea-Explorer-breadcrumbs",
|
|
93
|
-
"ExplorerBreadcrumbs": "alinea-Explorer-breadcrumbs",
|
|
94
|
-
"Popover": "alinea-Popover",
|
|
95
|
-
"Popover-Label": "alinea-Popover-Label",
|
|
96
|
-
"PopoverLabel": "alinea-Popover-Label",
|
|
97
|
-
"Explorer-locationBreadcrumbs-parentAction": "alinea-Explorer-locationBreadcrumbs-parentAction",
|
|
98
|
-
"ExplorerLocationBreadcrumbsParentAction": "alinea-Explorer-locationBreadcrumbs-parentAction",
|
|
99
|
-
"Explorer-locationBreadcrumbs-parentValue": "alinea-Explorer-locationBreadcrumbs-parentValue",
|
|
100
|
-
"ExplorerLocationBreadcrumbsParentValue": "alinea-Explorer-locationBreadcrumbs-parentValue",
|
|
77
|
+
"Explorer-locationBreadcrumbs-root": "alinea-Explorer-locationBreadcrumbs-root",
|
|
78
|
+
"ExplorerLocationBreadcrumbsRoot": "alinea-Explorer-locationBreadcrumbs-root",
|
|
101
79
|
"Explorer-locationBreadcrumbs-value": "alinea-Explorer-locationBreadcrumbs-value",
|
|
102
80
|
"ExplorerLocationBreadcrumbsValue": "alinea-Explorer-locationBreadcrumbs-value",
|
|
81
|
+
"ExplorerHeader-main": "alinea-ExplorerHeader-main",
|
|
82
|
+
"ExplorerHeaderMain": "alinea-ExplorerHeader-main",
|
|
103
83
|
"Explorer-resultMode": "alinea-Explorer-resultMode",
|
|
104
84
|
"ExplorerResultMode": "alinea-Explorer-resultMode",
|
|
105
85
|
"Explorer-actions": "alinea-Explorer-actions",
|
|
106
86
|
"ExplorerActions": "alinea-Explorer-actions",
|
|
87
|
+
"Popover-Label": "alinea-Popover-Label",
|
|
88
|
+
"PopoverLabel": "alinea-Popover-Label",
|
|
89
|
+
"ExplorerHeader": "alinea-ExplorerHeader",
|
|
90
|
+
"ExplorerHeader-location": "alinea-ExplorerHeader-location",
|
|
91
|
+
"ExplorerHeaderLocation": "alinea-ExplorerHeader-location",
|
|
92
|
+
"Explorer-locationBreadcrumbs-localeValue": "alinea-Explorer-locationBreadcrumbs-localeValue",
|
|
93
|
+
"ExplorerLocationBreadcrumbsLocaleValue": "alinea-Explorer-locationBreadcrumbs-localeValue",
|
|
94
|
+
"Popover": "alinea-Popover",
|
|
95
|
+
"Explorer-searchSlot": "alinea-Explorer-searchSlot",
|
|
96
|
+
"ExplorerSearchSlot": "alinea-Explorer-searchSlot",
|
|
97
|
+
"Explorer-toolbar": "alinea-Explorer-toolbar",
|
|
98
|
+
"ExplorerToolbar": "alinea-Explorer-toolbar",
|
|
99
|
+
"Explorer-locationBreadcrumbs-parentValue": "alinea-Explorer-locationBreadcrumbs-parentValue",
|
|
100
|
+
"ExplorerLocationBreadcrumbsParentValue": "alinea-Explorer-locationBreadcrumbs-parentValue",
|
|
101
|
+
"Explorer-locationBreadcrumbs-item": "alinea-Explorer-locationBreadcrumbs-item",
|
|
102
|
+
"ExplorerLocationBreadcrumbsItem": "alinea-Explorer-locationBreadcrumbs-item",
|
|
103
|
+
"ExplorerHeader-primary": "alinea-ExplorerHeader-primary",
|
|
104
|
+
"ExplorerHeaderPrimary": "alinea-ExplorerHeader-primary",
|
|
105
|
+
"ExplorerHeader-title": "alinea-ExplorerHeader-title",
|
|
106
|
+
"ExplorerHeaderTitle": "alinea-ExplorerHeader-title",
|
|
107
|
+
"Sorting-button": "alinea-Sorting-button",
|
|
108
|
+
"SortingButton": "alinea-Sorting-button",
|
|
107
109
|
"Explorer-locationBreadcrumbs-current": "alinea-Explorer-locationBreadcrumbs-current",
|
|
108
110
|
"ExplorerLocationBreadcrumbsCurrent": "alinea-Explorer-locationBreadcrumbs-current",
|
|
109
|
-
"Explorer
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"ExplorerLocationBreadcrumbsRoot": "alinea-Explorer-locationBreadcrumbs-root",
|
|
113
|
-
"Explorer-locationBreadcrumbs-root-locale": "alinea-Explorer-locationBreadcrumbs-root-locale",
|
|
114
|
-
"ExplorerLocationBreadcrumbsRootLocale": "alinea-Explorer-locationBreadcrumbs-root-locale",
|
|
111
|
+
"Explorer": "alinea-Explorer",
|
|
112
|
+
"Explorer-breadcrumbs": "alinea-Explorer-breadcrumbs",
|
|
113
|
+
"ExplorerBreadcrumbs": "alinea-Explorer-breadcrumbs",
|
|
115
114
|
"Explorer-search": "alinea-Explorer-search",
|
|
116
115
|
"ExplorerSearch": "alinea-Explorer-search",
|
|
117
|
-
"Explorer": "alinea-Explorer",
|
|
118
|
-
"
|
|
119
|
-
"
|
|
116
|
+
"Explorer-searchScope": "alinea-Explorer-searchScope",
|
|
117
|
+
"ExplorerSearchScope": "alinea-Explorer-searchScope",
|
|
118
|
+
"Explorer-locationBreadcrumbs-parentAction": "alinea-Explorer-locationBreadcrumbs-parentAction",
|
|
119
|
+
"ExplorerLocationBreadcrumbsParentAction": "alinea-Explorer-locationBreadcrumbs-parentAction",
|
|
120
120
|
"Explorer-viewport": "alinea-Explorer-viewport",
|
|
121
121
|
"ExplorerViewport": "alinea-Explorer-viewport"
|
|
122
122
|
};
|
|
@@ -136,7 +136,7 @@ function ExplorerSearch({
|
|
|
136
136
|
}) {
|
|
137
137
|
const items = page.items;
|
|
138
138
|
const [selection, setSelection] = useAtom(explorer.selection);
|
|
139
|
-
const search =
|
|
139
|
+
const search = useAtomValueRaw(explorer.search);
|
|
140
140
|
const setSearch = useSetAtom(explorer.search);
|
|
141
141
|
const performAction = useSetAtom(explorer.onAction);
|
|
142
142
|
const [inputValue, setInputValue] = useState(search);
|
|
@@ -205,7 +205,7 @@ function ExplorerSearch({
|
|
|
205
205
|
autoFocus,
|
|
206
206
|
className: styles.Explorer.search(),
|
|
207
207
|
hasIcon: true,
|
|
208
|
-
isPending,
|
|
208
|
+
isPending: isPending || inputValue !== page.search,
|
|
209
209
|
placeholder: "Search...",
|
|
210
210
|
value: inputValue,
|
|
211
211
|
onChange: onSearchChange,
|
|
@@ -217,7 +217,7 @@ function ExplorerSearchScope({ explorer, page }) {
|
|
|
217
217
|
const searchScope = page.searchScope;
|
|
218
218
|
const setSearchScope = useSetAtom(explorer.searchScope);
|
|
219
219
|
const resultMode = page.resultMode;
|
|
220
|
-
const canSearchEverything =
|
|
220
|
+
const canSearchEverything = useAtomValueRaw(explorer.canSearchEverything);
|
|
221
221
|
const [, startTransition] = useTransition();
|
|
222
222
|
if (!explorer.allowAllWorkspaces) return null;
|
|
223
223
|
const isDisabled = !canSearchEverything || explorer.mode !== "search" && resultMode !== "matches";
|
|
@@ -234,13 +234,17 @@ function ExplorerSearchScope({ explorer, page }) {
|
|
|
234
234
|
}
|
|
235
235
|
);
|
|
236
236
|
}
|
|
237
|
-
function ExplorerResultMode({
|
|
237
|
+
function ExplorerResultMode({
|
|
238
|
+
canBrowse: navigationEnabled,
|
|
239
|
+
explorer,
|
|
240
|
+
page
|
|
241
|
+
}) {
|
|
238
242
|
const resultMode = page.resultMode;
|
|
239
243
|
const setResultMode = useSetAtom(explorer.resultMode);
|
|
240
|
-
const search =
|
|
244
|
+
const search = useAtomValueRaw(explorer.search);
|
|
241
245
|
const [, startTransition] = useTransition();
|
|
242
246
|
const canShowFiltered = explorer.pickChildren || explorer.hasCondition || Boolean(search.trim());
|
|
243
|
-
const canBrowse = !explorer.pickChildren && !search.trim();
|
|
247
|
+
const canBrowse = navigationEnabled && !explorer.pickChildren && !search.trim();
|
|
244
248
|
return /* @__PURE__ */ jsxs(
|
|
245
249
|
ToggleButtonGroup,
|
|
246
250
|
{
|
|
@@ -275,8 +279,8 @@ function ExplorerHeaderLoadedParentMain({
|
|
|
275
279
|
explorer,
|
|
276
280
|
titleControls
|
|
277
281
|
}) {
|
|
278
|
-
const label =
|
|
279
|
-
const parents =
|
|
282
|
+
const label = useAtomValueRaw(data.label);
|
|
283
|
+
const parents = useAtomValueRaw(data.parents);
|
|
280
284
|
const setLocation = useSetAtom(explorer.location);
|
|
281
285
|
const parent = parents.at(-1);
|
|
282
286
|
return /* @__PURE__ */ jsxs("div", { className: styles.ExplorerHeader.main(), children: [
|
|
@@ -302,7 +306,7 @@ function ExplorerHeaderMain({
|
|
|
302
306
|
page,
|
|
303
307
|
titleControls
|
|
304
308
|
}) {
|
|
305
|
-
const parent =
|
|
309
|
+
const parent = useAtomValueRaw(explorer.parent(page.location, page.locale));
|
|
306
310
|
if (headerEntry) {
|
|
307
311
|
return /* @__PURE__ */ jsxs("div", { className: styles.ExplorerHeader.main(), children: [
|
|
308
312
|
/* @__PURE__ */ jsx(
|
|
@@ -336,7 +340,7 @@ function ExplorerLocationParents({
|
|
|
336
340
|
lockNavigation,
|
|
337
341
|
parent
|
|
338
342
|
}) {
|
|
339
|
-
const { data } =
|
|
343
|
+
const { data } = useAtomValueRaw(parent.data);
|
|
340
344
|
if (!data) return null;
|
|
341
345
|
return /* @__PURE__ */ jsx(
|
|
342
346
|
ExplorerLoadedLocationParents,
|
|
@@ -354,7 +358,7 @@ function ExplorerLoadedLocationParents({
|
|
|
354
358
|
lockNavigation,
|
|
355
359
|
parent
|
|
356
360
|
}) {
|
|
357
|
-
const parents =
|
|
361
|
+
const parents = useAtomValueRaw(data.parents);
|
|
358
362
|
return [...parents, parent].map((entry, index, entries) => /* @__PURE__ */ jsx(
|
|
359
363
|
ExplorerLocationParent,
|
|
360
364
|
{
|
|
@@ -372,7 +376,7 @@ function ExplorerLocationParent({
|
|
|
372
376
|
explorer,
|
|
373
377
|
lockNavigation
|
|
374
378
|
}) {
|
|
375
|
-
const { data } =
|
|
379
|
+
const { data } = useAtomValueRaw(entry.data);
|
|
376
380
|
if (!data) return null;
|
|
377
381
|
return /* @__PURE__ */ jsx(
|
|
378
382
|
ExplorerLoadedLocationParent,
|
|
@@ -392,7 +396,7 @@ function ExplorerLoadedLocationParent({
|
|
|
392
396
|
explorer,
|
|
393
397
|
lockNavigation
|
|
394
398
|
}) {
|
|
395
|
-
const label =
|
|
399
|
+
const label = useAtomValueRaw(data.label);
|
|
396
400
|
const setLocation = useSetAtom(explorer.location);
|
|
397
401
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
398
402
|
/* @__PURE__ */ jsx(
|
|
@@ -425,13 +429,13 @@ function ExplorerLocationMenu({
|
|
|
425
429
|
lockNavigation = false,
|
|
426
430
|
page
|
|
427
431
|
}) {
|
|
428
|
-
const config =
|
|
432
|
+
const config = useAtomValueRaw(configAtom);
|
|
429
433
|
const location = page.location;
|
|
430
|
-
const policy =
|
|
434
|
+
const policy = useAtomValueRaw(policyAtom);
|
|
431
435
|
const selectedLocale = page.locale;
|
|
432
436
|
const setSelectedLocale = useSetAtom(explorer.selectedLocale);
|
|
433
437
|
const setLocation = useSetAtom(explorer.location);
|
|
434
|
-
const parent =
|
|
438
|
+
const parent = useAtomValueRaw(explorer.parent(location, selectedLocale));
|
|
435
439
|
const configuredLocations = explorer.limitLocations?.length ? explorer.limitLocations : Object.entries(config.workspaces).flatMap(
|
|
436
440
|
([workspace, value]) => Object.keys(getWorkspace(value).roots).map((root) => ({ workspace, root }))
|
|
437
441
|
);
|
|
@@ -573,7 +577,7 @@ function ExplorerHeaderParentMain({
|
|
|
573
577
|
parent,
|
|
574
578
|
titleControls
|
|
575
579
|
}) {
|
|
576
|
-
const { data } =
|
|
580
|
+
const { data } = useAtomValueRaw(parent.data);
|
|
577
581
|
if (!data) return null;
|
|
578
582
|
return /* @__PURE__ */ jsx(
|
|
579
583
|
ExplorerHeaderLoadedParentMain,
|
|
@@ -669,15 +673,15 @@ function ExplorerToolbar({ explorer, page }) {
|
|
|
669
673
|
const [, setView] = useAtom(explorer.view);
|
|
670
674
|
const [sort, setSort] = useAtom(explorer.sort);
|
|
671
675
|
const [selectedFilter, toggleFilter] = useAtom(explorer.filter);
|
|
672
|
-
const requestedLocation =
|
|
673
|
-
const selectedLocale =
|
|
676
|
+
const requestedLocation = useAtomValueRaw(explorer.location);
|
|
677
|
+
const selectedLocale = useAtomValueRaw(explorer.selectedLocale);
|
|
674
678
|
const locationIsPending = explorerPageIsPending(
|
|
675
679
|
page,
|
|
676
680
|
requestedLocation,
|
|
677
681
|
selectedLocale
|
|
678
682
|
);
|
|
679
|
-
const canUpload =
|
|
680
|
-
const uploads =
|
|
683
|
+
const canUpload = useAtomValueRaw(explorer.canUpload);
|
|
684
|
+
const uploads = useAtomValueRaw(explorer.uploadsInCurrentFolder);
|
|
681
685
|
const upload = useSetAtom(explorer.upload);
|
|
682
686
|
const uploadCount = uploads.length;
|
|
683
687
|
const uploadLabel = uploadCount === 1 ? "1 file uploading" : `${uploadCount} files uploading`;
|
|
@@ -709,6 +713,7 @@ function ExplorerToolbar({ explorer, page }) {
|
|
|
709
713
|
] });
|
|
710
714
|
}
|
|
711
715
|
function ExplorerHeader({
|
|
716
|
+
canBrowse = true,
|
|
712
717
|
autoFocusSearch,
|
|
713
718
|
controls,
|
|
714
719
|
explorer,
|
|
@@ -751,7 +756,14 @@ function ExplorerHeader({
|
|
|
751
756
|
className: styles.ExplorerHeader.location(),
|
|
752
757
|
role: "group",
|
|
753
758
|
children: [
|
|
754
|
-
/* @__PURE__ */ jsx(
|
|
759
|
+
/* @__PURE__ */ jsx(
|
|
760
|
+
ExplorerResultMode,
|
|
761
|
+
{
|
|
762
|
+
canBrowse,
|
|
763
|
+
explorer,
|
|
764
|
+
page
|
|
765
|
+
}
|
|
766
|
+
),
|
|
755
767
|
!page.searchesEverything && /* @__PURE__ */ jsx(
|
|
756
768
|
ExplorerLocationMenu,
|
|
757
769
|
{
|
|
@@ -788,7 +800,7 @@ function Explorer({
|
|
|
788
800
|
page: loadedPage,
|
|
789
801
|
titleControls
|
|
790
802
|
}) {
|
|
791
|
-
const resolvedPage =
|
|
803
|
+
const resolvedPage = useAtomValueRaw(explorer.page);
|
|
792
804
|
const page = resolvedPage ?? loadedPage;
|
|
793
805
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
794
806
|
/* @__PURE__ */ jsx(
|