alinea 2.0.0-preview.2 → 2.0.0-preview.3
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 +63 -63
- package/dist/adapter/next/previews.js +3 -1
- package/dist/adapter/next/previews.spec.d.ts +1 -0
- package/dist/bundled.d.ts +63 -17
- package/dist/chunks/{chunk-UVOEM4AH.js → chunk-HFBZMKIN.js} +1 -1
- package/dist/cli/Serve.js +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cloud/CloudRemote.js +1 -1
- package/dist/components/Breadcrumbs.js +2 -2
- package/dist/components/Calendar.js +5 -5
- package/dist/components/Checkbox.js +3 -3
- package/dist/components/ComboBox.js +12 -12
- package/dist/components/DateField.js +3 -3
- package/dist/components/DatePicker.js +5 -5
- package/dist/components/DateRangePicker.js +7 -7
- package/dist/components/Disclosure.js +8 -8
- package/dist/components/Label.js +6 -6
- package/dist/components/List.js +29 -29
- package/dist/components/Menu.js +4 -4
- package/dist/components/Modal.js +4 -4
- package/dist/components/MultipleSelect.js +24 -24
- package/dist/components/NumberField.js +5 -5
- package/dist/components/ProgressCircle.js +3 -3
- package/dist/components/RadioGroup.js +2 -2
- package/dist/components/SearchField.js +7 -7
- package/dist/components/Select.js +8 -8
- package/dist/components/Surface.js +3 -3
- package/dist/components/Table.js +8 -8
- package/dist/components/Tabs.js +4 -4
- package/dist/components/TagGroup.js +2 -2
- package/dist/components/TextField.js +4 -4
- package/dist/components/TimeField.js +3 -3
- package/dist/components/Toolbar.js +3 -3
- 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/Graph.d.ts +1 -1
- 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 +11 -1
- package/dist/dashboard/App.js +8 -2
- package/dist/dashboard/app/AccessDenied.d.ts +16 -1
- package/dist/dashboard/app/AccessDenied.js +20 -11
- package/dist/dashboard/app/ActivityStatus.js +15 -15
- package/dist/dashboard/app/AppShell.js +2 -2
- package/dist/dashboard/app/AuthView.js +8 -8
- package/dist/dashboard/app/CompactField.js +13 -13
- package/dist/dashboard/app/DashboardErrorBoundary.js +5 -5
- package/dist/dashboard/app/EntryHeader.js +7 -7
- package/dist/dashboard/app/EntryReferences.js +10 -10
- package/dist/dashboard/app/EntrySidebar.js +11 -11
- package/dist/dashboard/app/EntrySidebarPreview.js +52 -26
- package/dist/dashboard/app/EntrySidebarPreview.story.d.ts +6 -1
- package/dist/dashboard/app/EntryTranslationBanner.js +5 -5
- package/dist/dashboard/app/Explorer.d.ts +2 -1
- package/dist/dashboard/app/Explorer.js +56 -44
- package/dist/dashboard/app/ExplorerCards.js +42 -46
- package/dist/dashboard/app/ExplorerFileCard.js +18 -18
- package/dist/dashboard/app/ExplorerList.js +11 -11
- package/dist/dashboard/app/ExplorerModal.js +5 -5
- package/dist/dashboard/app/ExplorerTable.js +53 -53
- package/dist/dashboard/app/LinkPicker.js +34 -9
- package/dist/dashboard/app/LocaleMenu.js +5 -5
- package/dist/dashboard/app/SidebarLayout.js +3 -3
- package/dist/dashboard/app/SidebarTree.js +48 -56
- package/dist/dashboard/app/WorkspaceMenu.js +11 -11
- package/dist/dashboard/app/WorkspaceRoots.js +24 -24
- package/dist/dashboard/app/editor/FileEditor.js +26 -26
- package/dist/dashboard/app/editor/FilePreview.js +4 -4
- package/dist/dashboard/app/modals/CreateEntry.js +2 -2
- package/dist/dashboard/app/pages/EntryPage.js +17 -17
- package/dist/dashboard/app/pages/UsersPage.js +35 -35
- package/dist/dashboard/app/ui/DashboardModal.js +17 -17
- package/dist/dashboard/app/ui/Rail.js +2 -2
- package/dist/dashboard/app/ui/Sidebar.js +2 -2
- package/dist/field/check/CheckField.view.js +2 -2
- package/dist/field/code/CodeField.view.js +11 -11
- 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 +58 -41
- package/dist/field/list/ListField.view.js +14 -14
- package/dist/field/metadata/MetadataField.d.ts +2 -0
- package/dist/field/metadata/MetadataField.js +2 -1
- package/dist/field/metadata/MetadataField.view.js +19 -19
- package/dist/field/richtext/RichTextBlock.js +2 -2
- package/dist/field/richtext/RichTextExtensions.js +24 -24
- package/dist/field/richtext/RichTextField.view.js +4 -4
- package/dist/field/richtext/RichTextInsertMenu.js +3 -3
- package/dist/index.css +21 -0
- package/dist/preview/PreviewMessage.d.ts +3 -0
- package/dist/preview/PreviewMessage.js +1 -0
- package/dist/preview/RegisterPreview.js +29 -9
- package/dist/preview/widget.js +6 -12
- package/dist/query.d.ts +7 -7
- package/package.json +1 -1
|
@@ -17,10 +17,7 @@ function aliasesFromData(data) {
|
|
|
17
17
|
return hasAliases ? result : void 0;
|
|
18
18
|
}
|
|
19
19
|
function aliasUrl(value) {
|
|
20
|
-
|
|
21
|
-
if (url === void 0) return void 0;
|
|
22
|
-
const trimmed = url.trim();
|
|
23
|
-
return trimmed.length > 0 ? trimmed : void 0;
|
|
20
|
+
return isRecord(value) && typeof value.url === "string" ? value.url : void 0;
|
|
24
21
|
}
|
|
25
22
|
export {
|
|
26
23
|
aliasUrl,
|
|
@@ -536,13 +536,13 @@ function valueAtPath(value, path) {
|
|
|
536
536
|
return current;
|
|
537
537
|
}
|
|
538
538
|
function aliasChecker(alias) {
|
|
539
|
-
return (entry) => {
|
|
539
|
+
return filterChecker({ aliases: { includes: { url: alias } } }, (entry) => {
|
|
540
540
|
const aliases = aliasesFromData(entry.data) ?? [];
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
};
|
|
541
|
+
return aliases.flatMap((row) => {
|
|
542
|
+
const url = aliasUrl(row);
|
|
543
|
+
return url === void 0 ? [] : [{ url }];
|
|
544
|
+
});
|
|
545
|
+
});
|
|
546
546
|
}
|
|
547
547
|
function typeChecker(type) {
|
|
548
548
|
if (Array.isArray(type)) {
|
|
@@ -208,6 +208,7 @@ var EntryTransaction = class {
|
|
|
208
208
|
{ id, type, index: newIndex, path, seeded, data, title },
|
|
209
209
|
status
|
|
210
210
|
);
|
|
211
|
+
if (fromSeed && data.title === void 0) delete record.title;
|
|
211
212
|
const contents = new TextEncoder().encode(JSON.stringify(record, null, 2));
|
|
212
213
|
this.#tx.add(filePath, contents);
|
|
213
214
|
this.#messages.push(this.#reportOp("create", title));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StoredRow } from '../Infer.js';
|
|
1
|
+
import type { CreateInputRow, StoredRow } from '../Infer.js';
|
|
2
2
|
import type { ImagePreviewDetails } from '../media/CreatePreview.js';
|
|
3
3
|
import { Type } from '../Type.js';
|
|
4
4
|
import type { Mutation } from './Mutation.js';
|
|
@@ -17,7 +17,7 @@ export interface CreateQuery<Fields> {
|
|
|
17
17
|
parentId?: string | null;
|
|
18
18
|
locale?: string | null;
|
|
19
19
|
status?: 'draft' | 'published' | 'archived';
|
|
20
|
-
set: Partial<
|
|
20
|
+
set: Partial<CreateInputRow<Fields>>;
|
|
21
21
|
insertOrder?: 'first' | 'last';
|
|
22
22
|
overwrite?: boolean;
|
|
23
23
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "../../chunks/chunk-CQ52GEHY.js";
|
|
2
2
|
|
|
3
3
|
// src/core/db/Operation.ts
|
|
4
|
+
import { Field } from "../Field.js";
|
|
4
5
|
import { HttpError } from "../HttpError.js";
|
|
5
6
|
import { createId } from "../Id.js";
|
|
6
7
|
import { isImage } from "../media/IsImage.js";
|
|
@@ -9,6 +10,7 @@ import { assertUploadSize } from "../media/UploadLimits.js";
|
|
|
9
10
|
import { Schema } from "../Schema.js";
|
|
10
11
|
import { Type } from "../Type.js";
|
|
11
12
|
import { createFileHash } from "../util/ContentHash.js";
|
|
13
|
+
import { keys } from "../util/Objects.js";
|
|
12
14
|
import { basename, extname } from "../util/Paths.js";
|
|
13
15
|
import { slugify } from "../util/Slugs.js";
|
|
14
16
|
import { Workspace } from "../Workspace.js";
|
|
@@ -37,7 +39,7 @@ var CreateOp = class extends Operation {
|
|
|
37
39
|
locale: op.locale ?? null,
|
|
38
40
|
parentId: op.parentId ?? null,
|
|
39
41
|
type: typeName(config, op.type),
|
|
40
|
-
data: op.set
|
|
42
|
+
data: initializeSet(op.type, op.set),
|
|
41
43
|
insertOrder: op.insertOrder,
|
|
42
44
|
status: op.status,
|
|
43
45
|
overwrite: op.overwrite,
|
|
@@ -49,6 +51,14 @@ var CreateOp = class extends Operation {
|
|
|
49
51
|
this.id = op.id ?? createId();
|
|
50
52
|
}
|
|
51
53
|
};
|
|
54
|
+
function initializeSet(type, set) {
|
|
55
|
+
const result = { ...set };
|
|
56
|
+
for (const key of keys(result)) {
|
|
57
|
+
const field = Type.field(type, key);
|
|
58
|
+
if (field) result[key] = Field.withInitialValue(field, result[key]);
|
|
59
|
+
}
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
52
62
|
var DeleteOp = class extends Operation {
|
|
53
63
|
constructor(entryIds) {
|
|
54
64
|
super(() => {
|
package/dist/dashboard/App.js
CHANGED
|
@@ -22,9 +22,9 @@ import {
|
|
|
22
22
|
|
|
23
23
|
// src/dashboard/App.module.css
|
|
24
24
|
var App_default = {
|
|
25
|
+
"AppLoading": "alinea-AppLoading",
|
|
25
26
|
"AppLoading-progress-fade-in": "alinea-AppLoading-progress-fade-in",
|
|
26
27
|
"AppLoadingProgressFadeIn": "alinea-AppLoading-progress-fade-in",
|
|
27
|
-
"AppLoading": "alinea-AppLoading",
|
|
28
28
|
"AppLoading-progress": "alinea-AppLoading-progress",
|
|
29
29
|
"AppLoadingProgress": "alinea-AppLoading-progress"
|
|
30
30
|
};
|
|
@@ -74,7 +74,13 @@ var authenticatedAtom = atom(async (get) => {
|
|
|
74
74
|
title: dashboardTitle(workspaceData?.label ?? "Alinea", label)
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
|
-
if (page.type === "users"
|
|
77
|
+
if (page.type === "users") {
|
|
78
|
+
if (!canManageMembers) {
|
|
79
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
80
|
+
meta("No user management access"),
|
|
81
|
+
/* @__PURE__ */ jsx(AccessDenied, { canManageMembers: false, scope: "users" })
|
|
82
|
+
] });
|
|
83
|
+
}
|
|
78
84
|
const content2 = await usersPage(page, get);
|
|
79
85
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
80
86
|
meta("Users"),
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
+
declare const copy: {
|
|
2
|
+
root: {
|
|
3
|
+
title: string;
|
|
4
|
+
message: string;
|
|
5
|
+
};
|
|
6
|
+
users: {
|
|
7
|
+
title: string;
|
|
8
|
+
message: string;
|
|
9
|
+
};
|
|
10
|
+
workspace: {
|
|
11
|
+
title: string;
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
1
15
|
export interface AccessDeniedProps {
|
|
2
16
|
canManageMembers: boolean;
|
|
3
|
-
scope:
|
|
17
|
+
scope: keyof typeof copy;
|
|
4
18
|
}
|
|
5
19
|
export declare function AccessDenied({ canManageMembers, scope }: AccessDeniedProps): import("react").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -14,29 +14,38 @@ import { AppShell, AppShellContent, AppShellInner } from "./AppShell.js";
|
|
|
14
14
|
|
|
15
15
|
// src/dashboard/app/AccessDenied.module.css
|
|
16
16
|
var AccessDenied_default = {
|
|
17
|
-
"AccessDenied-message": "alinea-AccessDenied-message",
|
|
18
|
-
"AccessDeniedMessage": "alinea-AccessDenied-message",
|
|
19
|
-
"AccessDenied": "alinea-AccessDenied",
|
|
20
17
|
"AccessDenied-card": "alinea-AccessDenied-card",
|
|
21
18
|
"AccessDeniedCard": "alinea-AccessDenied-card",
|
|
22
19
|
"AccessDenied-title": "alinea-AccessDenied-title",
|
|
23
|
-
"AccessDeniedTitle": "alinea-AccessDenied-title"
|
|
20
|
+
"AccessDeniedTitle": "alinea-AccessDenied-title",
|
|
21
|
+
"AccessDenied": "alinea-AccessDenied",
|
|
22
|
+
"AccessDenied-message": "alinea-AccessDenied-message",
|
|
23
|
+
"AccessDeniedMessage": "alinea-AccessDenied-message"
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
// src/dashboard/app/AccessDenied.tsx
|
|
27
27
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
28
28
|
var styles = styler(AccessDenied_default);
|
|
29
|
+
var copy = {
|
|
30
|
+
root: {
|
|
31
|
+
title: "No root access",
|
|
32
|
+
message: "Your current roles do not grant permission to read any root."
|
|
33
|
+
},
|
|
34
|
+
users: {
|
|
35
|
+
title: "No user management access",
|
|
36
|
+
message: "Your current roles do not grant permission to manage users."
|
|
37
|
+
},
|
|
38
|
+
workspace: {
|
|
39
|
+
title: "No workspace access",
|
|
40
|
+
message: "Your current roles do not grant permission to read any workspace."
|
|
41
|
+
}
|
|
42
|
+
};
|
|
29
43
|
function AccessDenied({ canManageMembers, scope }) {
|
|
30
44
|
const setRoute = useSetAtom(routeAtom);
|
|
31
|
-
const title = scope
|
|
32
|
-
const target = scope === "workspace" ? "workspace" : "root";
|
|
45
|
+
const { title, message } = copy[scope];
|
|
33
46
|
return /* @__PURE__ */ jsx(AppShell, { children: /* @__PURE__ */ jsx(AppShellInner, { children: /* @__PURE__ */ jsx(AppShellContent, { children: /* @__PURE__ */ jsx("div", { className: styles.AccessDenied(), children: /* @__PURE__ */ jsxs(Surface, { className: styles.AccessDenied.card(), children: [
|
|
34
47
|
/* @__PURE__ */ jsx("h1", { className: styles.AccessDenied.title(), children: title }),
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
"Your current roles do not grant permission to read any ",
|
|
37
|
-
target,
|
|
38
|
-
"."
|
|
39
|
-
] }),
|
|
48
|
+
/* @__PURE__ */ jsx("p", { className: styles.AccessDenied.message(), children: message }),
|
|
40
49
|
canManageMembers && /* @__PURE__ */ jsx(
|
|
41
50
|
Button,
|
|
42
51
|
{
|
|
@@ -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-
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"ActivityStatus-popover-header": "alinea-ActivityStatus-popover-header",
|
|
50
|
-
"ActivityStatusPopoverHeader": "alinea-ActivityStatus-popover-header",
|
|
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",
|
|
51
49
|
"ActivityStatus-popover-surface": "alinea-ActivityStatus-popover-surface",
|
|
52
50
|
"ActivityStatusPopoverSurface": "alinea-ActivityStatus-popover-surface",
|
|
53
|
-
"ActivityStatus": "alinea-ActivityStatus",
|
|
54
|
-
"ActivityStatus-label": "alinea-ActivityStatus-label",
|
|
55
|
-
"ActivityStatusLabel": "alinea-ActivityStatus-label",
|
|
56
|
-
"ActivityStatus-popover": "alinea-ActivityStatus-popover",
|
|
57
|
-
"ActivityStatusPopover": "alinea-ActivityStatus-popover",
|
|
58
51
|
"is-syncing": "alinea-is-syncing",
|
|
59
52
|
"isSyncing": "alinea-is-syncing",
|
|
53
|
+
"ActivityStatus-popover-actions": "alinea-ActivityStatus-popover-actions",
|
|
54
|
+
"ActivityStatusPopoverActions": "alinea-ActivityStatus-popover-actions",
|
|
55
|
+
"ActivityStatus-popover-header": "alinea-ActivityStatus-popover-header",
|
|
56
|
+
"ActivityStatusPopoverHeader": "alinea-ActivityStatus-popover-header",
|
|
60
57
|
"ActivityStatus-popover-title": "alinea-ActivityStatus-popover-title",
|
|
61
58
|
"ActivityStatusPopoverTitle": "alinea-ActivityStatus-popover-title",
|
|
62
59
|
"ActivityStatus-popover-list": "alinea-ActivityStatus-popover-list",
|
|
63
60
|
"ActivityStatusPopoverList": "alinea-ActivityStatus-popover-list",
|
|
64
|
-
"ActivityStatus-
|
|
65
|
-
"
|
|
66
|
-
"ActivityStatus-
|
|
67
|
-
"
|
|
61
|
+
"ActivityStatus-popover": "alinea-ActivityStatus-popover",
|
|
62
|
+
"ActivityStatusPopover": "alinea-ActivityStatus-popover",
|
|
63
|
+
"ActivityStatus-label": "alinea-ActivityStatus-label",
|
|
64
|
+
"ActivityStatusLabel": "alinea-ActivityStatus-label",
|
|
65
|
+
"is-failed": "alinea-is-failed",
|
|
66
|
+
"isFailed": "alinea-is-failed",
|
|
67
|
+
"ActivityStatus": "alinea-ActivityStatus"
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
// src/dashboard/app/ActivityStatus.tsx
|
|
@@ -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
|
+
"AppShell": "alinea-AppShell",
|
|
10
|
+
"AppShellInner": "alinea-AppShellInner"
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
// src/dashboard/app/AppShell.tsx
|
|
@@ -18,21 +18,21 @@ import { IcRoundArrowForward, IcRoundPublish } from "../icons.js";
|
|
|
18
18
|
var AuthView_default = {
|
|
19
19
|
"AuthView-panel": "alinea-AuthView-panel",
|
|
20
20
|
"AuthViewPanel": "alinea-AuthView-panel",
|
|
21
|
-
"AuthView-
|
|
22
|
-
"
|
|
23
|
-
"AuthView-surface": "alinea-AuthView-surface",
|
|
24
|
-
"AuthViewSurface": "alinea-AuthView-surface",
|
|
21
|
+
"AuthView-text": "alinea-AuthView-text",
|
|
22
|
+
"AuthViewText": "alinea-AuthView-text",
|
|
25
23
|
"AuthView": "alinea-AuthView",
|
|
26
|
-
"AuthView-mark": "alinea-AuthView-mark",
|
|
27
|
-
"AuthViewMark": "alinea-AuthView-mark",
|
|
28
24
|
"AuthView-heading": "alinea-AuthView-heading",
|
|
29
25
|
"AuthViewHeading": "alinea-AuthView-heading",
|
|
30
|
-
"AuthView-text": "alinea-AuthView-text",
|
|
31
|
-
"AuthViewText": "alinea-AuthView-text",
|
|
32
26
|
"AuthView-link": "alinea-AuthView-link",
|
|
33
27
|
"AuthViewLink": "alinea-AuthView-link",
|
|
34
28
|
"AuthView-title": "alinea-AuthView-title",
|
|
35
29
|
"AuthViewTitle": "alinea-AuthView-title",
|
|
30
|
+
"AuthView-surface": "alinea-AuthView-surface",
|
|
31
|
+
"AuthViewSurface": "alinea-AuthView-surface",
|
|
32
|
+
"AuthView-loader": "alinea-AuthView-loader",
|
|
33
|
+
"AuthViewLoader": "alinea-AuthView-loader",
|
|
34
|
+
"AuthView-mark": "alinea-AuthView-mark",
|
|
35
|
+
"AuthViewMark": "alinea-AuthView-mark",
|
|
36
36
|
"AuthView-actionRow": "alinea-AuthView-actionRow",
|
|
37
37
|
"AuthViewActionRow": "alinea-AuthView-actionRow"
|
|
38
38
|
};
|
|
@@ -19,25 +19,25 @@ import { Badge } from "./Badge.js";
|
|
|
19
19
|
|
|
20
20
|
// src/dashboard/app/CompactField.module.css
|
|
21
21
|
var CompactField_default = {
|
|
22
|
-
"CompactField-record-field": "alinea-CompactField-record-field",
|
|
23
|
-
"CompactFieldRecordField": "alinea-CompactField-record-field",
|
|
24
|
-
"CompactField-list-count": "alinea-CompactField-list-count",
|
|
25
|
-
"CompactFieldListCount": "alinea-CompactField-list-count",
|
|
26
|
-
"CompactField-record": "alinea-CompactField-record",
|
|
27
|
-
"CompactFieldRecord": "alinea-CompactField-record",
|
|
28
22
|
"CompactField-json": "alinea-CompactField-json",
|
|
29
23
|
"CompactFieldJson": "alinea-CompactField-json",
|
|
30
|
-
"CompactField-
|
|
31
|
-
"
|
|
32
|
-
"CompactField-
|
|
33
|
-
"
|
|
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",
|
|
34
28
|
"CompactField-items": "alinea-CompactField-items",
|
|
35
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
|
+
"CompactField-record": "alinea-CompactField-record",
|
|
35
|
+
"CompactFieldRecord": "alinea-CompactField-record",
|
|
36
|
+
"CompactField-record-label": "alinea-CompactField-record-label",
|
|
37
|
+
"CompactFieldRecordLabel": "alinea-CompactField-record-label",
|
|
36
38
|
"CompactField": "alinea-CompactField",
|
|
37
39
|
"CompactField-record-value": "alinea-CompactField-record-value",
|
|
38
|
-
"CompactFieldRecordValue": "alinea-CompactField-record-value"
|
|
39
|
-
"CompactField-record-label": "alinea-CompactField-record-label",
|
|
40
|
-
"CompactFieldRecordLabel": "alinea-CompactField-record-label"
|
|
40
|
+
"CompactFieldRecordValue": "alinea-CompactField-record-value"
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
// src/dashboard/app/CompactField.tsx
|
|
@@ -65,15 +65,15 @@ import { IcRoundWarning } from "../icons.js";
|
|
|
65
65
|
|
|
66
66
|
// src/dashboard/app/DashboardErrorBoundary.module.css
|
|
67
67
|
var DashboardErrorBoundary_default = {
|
|
68
|
-
"DashboardErrorBoundary-
|
|
69
|
-
"
|
|
68
|
+
"DashboardErrorBoundary-message": "alinea-DashboardErrorBoundary-message",
|
|
69
|
+
"DashboardErrorBoundaryMessage": "alinea-DashboardErrorBoundary-message",
|
|
70
70
|
"DashboardErrorBoundary": "alinea-DashboardErrorBoundary",
|
|
71
71
|
"DashboardErrorBoundary-card": "alinea-DashboardErrorBoundary-card",
|
|
72
72
|
"DashboardErrorBoundaryCard": "alinea-DashboardErrorBoundary-card",
|
|
73
|
-
"DashboardErrorBoundary-message": "alinea-DashboardErrorBoundary-message",
|
|
74
|
-
"DashboardErrorBoundaryMessage": "alinea-DashboardErrorBoundary-message",
|
|
75
73
|
"DashboardErrorBoundary-heading": "alinea-DashboardErrorBoundary-heading",
|
|
76
|
-
"DashboardErrorBoundaryHeading": "alinea-DashboardErrorBoundary-heading"
|
|
74
|
+
"DashboardErrorBoundaryHeading": "alinea-DashboardErrorBoundary-heading",
|
|
75
|
+
"DashboardErrorBoundary-title": "alinea-DashboardErrorBoundary-title",
|
|
76
|
+
"DashboardErrorBoundaryTitle": "alinea-DashboardErrorBoundary-title"
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
// src/dashboard/app/DashboardErrorBoundary.tsx
|
|
@@ -41,21 +41,21 @@ import { EditorBackButton } from "./EditorBackButton.js";
|
|
|
41
41
|
|
|
42
42
|
// src/dashboard/app/EntryHeader.module.css
|
|
43
43
|
var EntryHeader_default = {
|
|
44
|
+
"EntryHeader-actions": "alinea-EntryHeader-actions",
|
|
45
|
+
"EntryHeaderActions": "alinea-EntryHeader-actions",
|
|
46
|
+
"EntryHeader": "alinea-EntryHeader",
|
|
44
47
|
"EntryHeader-title": "alinea-EntryHeader-title",
|
|
45
48
|
"EntryHeaderTitle": "alinea-EntryHeader-title",
|
|
46
|
-
"EntryHeader-status": "alinea-EntryHeader-status",
|
|
47
|
-
"EntryHeaderStatus": "alinea-EntryHeader-status",
|
|
48
49
|
"is-dirty": "alinea-is-dirty",
|
|
49
50
|
"isDirty": "alinea-is-dirty",
|
|
50
|
-
"EntryHeader-actions": "alinea-EntryHeader-actions",
|
|
51
|
-
"EntryHeaderActions": "alinea-EntryHeader-actions",
|
|
52
|
-
"EntryHeader": "alinea-EntryHeader",
|
|
53
|
-
"EntryHeader-main": "alinea-EntryHeader-main",
|
|
54
|
-
"EntryHeaderMain": "alinea-EntryHeader-main",
|
|
55
51
|
"EntryHeader-type": "alinea-EntryHeader-type",
|
|
56
52
|
"EntryHeaderType": "alinea-EntryHeader-type",
|
|
53
|
+
"EntryHeader-main": "alinea-EntryHeader-main",
|
|
54
|
+
"EntryHeaderMain": "alinea-EntryHeader-main",
|
|
57
55
|
"EntryHeader-sidebarToggle": "alinea-EntryHeader-sidebarToggle",
|
|
58
56
|
"EntryHeaderSidebarToggle": "alinea-EntryHeader-sidebarToggle",
|
|
57
|
+
"EntryHeader-status": "alinea-EntryHeader-status",
|
|
58
|
+
"EntryHeaderStatus": "alinea-EntryHeader-status",
|
|
59
59
|
"EntryHeader-content": "alinea-EntryHeader-content",
|
|
60
60
|
"EntryHeaderContent": "alinea-EntryHeader-content"
|
|
61
61
|
};
|
|
@@ -26,21 +26,21 @@ import { IcRoundImage, IcRoundInsertDriveFile, IcRoundLink } from "../icons.js";
|
|
|
26
26
|
|
|
27
27
|
// src/dashboard/app/EntryReferences.module.css
|
|
28
28
|
var EntryReferences_default = {
|
|
29
|
-
"EntryReferences-loadingText": "alinea-EntryReferences-loadingText",
|
|
30
|
-
"EntryReferencesLoadingText": "alinea-EntryReferences-loadingText",
|
|
31
|
-
"EntryReferences-loading": "alinea-EntryReferences-loading",
|
|
32
|
-
"EntryReferencesLoading": "alinea-EntryReferences-loading",
|
|
33
|
-
"EntryReferences": "alinea-EntryReferences",
|
|
34
|
-
"EntryReferences-pending": "alinea-EntryReferences-pending",
|
|
35
|
-
"EntryReferencesPending": "alinea-EntryReferences-pending",
|
|
36
29
|
"EntryReferences-trailing": "alinea-EntryReferences-trailing",
|
|
37
30
|
"EntryReferencesTrailing": "alinea-EntryReferences-trailing",
|
|
38
|
-
"EntryReferences-pendingText": "alinea-EntryReferences-pendingText",
|
|
39
|
-
"EntryReferencesPendingText": "alinea-EntryReferences-pendingText",
|
|
40
31
|
"EntryReferences-other": "alinea-EntryReferences-other",
|
|
41
32
|
"EntryReferencesOther": "alinea-EntryReferences-other",
|
|
33
|
+
"EntryReferences-loading": "alinea-EntryReferences-loading",
|
|
34
|
+
"EntryReferencesLoading": "alinea-EntryReferences-loading",
|
|
42
35
|
"EntryReferences-list": "alinea-EntryReferences-list",
|
|
43
|
-
"EntryReferencesList": "alinea-EntryReferences-list"
|
|
36
|
+
"EntryReferencesList": "alinea-EntryReferences-list",
|
|
37
|
+
"EntryReferences-pendingText": "alinea-EntryReferences-pendingText",
|
|
38
|
+
"EntryReferencesPendingText": "alinea-EntryReferences-pendingText",
|
|
39
|
+
"EntryReferences-pending": "alinea-EntryReferences-pending",
|
|
40
|
+
"EntryReferencesPending": "alinea-EntryReferences-pending",
|
|
41
|
+
"EntryReferences": "alinea-EntryReferences",
|
|
42
|
+
"EntryReferences-loadingText": "alinea-EntryReferences-loadingText",
|
|
43
|
+
"EntryReferencesLoadingText": "alinea-EntryReferences-loadingText"
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
// src/dashboard/app/EntryReferences.tsx
|
|
@@ -47,28 +47,28 @@ import { EntryReferences } from "./EntryReferences.js";
|
|
|
47
47
|
|
|
48
48
|
// src/dashboard/app/EntrySidebar.module.css
|
|
49
49
|
var EntrySidebar_default = {
|
|
50
|
-
"EntrySidebar-
|
|
51
|
-
"
|
|
50
|
+
"EntrySidebar-history": "alinea-EntrySidebar-history",
|
|
51
|
+
"EntrySidebarHistory": "alinea-EntrySidebar-history",
|
|
52
52
|
"EntrySidebar-disclosure": "alinea-EntrySidebar-disclosure",
|
|
53
53
|
"EntrySidebarDisclosure": "alinea-EntrySidebar-disclosure",
|
|
54
54
|
"EntrySidebar-disclosurePanel": "alinea-EntrySidebar-disclosurePanel",
|
|
55
55
|
"EntrySidebarDisclosurePanel": "alinea-EntrySidebar-disclosurePanel",
|
|
56
|
+
"EntrySidebar-previewPanel": "alinea-EntrySidebar-previewPanel",
|
|
57
|
+
"EntrySidebarPreviewPanel": "alinea-EntrySidebar-previewPanel",
|
|
58
|
+
"EntrySidebar-sectionTitle": "alinea-EntrySidebar-sectionTitle",
|
|
59
|
+
"EntrySidebarSectionTitle": "alinea-EntrySidebar-sectionTitle",
|
|
60
|
+
"EntrySidebar-section": "alinea-EntrySidebar-section",
|
|
61
|
+
"EntrySidebarSection": "alinea-EntrySidebar-section",
|
|
56
62
|
"EntrySidebar-historyPanel": "alinea-EntrySidebar-historyPanel",
|
|
57
63
|
"EntrySidebarHistoryPanel": "alinea-EntrySidebar-historyPanel",
|
|
58
64
|
"EntrySidebar-header": "alinea-EntrySidebar-header",
|
|
59
65
|
"EntrySidebarHeader": "alinea-EntrySidebar-header",
|
|
60
|
-
"EntrySidebar-sectionTitle": "alinea-EntrySidebar-sectionTitle",
|
|
61
|
-
"EntrySidebarSectionTitle": "alinea-EntrySidebar-sectionTitle",
|
|
62
|
-
"EntrySidebar-history": "alinea-EntrySidebar-history",
|
|
63
|
-
"EntrySidebarHistory": "alinea-EntrySidebar-history",
|
|
64
|
-
"EntrySidebar-body": "alinea-EntrySidebar-body",
|
|
65
|
-
"EntrySidebarBody": "alinea-EntrySidebar-body",
|
|
66
66
|
"EntrySidebar-referencesPanel": "alinea-EntrySidebar-referencesPanel",
|
|
67
67
|
"EntrySidebarReferencesPanel": "alinea-EntrySidebar-referencesPanel",
|
|
68
|
+
"EntrySidebar-body": "alinea-EntrySidebar-body",
|
|
69
|
+
"EntrySidebarBody": "alinea-EntrySidebar-body",
|
|
68
70
|
"EntrySidebar-tabs": "alinea-EntrySidebar-tabs",
|
|
69
|
-
"EntrySidebarTabs": "alinea-EntrySidebar-tabs"
|
|
70
|
-
"EntrySidebar-previewPanel": "alinea-EntrySidebar-previewPanel",
|
|
71
|
-
"EntrySidebarPreviewPanel": "alinea-EntrySidebar-previewPanel"
|
|
71
|
+
"EntrySidebarTabs": "alinea-EntrySidebar-tabs"
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
// src/dashboard/app/EntrySidebar.tsx
|
|
@@ -25,23 +25,23 @@ import {
|
|
|
25
25
|
|
|
26
26
|
// src/dashboard/app/EntrySidebarPreview.module.css
|
|
27
27
|
var EntrySidebarPreview_default = {
|
|
28
|
-
"EntrySidebarPreview
|
|
29
|
-
"EntrySidebarPreviewComponent": "alinea-EntrySidebarPreview-component",
|
|
30
|
-
"EntrySidebarPreview-subheader": "alinea-EntrySidebarPreview-subheader",
|
|
31
|
-
"EntrySidebarPreviewSubheader": "alinea-EntrySidebarPreview-subheader",
|
|
28
|
+
"EntrySidebarPreview": "alinea-EntrySidebarPreview",
|
|
32
29
|
"EntrySidebarPreview-browserMessage": "alinea-EntrySidebarPreview-browserMessage",
|
|
33
30
|
"EntrySidebarPreviewBrowserMessage": "alinea-EntrySidebarPreview-browserMessage",
|
|
31
|
+
"EntrySidebarPreview-loading": "alinea-EntrySidebarPreview-loading",
|
|
32
|
+
"EntrySidebarPreviewLoading": "alinea-EntrySidebarPreview-loading",
|
|
33
|
+
"EntrySidebarPreview-component": "alinea-EntrySidebarPreview-component",
|
|
34
|
+
"EntrySidebarPreviewComponent": "alinea-EntrySidebarPreview-component",
|
|
35
|
+
"EntrySidebarPreview-empty": "alinea-EntrySidebarPreview-empty",
|
|
36
|
+
"EntrySidebarPreviewEmpty": "alinea-EntrySidebarPreview-empty",
|
|
34
37
|
"EntrySidebarPreview-iframe": "alinea-EntrySidebarPreview-iframe",
|
|
35
38
|
"EntrySidebarPreviewIframe": "alinea-EntrySidebarPreview-iframe",
|
|
39
|
+
"EntrySidebarPreview-subheader": "alinea-EntrySidebarPreview-subheader",
|
|
40
|
+
"EntrySidebarPreviewSubheader": "alinea-EntrySidebarPreview-subheader",
|
|
36
41
|
"EntrySidebarPreview-controls": "alinea-EntrySidebarPreview-controls",
|
|
37
42
|
"EntrySidebarPreviewControls": "alinea-EntrySidebarPreview-controls",
|
|
38
43
|
"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
|
+
"EntrySidebarPreviewBrowser": "alinea-EntrySidebarPreview-browser"
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
// src/dashboard/app/EntrySidebarPreview.tsx
|
|
@@ -149,6 +149,7 @@ function EntrySidebarBrowserPreview({
|
|
|
149
149
|
const iframe = useRef(null);
|
|
150
150
|
const previewPayload = useRef();
|
|
151
151
|
const hasPreviewListener = useRef(false);
|
|
152
|
+
const previewWindows = useRef(/* @__PURE__ */ new Set());
|
|
152
153
|
const [frameVersion, setFrameVersion] = useState(0);
|
|
153
154
|
const [loading, setLoading] = useState(true);
|
|
154
155
|
const targetOrigin = useMemo(() => {
|
|
@@ -162,24 +163,43 @@ function EntrySidebarBrowserPreview({
|
|
|
162
163
|
hasPreviewListener.current = false;
|
|
163
164
|
previewPayload.current = void 0;
|
|
164
165
|
}, [previewUrl]);
|
|
166
|
+
useEffect(() => {
|
|
167
|
+
const windows = previewWindows.current;
|
|
168
|
+
previewPayload.current = void 0;
|
|
169
|
+
function disconnect() {
|
|
170
|
+
if (targetOrigin)
|
|
171
|
+
for (const previewWindow of windows) {
|
|
172
|
+
if (!previewWindow.closed)
|
|
173
|
+
previewWindow.postMessage(
|
|
174
|
+
{ action: PreviewAction.Disconnect },
|
|
175
|
+
targetOrigin
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
windows.clear();
|
|
179
|
+
}
|
|
180
|
+
window.addEventListener("pagehide", disconnect);
|
|
181
|
+
return () => {
|
|
182
|
+
window.removeEventListener("pagehide", disconnect);
|
|
183
|
+
disconnect();
|
|
184
|
+
};
|
|
185
|
+
}, [localeData, previewUrl, targetOrigin]);
|
|
165
186
|
useEffect(() => {
|
|
166
187
|
if (!targetOrigin) return;
|
|
167
188
|
function handleMessage(event) {
|
|
168
189
|
if (event.origin !== targetOrigin) return;
|
|
169
|
-
|
|
190
|
+
const source = event.source;
|
|
191
|
+
const isFrame = source === iframe.current?.contentWindow;
|
|
192
|
+
if (!source || !isFrame && !previewWindows.current.has(source)) return;
|
|
170
193
|
if (!event.data || typeof event.data !== "object") return;
|
|
171
194
|
if (event.data.action === PreviewAction.Ping) {
|
|
172
|
-
hasPreviewListener.current = true;
|
|
173
|
-
|
|
174
|
-
{ action: PreviewAction.Pong },
|
|
175
|
-
targetOrigin
|
|
176
|
-
);
|
|
195
|
+
if (isFrame) hasPreviewListener.current = true;
|
|
196
|
+
source.postMessage({ action: PreviewAction.Pong }, targetOrigin);
|
|
177
197
|
if (previewPayload.current)
|
|
178
|
-
|
|
198
|
+
source.postMessage(
|
|
179
199
|
{ action: PreviewAction.Preview, payload: previewPayload.current },
|
|
180
200
|
targetOrigin
|
|
181
201
|
);
|
|
182
|
-
} else if (event.data.action === PreviewAction.Meta) {
|
|
202
|
+
} else if (isFrame && event.data.action === PreviewAction.Meta) {
|
|
183
203
|
setMetadata(event.data);
|
|
184
204
|
}
|
|
185
205
|
}
|
|
@@ -193,11 +213,14 @@ function EntrySidebarBrowserPreview({
|
|
|
193
213
|
void updatePreviewPayload().then((payload) => {
|
|
194
214
|
if (cancelled) return;
|
|
195
215
|
previewPayload.current = payload;
|
|
196
|
-
if (!payload || !targetOrigin
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
targetOrigin
|
|
200
|
-
)
|
|
216
|
+
if (!payload || !targetOrigin) return;
|
|
217
|
+
const message = { action: PreviewAction.Preview, payload };
|
|
218
|
+
if (hasPreviewListener.current)
|
|
219
|
+
iframe.current?.contentWindow?.postMessage(message, targetOrigin);
|
|
220
|
+
for (const previewWindow of previewWindows.current) {
|
|
221
|
+
if (previewWindow.closed) previewWindows.current.delete(previewWindow);
|
|
222
|
+
else previewWindow.postMessage(message, targetOrigin);
|
|
223
|
+
}
|
|
201
224
|
});
|
|
202
225
|
}, 250);
|
|
203
226
|
return () => {
|
|
@@ -205,8 +228,9 @@ function EntrySidebarBrowserPreview({
|
|
|
205
228
|
clearTimeout(timeout);
|
|
206
229
|
};
|
|
207
230
|
}, [
|
|
208
|
-
localeData
|
|
231
|
+
localeData,
|
|
209
232
|
payloadSignal,
|
|
233
|
+
previewUrl,
|
|
210
234
|
targetOrigin,
|
|
211
235
|
updatePreviewPayload
|
|
212
236
|
]);
|
|
@@ -225,8 +249,10 @@ function EntrySidebarBrowserPreview({
|
|
|
225
249
|
}
|
|
226
250
|
function openPreview() {
|
|
227
251
|
if (!previewUrl || typeof window === "undefined") return;
|
|
228
|
-
const href =
|
|
229
|
-
|
|
252
|
+
const href = new URL(previewUrl, location.href);
|
|
253
|
+
href.searchParams.set("full", "");
|
|
254
|
+
const previewWindow = window.open(href.href, "_blank");
|
|
255
|
+
if (previewWindow) previewWindows.current.add(previewWindow);
|
|
230
256
|
}
|
|
231
257
|
return /* @__PURE__ */ jsxs("div", { className: styles.EntrySidebarPreview(), children: [
|
|
232
258
|
/* @__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,6 +9,10 @@ import { memo } from "react";
|
|
|
9
9
|
|
|
10
10
|
// src/dashboard/app/EntryTranslationBanner.module.css
|
|
11
11
|
var EntryTranslationBanner_default = {
|
|
12
|
+
"EntryTranslationBanner-body": "alinea-EntryTranslationBanner-body",
|
|
13
|
+
"EntryTranslationBannerBody": "alinea-EntryTranslationBanner-body",
|
|
14
|
+
"EntryTranslationBanner-message": "alinea-EntryTranslationBanner-message",
|
|
15
|
+
"EntryTranslationBannerMessage": "alinea-EntryTranslationBanner-message",
|
|
12
16
|
"EntryTranslationBanner-actions": "alinea-EntryTranslationBanner-actions",
|
|
13
17
|
"EntryTranslationBannerActions": "alinea-EntryTranslationBanner-actions",
|
|
14
18
|
"EntryTranslationBanner": "alinea-EntryTranslationBanner",
|
|
@@ -16,12 +20,8 @@ var EntryTranslationBanner_default = {
|
|
|
16
20
|
"EntryTranslationBannerLabel": "alinea-EntryTranslationBanner-label",
|
|
17
21
|
"EntryTranslationBanner-select": "alinea-EntryTranslationBanner-select",
|
|
18
22
|
"EntryTranslationBannerSelect": "alinea-EntryTranslationBanner-select",
|
|
19
|
-
"EntryTranslationBanner-body": "alinea-EntryTranslationBanner-body",
|
|
20
|
-
"EntryTranslationBannerBody": "alinea-EntryTranslationBanner-body",
|
|
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
|