alinea 2.0.0-preview.1 → 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 +34 -7
- package/dist/adapter/next/DevRemote.d.ts +3 -0
- package/dist/adapter/next/DevRemote.js +37 -0
- package/dist/adapter/next/ForwardCredentials.d.ts +1 -0
- package/dist/adapter/next/ForwardCredentials.js +17 -0
- package/dist/adapter/next/cms.js +86 -38
- package/dist/adapter/next/context.d.ts +1 -1
- package/dist/adapter/next/context.js +11 -3
- package/dist/adapter/next/handler.d.ts +2 -0
- package/dist/adapter/next/handler.js +23 -16
- package/dist/adapter/next/previews.js +3 -1
- package/dist/adapter/next/previews.spec.d.ts +1 -0
- package/dist/adapter/next/with-alinea.js +18 -16
- package/dist/backend/Handler.d.ts +14 -13
- package/dist/backend/Handler.js +53 -22
- package/dist/backend/resolver/ParsePreview.d.ts +8 -4
- package/dist/backend/resolver/ParsePreview.js +40 -43
- package/dist/bundled.d.ts +318 -77
- package/dist/chunks/{chunk-LUBOGJCG.js → chunk-6V4TAD2N.js} +1 -1
- package/dist/chunks/{chunk-TL7ZW6BX.js → chunk-A3XXZBOQ.js} +2535 -2999
- package/dist/chunks/chunk-AC5ATYI3.js +1434 -0
- package/dist/chunks/{chunk-FRYHNUEK.js → chunk-HFBZMKIN.js} +6 -3
- package/dist/chunks/{chunk-7ORQ7BYK.js → chunk-KMLLLZ6X.js} +202 -269
- package/dist/chunks/{chunk-IWN3T3FL.js → chunk-O7XWTMCB.js} +1 -1
- package/dist/chunks/{chunk-53DZYORR.js → chunk-PAYSVIYI.js} +76 -176
- package/dist/chunks/{chunk-YK3OSMDM.js → chunk-S4AU6SRS.js} +188 -158
- package/dist/chunks/{chunk-I7X64JTZ.js → chunk-VXZM6V4P.js} +4 -4
- package/dist/cli/Generate.js +3 -13
- package/dist/cli/Serve.js +7 -3
- package/dist/cli/bin.js +8 -5
- package/dist/cli/generate/CopyStaticFiles.js +2 -3
- package/dist/cli/generate/DevDB.d.ts +1 -1
- package/dist/cli/generate/DevDB.js +3 -5
- package/dist/cli/serve/CreateLocalServer.d.ts +1 -1
- package/dist/cli/serve/CreateLocalServer.js +3 -2
- package/dist/cli/serve/DevServer.d.ts +3 -2
- package/dist/cli/serve/DevServer.js +60 -3
- package/dist/cli/serve/ServeContext.d.ts +1 -0
- package/dist/cli/serve/StartServer.d.ts +1 -0
- package/dist/cli/serve/StartServer.js +6 -1
- package/dist/cli/util/EnsureLibs.js +2 -2
- package/dist/cli/util/EnsureNode.js +2 -2
- package/dist/cloud/CloudRemote.js +1 -1
- package/dist/components/Breadcrumbs.js +6 -6
- package/dist/components/Button.js +6 -6
- package/dist/components/Calendar.js +13 -13
- package/dist/components/Checkbox.js +8 -8
- package/dist/components/CheckboxGroup.js +6 -6
- package/dist/components/ColorSwatch.js +6 -6
- package/dist/components/ColorSwatchPicker.js +6 -6
- package/dist/components/ComboBox.js +17 -17
- package/dist/components/DateField.js +7 -7
- package/dist/components/DatePicker.js +9 -9
- package/dist/components/DateRangePicker.js +14 -14
- package/dist/components/Dialog.js +6 -6
- package/dist/components/Disclosure.js +13 -13
- package/dist/components/DropZone.js +6 -6
- package/dist/components/Label.js +14 -14
- package/dist/components/Link.js +6 -6
- package/dist/components/List.js +34 -34
- package/dist/components/Menu.js +9 -9
- package/dist/components/Modal.js +9 -9
- package/dist/components/MultipleSelect.js +28 -28
- package/dist/components/NumberField.d.ts +2 -1
- package/dist/components/NumberField.js +22 -12
- package/dist/components/Popover.js +6 -6
- package/dist/components/ProgressCircle.js +9 -9
- package/dist/components/RadioGroup.js +6 -6
- package/dist/components/SearchField.js +14 -14
- package/dist/components/Select.js +16 -16
- package/dist/components/Surface.js +2 -2
- package/dist/components/Switch.js +8 -8
- package/dist/components/Table.js +14 -14
- package/dist/components/Tabs.js +9 -9
- package/dist/components/TagGroup.js +6 -6
- package/dist/components/TextField.js +10 -10
- package/dist/components/TimeField.js +8 -8
- package/dist/components/Toggle.js +8 -8
- package/dist/components/Toolbar.js +8 -8
- package/dist/components/Tooltip.js +9 -9
- package/dist/components/Tree.d.ts +4 -2
- package/dist/components/Tree.js +27 -13
- package/dist/core/Client.js +3 -2
- package/dist/core/Config.d.ts +4 -0
- package/dist/core/Config.js +6 -0
- package/dist/core/Connection.d.ts +2 -2
- package/dist/core/Connection.js +7 -0
- package/dist/core/Graph.d.ts +4 -5
- package/dist/core/Infer.d.ts +8 -1
- package/dist/core/ListRow.d.ts +2 -0
- package/dist/core/OrderBy.d.ts +7 -3
- package/dist/core/TextDoc.d.ts +11 -0
- package/dist/core/Trace.d.ts +8 -0
- package/dist/core/Trace.js +32 -0
- package/dist/core/db/CommitRequest.d.ts +0 -3
- package/dist/core/db/CommitRequest.js +0 -9
- package/dist/core/db/EntryAliases.js +1 -4
- package/dist/core/db/EntryDB.js +1 -1
- package/dist/core/db/EntryIndex.d.ts +10 -0
- package/dist/core/db/EntryIndex.js +117 -9
- package/dist/core/db/EntryResolver.js +110 -35
- package/dist/core/db/EntryTransaction.d.ts +1 -2
- package/dist/core/db/EntryTransaction.js +26 -13
- package/dist/core/db/LocalDB.d.ts +2 -3
- package/dist/core/db/LocalDB.js +24 -19
- package/dist/core/db/Operation.d.ts +2 -2
- package/dist/core/db/Operation.js +11 -1
- package/dist/core/field/RichTextField.d.ts +30 -3
- package/dist/core/field/RichTextField.js +125 -41
- package/dist/core/media/MediaAltField.d.ts +1 -0
- package/dist/core/media/MediaAltField.js +9 -1
- package/dist/core/source/OverlaySource.d.ts +12 -0
- package/dist/core/source/OverlaySource.js +50 -0
- package/dist/core/source/Source.d.ts +1 -1
- package/dist/core/source/Source.js +3 -3
- package/dist/dashboard/App.css +158 -0
- package/dist/dashboard/App.js +10 -4
- 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/AuthView.js +11 -11
- package/dist/dashboard/app/Badge.js +2 -2
- package/dist/dashboard/app/CompactField.js +12 -12
- package/dist/dashboard/app/DashboardErrorBoundary.js +4 -4
- package/dist/dashboard/app/DashboardLayout.js +22 -19
- package/dist/dashboard/app/EntryHeader.js +10 -10
- package/dist/dashboard/app/EntryReferences.js +10 -10
- package/dist/dashboard/app/EntrySidebar.d.ts +1 -1
- package/dist/dashboard/app/EntrySidebar.js +16 -15
- package/dist/dashboard/app/EntrySidebarPreview.d.ts +1 -1
- package/dist/dashboard/app/EntrySidebarPreview.js +60 -29
- package/dist/dashboard/app/EntrySidebarPreview.story.d.ts +6 -1
- package/dist/dashboard/app/EntryTranslationBanner.js +7 -7
- package/dist/dashboard/app/Explorer.d.ts +2 -1
- package/dist/dashboard/app/Explorer.js +63 -51
- package/dist/dashboard/app/ExplorerCards.js +51 -55
- package/dist/dashboard/app/ExplorerFileCard.js +20 -20
- package/dist/dashboard/app/ExplorerList.js +14 -14
- package/dist/dashboard/app/ExplorerModal.js +1 -1
- package/dist/dashboard/app/ExplorerTable.js +59 -59
- package/dist/dashboard/app/ExternalLinkPicker.js +15 -4
- package/dist/dashboard/app/LinkPicker.js +40 -15
- package/dist/dashboard/app/LocaleMenu.js +8 -8
- package/dist/dashboard/app/SidebarLayout.d.ts +8 -0
- package/dist/dashboard/app/SidebarLayout.js +1169 -0
- package/dist/dashboard/app/SidebarTree.js +56 -64
- package/dist/dashboard/app/WorkspaceMenu.js +14 -14
- package/dist/dashboard/app/WorkspaceRoots.js +24 -24
- package/dist/dashboard/app/editor/FileEditor.js +29 -30
- package/dist/dashboard/app/editor/FilePreview.js +6 -6
- package/dist/dashboard/app/editor/MediaAltField.view.d.ts +1 -1
- package/dist/dashboard/app/editor/MediaAltField.view.js +6 -9
- package/dist/dashboard/app/modals/CreateEntry.js +5 -5
- package/dist/dashboard/app/pages/EntryPage.js +49 -25
- package/dist/dashboard/app/pages/UsersPage.js +35 -35
- package/dist/dashboard/app/ui/DashboardModal.js +23 -23
- package/dist/dashboard/app/ui/Rail.js +3 -3
- package/dist/dashboard/app/ui/Sidebar.js +2 -2
- package/dist/dashboard/atoms/auth.js +2 -0
- package/dist/dashboard/atoms/dashboard.d.ts +9 -0
- package/dist/dashboard/atoms/dashboard.js +17 -0
- package/dist/dashboard/atoms/editor.d.ts +7 -1
- package/dist/dashboard/atoms/editor.js +4 -1
- package/dist/dashboard/atoms/entry.d.ts +3 -1
- package/dist/dashboard/atoms/entry.js +55 -15
- package/dist/dashboard/atoms/explorer.js +3 -8
- package/dist/dashboard/atoms/preview.d.ts +3 -0
- package/dist/dashboard/atoms/preview.js +18 -1
- package/dist/dashboard/hooks.d.ts +4 -2
- package/dist/dashboard/hooks.js +9 -5
- package/dist/dashboard/icons.d.ts +1 -0
- package/dist/dashboard/icons.js +10 -0
- package/dist/field/code/CodeField.view.js +13 -13
- package/dist/field/date/DateField.view.js +12 -2
- package/dist/field/link/EntryLink.d.ts +1 -1
- package/dist/field/link/EntryLink.js +1 -0
- package/dist/field/link/Link.js +3 -2
- package/dist/field/link/LinkField.d.ts +5 -0
- package/dist/field/link/LinkField.view.js +115 -87
- package/dist/field/list/ListField.view.js +22 -33
- package/dist/field/metadata/MetadataField.d.ts +2 -0
- package/dist/field/metadata/MetadataField.js +2 -1
- package/dist/field/metadata/MetadataField.view.js +18 -18
- package/dist/field/number/NumberField.d.ts +2 -0
- package/dist/field/number/NumberField.view.js +4 -2
- package/dist/field/richtext/PickTextLink.d.ts +7 -0
- package/dist/field/richtext/PickTextLink.js +104 -2
- package/dist/field/richtext/ReferenceLink.d.ts +4 -1
- package/dist/field/richtext/ReferenceLink.js +18 -4
- package/dist/field/richtext/RichTextBlock.js +2 -2
- package/dist/field/richtext/RichTextDocument.d.ts +7 -2
- package/dist/field/richtext/RichTextDocument.js +34 -5
- package/dist/field/richtext/RichTextExtensions.d.ts +3 -1
- package/dist/field/richtext/RichTextExtensions.js +2701 -7464
- package/dist/field/richtext/RichTextField.d.ts +4 -0
- package/dist/field/richtext/RichTextField.story.d.ts +4 -0
- package/dist/field/richtext/RichTextField.view.js +43 -20
- package/dist/field/richtext/RichTextInsertMenu.js +279 -493
- package/dist/field/richtext/RichTextToolbar.d.ts +5 -2
- package/dist/field/richtext/RichTextToolbar.js +38 -3
- package/dist/field/richtext/Toolbar.d.ts +19 -1
- package/dist/field/richtext/Toolbar.js +18 -13
- package/dist/field/richtext/extensions/Anchor.js +1 -1
- package/dist/field/richtext/extensions/Link.js +1 -1
- package/dist/field/richtext/extensions/Small.js +1 -1
- package/dist/field/select/SelectField.view.js +8 -6
- package/dist/index.css +240 -14
- package/dist/next.cjs +18 -16
- package/dist/next.d.ts +2 -1
- package/dist/next.edge.d.ts +2 -1
- 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/dist/ui/RichText.d.ts +1 -0
- package/dist/ui/RichText.js +29 -2
- package/package.json +6 -3
- package/dist/chunks/{chunk-JFROOUG6.js → chunk-NIVGVRDS.js} +17 -17
package/dist/next.cjs
CHANGED
|
@@ -33,12 +33,13 @@ function createCMS() {
|
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
function withAlinea(config = {}) {
|
|
36
|
-
const
|
|
37
|
-
if (!
|
|
36
|
+
const settings = resolveSettings(config);
|
|
37
|
+
if (!settings) {
|
|
38
38
|
console.warn(
|
|
39
|
-
"Alinea dashboard settings
|
|
39
|
+
"Alinea dashboard settings were not provided; dashboard routing is disabled. Run Next.js through the Alinea CLI."
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
|
+
const adminPath = settings?.adminPath;
|
|
42
43
|
let nextVersion = 15;
|
|
43
44
|
try {
|
|
44
45
|
const require2 = (0, import_node_module.createRequire)((0, import_node_path.resolve)("./index.js"));
|
|
@@ -62,6 +63,10 @@ function withAlinea(config = {}) {
|
|
|
62
63
|
};
|
|
63
64
|
const redirects = adminPath ? createRedirects(config, adminPath) : config.redirects;
|
|
64
65
|
const rewrites = adminPath ? createRewrites(config, adminPath) : config.rewrites;
|
|
66
|
+
const env = settings ? {
|
|
67
|
+
...config.env,
|
|
68
|
+
ALINEA_ADMIN_PATH: settings.adminPath
|
|
69
|
+
} : config.env;
|
|
65
70
|
if (nextVersion < 15)
|
|
66
71
|
return {
|
|
67
72
|
...config,
|
|
@@ -74,7 +79,8 @@ function withAlinea(config = {}) {
|
|
|
74
79
|
},
|
|
75
80
|
images,
|
|
76
81
|
redirects,
|
|
77
|
-
rewrites
|
|
82
|
+
rewrites,
|
|
83
|
+
env
|
|
78
84
|
};
|
|
79
85
|
return {
|
|
80
86
|
...config,
|
|
@@ -84,7 +90,8 @@ function withAlinea(config = {}) {
|
|
|
84
90
|
],
|
|
85
91
|
images,
|
|
86
92
|
redirects,
|
|
87
|
-
rewrites
|
|
93
|
+
rewrites,
|
|
94
|
+
env
|
|
88
95
|
};
|
|
89
96
|
}
|
|
90
97
|
function createRedirects(config, adminPath) {
|
|
@@ -147,17 +154,12 @@ function createRewrites(config, adminPath) {
|
|
|
147
154
|
};
|
|
148
155
|
};
|
|
149
156
|
}
|
|
150
|
-
function
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
);
|
|
157
|
-
if (typeof settings.adminPath === "string" && settings.adminPath)
|
|
158
|
-
return normalizeBasePath(settings.adminPath);
|
|
159
|
-
} catch {
|
|
160
|
-
}
|
|
157
|
+
function resolveSettings(config) {
|
|
158
|
+
const adminPath = config.env?.ALINEA_ADMIN_PATH ?? process.env.ALINEA_ADMIN_PATH;
|
|
159
|
+
if (!adminPath) return;
|
|
160
|
+
return {
|
|
161
|
+
adminPath: normalizeBasePath(adminPath)
|
|
162
|
+
};
|
|
161
163
|
}
|
|
162
164
|
function normalizeBasePath(value) {
|
|
163
165
|
return value.startsWith("/") ? value : `/${value}`;
|
package/dist/next.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { createCMS } from 'alinea/adapter/next/cms';
|
|
2
|
-
export { createHandler } from 'alinea/adapter/next/handler';
|
|
2
|
+
export { createHandler, type NextHandlerOptions } from 'alinea/adapter/next/handler';
|
|
3
|
+
export type { AfterCommitContext, BeforeCommitContext } from 'alinea/backend/Handler';
|
|
3
4
|
export { withAlinea } from 'alinea/adapter/next/with-alinea';
|
package/dist/next.edge.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { createCMS } from 'alinea/adapter/next/cms';
|
|
2
|
-
export { createHandler } from 'alinea/adapter/next/handler';
|
|
2
|
+
export { createHandler, type NextHandlerOptions } from 'alinea/adapter/next/handler';
|
|
3
|
+
export type { AfterCommitContext, BeforeCommitContext } from 'alinea/backend/Handler';
|
|
@@ -2,6 +2,7 @@ import type { PreviewMetadata, PreviewPayload } from 'alinea/core/Preview';
|
|
|
2
2
|
export declare enum PreviewAction {
|
|
3
3
|
Ping = "[alinea-ping]",
|
|
4
4
|
Pong = "[alinea-pong]",
|
|
5
|
+
Disconnect = "[alinea-disconnect]",
|
|
5
6
|
Reload = "[alinea-reload]",
|
|
6
7
|
Refetch = "[alinea-refetch]",
|
|
7
8
|
Previous = "[alinea-previous]",
|
|
@@ -13,6 +14,8 @@ export type PreviewMessage = {
|
|
|
13
14
|
action: PreviewAction.Ping;
|
|
14
15
|
} | {
|
|
15
16
|
action: PreviewAction.Pong;
|
|
17
|
+
} | {
|
|
18
|
+
action: PreviewAction.Disconnect;
|
|
16
19
|
} | {
|
|
17
20
|
action: PreviewAction.Reload;
|
|
18
21
|
} | {
|
|
@@ -4,6 +4,7 @@ import "../chunks/chunk-CQ52GEHY.js";
|
|
|
4
4
|
var PreviewAction = /* @__PURE__ */ ((PreviewAction2) => {
|
|
5
5
|
PreviewAction2["Ping"] = "[alinea-ping]";
|
|
6
6
|
PreviewAction2["Pong"] = "[alinea-pong]";
|
|
7
|
+
PreviewAction2["Disconnect"] = "[alinea-disconnect]";
|
|
7
8
|
PreviewAction2["Reload"] = "[alinea-reload]";
|
|
8
9
|
PreviewAction2["Refetch"] = "[alinea-refetch]";
|
|
9
10
|
PreviewAction2["Previous"] = "[alinea-previous]";
|
|
@@ -4,20 +4,37 @@ import "../chunks/chunk-CQ52GEHY.js";
|
|
|
4
4
|
import { PreviewAction } from "alinea/preview/PreviewMessage";
|
|
5
5
|
function registerPreview(api) {
|
|
6
6
|
if (typeof window === "undefined") return;
|
|
7
|
+
const host = window.parent !== window ? window.parent : window.opener;
|
|
8
|
+
if (!host) return;
|
|
9
|
+
let hostOrigin;
|
|
7
10
|
let observer = null;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
11
|
+
const checkHost = window.setInterval(() => {
|
|
12
|
+
if (host.closed) disconnect();
|
|
13
|
+
}, 1e3);
|
|
14
|
+
addEventListener("message", handleMessage);
|
|
15
|
+
host.postMessage({ action: PreviewAction.Ping }, "*");
|
|
16
|
+
console.info("[Alinea preview listener attached]");
|
|
13
17
|
return () => {
|
|
18
|
+
clearInterval(checkHost);
|
|
14
19
|
if (observer) observer.disconnect();
|
|
15
20
|
removeEventListener("message", handleMessage);
|
|
16
21
|
};
|
|
22
|
+
function disconnect() {
|
|
23
|
+
clearInterval(checkHost);
|
|
24
|
+
observer?.disconnect();
|
|
25
|
+
observer = null;
|
|
26
|
+
api.setIsPreviewing(false);
|
|
27
|
+
removeEventListener("message", handleMessage);
|
|
28
|
+
}
|
|
17
29
|
function handleMessage(event) {
|
|
30
|
+
if (event.source !== host) return;
|
|
31
|
+
if (hostOrigin && event.origin !== hostOrigin) return;
|
|
18
32
|
if (!event.data || typeof event.data !== "object") return;
|
|
19
33
|
const message = event.data;
|
|
20
34
|
switch (message.action) {
|
|
35
|
+
case PreviewAction.Disconnect:
|
|
36
|
+
disconnect();
|
|
37
|
+
return;
|
|
21
38
|
case PreviewAction.Preview:
|
|
22
39
|
console.info("[Alinea preview received]");
|
|
23
40
|
api.preview(message);
|
|
@@ -32,10 +49,12 @@ function registerPreview(api) {
|
|
|
32
49
|
console.info("[Alinea preview next received]");
|
|
33
50
|
return history.forward();
|
|
34
51
|
case PreviewAction.Pong:
|
|
52
|
+
hostOrigin = event.origin;
|
|
35
53
|
console.info("[Alinea preview pong received]");
|
|
36
54
|
api.setIsPreviewing(true);
|
|
37
55
|
try {
|
|
38
56
|
fetchAndSendMetadata();
|
|
57
|
+
observer?.disconnect();
|
|
39
58
|
observer = new MutationObserver(fetchAndSendMetadata);
|
|
40
59
|
observer.observe(document.head, { childList: true });
|
|
41
60
|
console.info("[Alinea meta data sent to parent]");
|
|
@@ -44,10 +63,11 @@ function registerPreview(api) {
|
|
|
44
63
|
}
|
|
45
64
|
}
|
|
46
65
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
66
|
+
function fetchAndSendMetadata() {
|
|
67
|
+
if (!host || !hostOrigin) return;
|
|
68
|
+
const meta = fetchMetadataFromDocument();
|
|
69
|
+
host.postMessage({ action: PreviewAction.Meta, ...meta }, hostOrigin);
|
|
70
|
+
}
|
|
51
71
|
}
|
|
52
72
|
function fetchMetadataFromDocument() {
|
|
53
73
|
return {
|
package/dist/preview/widget.js
CHANGED
|
@@ -3,7 +3,7 @@ import "../chunks/chunk-CQ52GEHY.js";
|
|
|
3
3
|
// src/preview/widget.ts
|
|
4
4
|
function registerPreviewWidget() {
|
|
5
5
|
if (customElements.get("alinea-preview")) return;
|
|
6
|
-
const observedAttributes = ["
|
|
6
|
+
const observedAttributes = ["adminurl", "editurl", "livepreview"];
|
|
7
7
|
const template = `
|
|
8
8
|
<div class="previews">
|
|
9
9
|
<div class="inner">
|
|
@@ -142,15 +142,15 @@ function registerPreviewWidget() {
|
|
|
142
142
|
disconnectedCallback() {
|
|
143
143
|
this.#disconnect();
|
|
144
144
|
}
|
|
145
|
-
|
|
145
|
+
attributeChangedCallback(name, _oldValue, value) {
|
|
146
146
|
switch (name) {
|
|
147
|
-
case "
|
|
147
|
+
case "adminurl":
|
|
148
148
|
if (this.#adminButton) this.#adminButton.href = value ?? "";
|
|
149
149
|
return;
|
|
150
|
-
case "
|
|
150
|
+
case "editurl":
|
|
151
151
|
if (this.#editButton) this.#editButton.href = value ?? "";
|
|
152
152
|
return;
|
|
153
|
-
case "
|
|
153
|
+
case "livepreview":
|
|
154
154
|
this.#previews?.classList.toggle("is-loading", value === "loading");
|
|
155
155
|
this.#previews?.classList.toggle(
|
|
156
156
|
"is-connected",
|
|
@@ -160,9 +160,6 @@ function registerPreviewWidget() {
|
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
164
|
-
this.setAttribute(name, newValue);
|
|
165
|
-
}
|
|
166
163
|
connectedCallback() {
|
|
167
164
|
const shadow = this.attachShadow({ mode: "open" });
|
|
168
165
|
const style = document.createElement("style");
|
|
@@ -177,10 +174,7 @@ function registerPreviewWidget() {
|
|
|
177
174
|
this.#adminButton = previews.querySelector("#btn-admin");
|
|
178
175
|
this.#editButton = previews.querySelector("#btn-edit");
|
|
179
176
|
for (const attr of AlineaPreview.observedAttributes)
|
|
180
|
-
this.
|
|
181
|
-
this.attributeChangedCallback = (name, oldValue, newValue) => {
|
|
182
|
-
this.setAttribute(name, newValue);
|
|
183
|
-
};
|
|
177
|
+
this.attributeChangedCallback(attr, null, this.getAttribute(attr));
|
|
184
178
|
let xPosition = 0.5;
|
|
185
179
|
previews.addEventListener("mousedown", startDrag);
|
|
186
180
|
function startDrag(event) {
|
package/dist/query.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare function children<Selection extends SelectionGuard = undefined, T
|
|
|
24
24
|
parentId?: import("./core/Filter").Condition<string | null>;
|
|
25
25
|
path?: import("./core/Filter").Condition<string>;
|
|
26
26
|
url?: import("./core/Filter").Condition<string>;
|
|
27
|
-
alias?: string
|
|
27
|
+
alias?: import("./core/Filter").Condition<string>;
|
|
28
28
|
createdAt?: import("./core/Filter").Condition<number | null>;
|
|
29
29
|
updatedAt?: import("./core/Filter").Condition<number | null>;
|
|
30
30
|
workspace?: import("./core/Filter").Condition<string> | import("./types").Workspace;
|
|
@@ -59,7 +59,7 @@ export declare function parents<Selection extends SelectionGuard = undefined, Ty
|
|
|
59
59
|
parentId?: import("./core/Filter").Condition<string | null>;
|
|
60
60
|
path?: import("./core/Filter").Condition<string>;
|
|
61
61
|
url?: import("./core/Filter").Condition<string>;
|
|
62
|
-
alias?: string
|
|
62
|
+
alias?: import("./core/Filter").Condition<string>;
|
|
63
63
|
createdAt?: import("./core/Filter").Condition<number | null>;
|
|
64
64
|
updatedAt?: import("./core/Filter").Condition<number | null>;
|
|
65
65
|
workspace?: import("./core/Filter").Condition<string> | import("./types").Workspace;
|
|
@@ -94,7 +94,7 @@ export declare function translations<Selection extends SelectionGuard = undefine
|
|
|
94
94
|
parentId?: import("./core/Filter").Condition<string | null>;
|
|
95
95
|
path?: import("./core/Filter").Condition<string>;
|
|
96
96
|
url?: import("./core/Filter").Condition<string>;
|
|
97
|
-
alias?: string
|
|
97
|
+
alias?: import("./core/Filter").Condition<string>;
|
|
98
98
|
createdAt?: import("./core/Filter").Condition<number | null>;
|
|
99
99
|
updatedAt?: import("./core/Filter").Condition<number | null>;
|
|
100
100
|
workspace?: import("./core/Filter").Condition<string> | import("./types").Workspace;
|
|
@@ -129,7 +129,7 @@ export declare function siblings<Selection extends SelectionGuard = undefined, T
|
|
|
129
129
|
parentId?: import("./core/Filter").Condition<string | null>;
|
|
130
130
|
path?: import("./core/Filter").Condition<string>;
|
|
131
131
|
url?: import("./core/Filter").Condition<string>;
|
|
132
|
-
alias?: string
|
|
132
|
+
alias?: import("./core/Filter").Condition<string>;
|
|
133
133
|
createdAt?: import("./core/Filter").Condition<number | null>;
|
|
134
134
|
updatedAt?: import("./core/Filter").Condition<number | null>;
|
|
135
135
|
workspace?: import("./core/Filter").Condition<string> | import("./types").Workspace;
|
|
@@ -162,7 +162,7 @@ export declare function parent<Selection extends SelectionGuard = undefined, Typ
|
|
|
162
162
|
parentId?: import("./core/Filter").Condition<string | null>;
|
|
163
163
|
path?: import("./core/Filter").Condition<string>;
|
|
164
164
|
url?: import("./core/Filter").Condition<string>;
|
|
165
|
-
alias?: string
|
|
165
|
+
alias?: import("./core/Filter").Condition<string>;
|
|
166
166
|
createdAt?: import("./core/Filter").Condition<number | null>;
|
|
167
167
|
updatedAt?: import("./core/Filter").Condition<number | null>;
|
|
168
168
|
workspace?: import("./core/Filter").Condition<string> | import("./types").Workspace;
|
|
@@ -194,7 +194,7 @@ export declare function next<Selection extends SelectionGuard = undefined, Type
|
|
|
194
194
|
parentId?: import("./core/Filter").Condition<string | null>;
|
|
195
195
|
path?: import("./core/Filter").Condition<string>;
|
|
196
196
|
url?: import("./core/Filter").Condition<string>;
|
|
197
|
-
alias?: string
|
|
197
|
+
alias?: import("./core/Filter").Condition<string>;
|
|
198
198
|
createdAt?: import("./core/Filter").Condition<number | null>;
|
|
199
199
|
updatedAt?: import("./core/Filter").Condition<number | null>;
|
|
200
200
|
workspace?: import("./core/Filter").Condition<string> | import("./types").Workspace;
|
|
@@ -226,7 +226,7 @@ export declare function previous<Selection extends SelectionGuard = undefined, T
|
|
|
226
226
|
parentId?: import("./core/Filter").Condition<string | null>;
|
|
227
227
|
path?: import("./core/Filter").Condition<string>;
|
|
228
228
|
url?: import("./core/Filter").Condition<string>;
|
|
229
|
-
alias?: string
|
|
229
|
+
alias?: import("./core/Filter").Condition<string>;
|
|
230
230
|
createdAt?: import("./core/Filter").Condition<number | null>;
|
|
231
231
|
updatedAt?: import("./core/Filter").Condition<number | null>;
|
|
232
232
|
workspace?: import("./core/Filter").Condition<string> | import("./types").Workspace;
|
package/dist/ui/RichText.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ interface RichTextElementViews {
|
|
|
26
26
|
li?: ComponentType<JSX.IntrinsicElements['li']> | ReactElement;
|
|
27
27
|
blockquote?: ComponentType<JSX.IntrinsicElements['blockquote']> | ReactElement;
|
|
28
28
|
hr?: ComponentType<JSX.IntrinsicElements['hr']> | ReactElement;
|
|
29
|
+
img?: ComponentType<JSX.IntrinsicElements['img']> | ReactElement;
|
|
29
30
|
br?: ComponentType<JSX.IntrinsicElements['br']> | ReactElement;
|
|
30
31
|
small?: ComponentType<JSX.IntrinsicElements['small']> | ReactElement;
|
|
31
32
|
sub?: ComponentType<JSX.IntrinsicElements['sub']> | ReactElement;
|
package/dist/ui/RichText.js
CHANGED
|
@@ -8,8 +8,10 @@ import {
|
|
|
8
8
|
Node,
|
|
9
9
|
TextNode
|
|
10
10
|
} from "alinea/core/TextDoc";
|
|
11
|
+
import { entries, fromEntries } from "alinea/core/util/Objects";
|
|
11
12
|
import { slugify } from "alinea/core/util/Slugs";
|
|
12
13
|
import {
|
|
14
|
+
cloneElement,
|
|
13
15
|
Fragment,
|
|
14
16
|
isValidElement
|
|
15
17
|
} from "react";
|
|
@@ -22,10 +24,18 @@ function textContent(doc) {
|
|
|
22
24
|
return text;
|
|
23
25
|
}, "");
|
|
24
26
|
}
|
|
25
|
-
function Table({ children }) {
|
|
26
|
-
return /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsx("tbody", { children }) });
|
|
27
|
+
function Table({ children, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx("table", { ...props, children: /* @__PURE__ */ jsx("tbody", { children }) });
|
|
27
29
|
}
|
|
28
30
|
function nodeElement(type, attributes, content) {
|
|
31
|
+
const element = defaultNodeElement(type, attributes, content);
|
|
32
|
+
if (!element || !attributes) return element;
|
|
33
|
+
const dataAttributes = fromEntries(
|
|
34
|
+
entries(attributes).filter(([key]) => key.startsWith("data-"))
|
|
35
|
+
);
|
|
36
|
+
return cloneElement(element, dataAttributes);
|
|
37
|
+
}
|
|
38
|
+
function defaultNodeElement(type, attributes, content) {
|
|
29
39
|
const textAlign = textAlignAttribute(attributes?.textAlign);
|
|
30
40
|
const style = {
|
|
31
41
|
textAlign: textAlign === "left" ? void 0 : textAlign
|
|
@@ -53,6 +63,23 @@ function nodeElement(type, attributes, content) {
|
|
|
53
63
|
return /* @__PURE__ */ jsx("blockquote", { style });
|
|
54
64
|
case "horizontalRule":
|
|
55
65
|
return /* @__PURE__ */ jsx("hr", {});
|
|
66
|
+
case "image": {
|
|
67
|
+
const src = attributes?.src;
|
|
68
|
+
const alt = attributes?.alt;
|
|
69
|
+
const title = attributes?.title;
|
|
70
|
+
const width = attributes?.width;
|
|
71
|
+
const height = attributes?.height;
|
|
72
|
+
return /* @__PURE__ */ jsx(
|
|
73
|
+
"img",
|
|
74
|
+
{
|
|
75
|
+
src: typeof src === "string" ? src : void 0,
|
|
76
|
+
alt: typeof alt === "string" ? alt : "",
|
|
77
|
+
title: typeof title === "string" ? title : void 0,
|
|
78
|
+
width: numberAttribute(width),
|
|
79
|
+
height: numberAttribute(height)
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
56
83
|
case "hardBreak":
|
|
57
84
|
return /* @__PURE__ */ jsx("br", {});
|
|
58
85
|
case "small":
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alinea",
|
|
3
|
-
"version": "2.0.0-preview.
|
|
3
|
+
"version": "2.0.0-preview.3",
|
|
4
4
|
"description": "Headless git-based CMS",
|
|
5
5
|
"repository": "github:alineacms/alinea",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=24.0.0"
|
|
9
|
+
},
|
|
7
10
|
"sideEffects": false,
|
|
8
11
|
"type": "module",
|
|
9
12
|
"imports": {
|
|
@@ -68,7 +71,7 @@
|
|
|
68
71
|
"esbuild": "^0.28.0"
|
|
69
72
|
},
|
|
70
73
|
"peerDependencies": {
|
|
71
|
-
"react": "
|
|
72
|
-
"react-dom": "
|
|
74
|
+
"react": ">=19.0.0",
|
|
75
|
+
"react-dom": ">=19.0.0"
|
|
73
76
|
}
|
|
74
77
|
}
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
$1dfb119a85e764e5$export$cc77c4ff7e8673c5,
|
|
3
|
-
$240e9101ba2842f5$export$7d15b64cf5a3a4c4,
|
|
4
|
-
$240e9101ba2842f5$export$cb6e0bb50bc19463,
|
|
5
|
-
$3e6197669829fe11$export$40bfa8c7b0832715,
|
|
6
|
-
$890783418b00a858$export$6e865ea70d7724f,
|
|
7
|
-
$a747a10fe70a57da$export$c17fa47878dc55b6,
|
|
8
|
-
$b27c684a33948c64$export$2f817fcdc4b89ae0,
|
|
9
|
-
$cd5ea4b915021f1d$export$1005530eda016c13,
|
|
10
|
-
$cd5ea4b915021f1d$export$7475b2c64539e4cf,
|
|
11
|
-
$cd5ea4b915021f1d$export$8c434b3a7a4dad6,
|
|
12
|
-
$cd5ea4b915021f1d$export$fbdeaa6a76694f71,
|
|
13
|
-
$eb76cf4feb040f77$export$cd11ab140839f11d,
|
|
14
|
-
$fd2148440a13ec26$export$75ee7c75d68f5b0e,
|
|
15
|
-
$fd2148440a13ec26$export$aca958c65c314e6c,
|
|
16
|
-
$fd2148440a13ec26$export$fc1a364ae1f3ff10
|
|
17
|
-
} from "./chunk-SJBZFMQ2.js";
|
|
18
1
|
import {
|
|
19
2
|
$12a3c853105e5a70$export$ad991b66133851cf,
|
|
20
3
|
$2aaf608024c21ca1$export$680ea196effce5f,
|
|
@@ -40,6 +23,23 @@ import {
|
|
|
40
23
|
$d07e34cce18680fd$export$b4a036af3fc0b032,
|
|
41
24
|
$d07e34cce18680fd$export$d33f79e3ffc3dc83
|
|
42
25
|
} from "./chunk-IYAQC63Y.js";
|
|
26
|
+
import {
|
|
27
|
+
$1dfb119a85e764e5$export$cc77c4ff7e8673c5,
|
|
28
|
+
$240e9101ba2842f5$export$7d15b64cf5a3a4c4,
|
|
29
|
+
$240e9101ba2842f5$export$cb6e0bb50bc19463,
|
|
30
|
+
$3e6197669829fe11$export$40bfa8c7b0832715,
|
|
31
|
+
$890783418b00a858$export$6e865ea70d7724f,
|
|
32
|
+
$a747a10fe70a57da$export$c17fa47878dc55b6,
|
|
33
|
+
$b27c684a33948c64$export$2f817fcdc4b89ae0,
|
|
34
|
+
$cd5ea4b915021f1d$export$1005530eda016c13,
|
|
35
|
+
$cd5ea4b915021f1d$export$7475b2c64539e4cf,
|
|
36
|
+
$cd5ea4b915021f1d$export$8c434b3a7a4dad6,
|
|
37
|
+
$cd5ea4b915021f1d$export$fbdeaa6a76694f71,
|
|
38
|
+
$eb76cf4feb040f77$export$cd11ab140839f11d,
|
|
39
|
+
$fd2148440a13ec26$export$75ee7c75d68f5b0e,
|
|
40
|
+
$fd2148440a13ec26$export$aca958c65c314e6c,
|
|
41
|
+
$fd2148440a13ec26$export$fc1a364ae1f3ff10
|
|
42
|
+
} from "./chunk-SJBZFMQ2.js";
|
|
43
43
|
|
|
44
44
|
// node_modules/react-stately/dist/private/virtualizer/Size.mjs
|
|
45
45
|
var $cc8e610d5d6e3fe4$export$cb6da89c6af1a8ec = class _$cc8e610d5d6e3fe4$export$cb6da89c6af1a8ec {
|