alinea 0.9.6 → 0.9.7
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/backend/test/Example.d.ts +84 -84
- package/dist/backend/test/ExampleTypes.d.ts +4 -4
- package/dist/chunks/{chunk-UUJJ7TAP.js → chunk-UKZ447AK.js} +2 -2
- package/dist/cli/Serve.js +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/generate/GenerateDashboard.js +1 -1
- package/dist/cloud/server/CloudAuthServer.js +1 -1
- package/dist/core/CMS.d.ts +1 -1
- package/dist/core/Config.d.ts +14 -14
- package/dist/core/Edit.d.ts +17 -14
- package/dist/core/Edit.js +45 -38
- package/dist/core/Query.d.ts +4 -4
- package/dist/core/media/MediaTypes.browser.d.ts +8 -8
- package/dist/core/pages/Cursor.d.ts +4 -4
- package/dist/dashboard/Routes.d.ts +26 -26
- package/dist/dashboard/atoms/DashboardAtoms.d.ts +2 -2
- package/dist/dashboard/atoms/EntryEditorAtoms.d.ts +4 -4
- package/dist/dashboard/atoms/NavigationAtoms.d.ts +3 -3
- package/dist/dashboard/hook/UseConfig.d.ts +1 -1
- package/dist/dashboard/hook/UseGraph.d.ts +1 -1
- package/dist/dashboard/hook/UseRoot.d.ts +4 -4
- package/dist/dashboard/hook/UseSession.d.ts +1 -1
- package/dist/dashboard/hook/UseWorkspace.d.ts +2 -2
- package/dist/dashboard/util/Loader.d.ts +2 -2
- package/dist/dashboard/util/PersistentStore.js +1 -1
- package/dist/dashboard/view/diff/DiffUtils.d.ts +1 -1
- package/dist/dashboard/view/entry/EntrySummary.d.ts +8 -8
- package/dist/field/link/EntryLink.d.ts +8 -8
- package/dist/field/link/FileLink.d.ts +4 -4
- package/dist/field/link/ImageLink.d.ts +1 -1
- package/dist/field/link/Link.d.ts +2 -2
- package/dist/field/link/LinkEditor.d.ts +27 -0
- package/dist/field/link/LinkEditor.js +71 -0
- package/dist/field/link/UrlLink.d.ts +1 -1
- package/dist/field/richtext/PickTextLink.js +15 -13
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/ui/hook/UseElementSize.d.ts +1 -1
- package/dist/ui/util/CreateTypo.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,148 +1,148 @@
|
|
|
1
1
|
export declare function createExample(): {
|
|
2
2
|
schema: {
|
|
3
3
|
Fields: import("alinea/core/Type").Type<import("alinea/core/Document").Document<{
|
|
4
|
-
text: import("
|
|
5
|
-
hello: import("
|
|
6
|
-
richText: import("
|
|
7
|
-
select: import("
|
|
8
|
-
number: import("
|
|
9
|
-
check: import("
|
|
10
|
-
date: import("
|
|
11
|
-
code: import("
|
|
12
|
-
externalLink: import("
|
|
13
|
-
entry: import("
|
|
14
|
-
entryWithCondition: import("
|
|
15
|
-
linkMultiple: import("
|
|
16
|
-
image: import("
|
|
17
|
-
images: import("
|
|
18
|
-
file: import("
|
|
19
|
-
withFields: import("
|
|
4
|
+
text: import("alinea/field/text").TextField;
|
|
5
|
+
hello: import("alinea/field/text").TextField;
|
|
6
|
+
richText: import("alinea/core").RichTextField<{}, import("alinea/field/richtext").RichTextOptions<{}>>;
|
|
7
|
+
select: import("alinea/field/select").SelectField<"a" | "b">;
|
|
8
|
+
number: import("alinea/field/number").NumberField;
|
|
9
|
+
check: import("alinea/field/check").CheckField;
|
|
10
|
+
date: import("alinea/field/date").DateField;
|
|
11
|
+
code: import("alinea/field/code").CodeField;
|
|
12
|
+
externalLink: import("alinea/field/link/LinkField").LinkField<import("alinea/alinea").UrlReference, import("alinea/alinea").UrlLink<{}>>;
|
|
13
|
+
entry: import("alinea/field/link/LinkField").LinkField<import("alinea/alinea").EntryReference, import("alinea/alinea").EntryLink<undefined>>;
|
|
14
|
+
entryWithCondition: import("alinea/field/link/LinkField").LinkField<import("alinea/alinea").EntryReference, import("alinea/alinea").EntryLink<undefined>>;
|
|
15
|
+
linkMultiple: import("alinea/field/link/LinkField").LinksField<import("alinea/core/shape/ListShape").ListRow, import("alinea/types").AnyLink<{}>>;
|
|
16
|
+
image: import("alinea/field/link").ImageField<undefined>;
|
|
17
|
+
images: import("alinea/field/link").ImagesField<undefined>;
|
|
18
|
+
file: import("alinea/field/link/LinkField").LinkField<import("alinea/alinea").EntryReference, import("alinea/alinea").EntryLink<undefined>>;
|
|
19
|
+
withFields: import("alinea/field/link/LinkField").LinkField<import("alinea/core/Reference").Reference, import("alinea/types").AnyLink<{
|
|
20
20
|
fieldA: string;
|
|
21
21
|
fieldB: string;
|
|
22
22
|
}>>;
|
|
23
|
-
multipleWithFields: import("
|
|
23
|
+
multipleWithFields: import("alinea/field/link/LinkField").LinksField<import("alinea/core/shape/ListShape").ListRow, import("alinea/types").AnyLink<{
|
|
24
24
|
fieldA: string;
|
|
25
25
|
fieldB: string;
|
|
26
26
|
}>>;
|
|
27
|
-
list: import("
|
|
27
|
+
list: import("alinea/core").ListField<({
|
|
28
28
|
_type: "Text";
|
|
29
29
|
title: string;
|
|
30
|
-
text: import("
|
|
30
|
+
text: import("alinea/alinea").TextDoc<{}>;
|
|
31
31
|
} | {
|
|
32
32
|
_type: "Image";
|
|
33
|
-
image: import("
|
|
34
|
-
}) & import("
|
|
33
|
+
image: import("alinea/alinea").EntryReference;
|
|
34
|
+
}) & import("alinea/core/shape/ListShape").ListRow, ({
|
|
35
35
|
_type: "Text";
|
|
36
36
|
title: string;
|
|
37
|
-
text: import("
|
|
37
|
+
text: import("alinea/alinea").TextDoc<{}>;
|
|
38
38
|
} | {
|
|
39
39
|
_type: "Image";
|
|
40
|
-
image: import("
|
|
41
|
-
}) & import("
|
|
40
|
+
image: import("alinea/alinea").ImageLink<undefined>;
|
|
41
|
+
}) & import("alinea/core/shape/ListShape").ListRow, import("alinea/field/list").ListOptions<{
|
|
42
42
|
Text: import("alinea/core/Type").Type<{
|
|
43
|
-
title: import("
|
|
44
|
-
text: import("
|
|
43
|
+
title: import("alinea/field/text").TextField;
|
|
44
|
+
text: import("alinea/core").RichTextField<{}, import("alinea/field/richtext").RichTextOptions<{}>>;
|
|
45
45
|
}>;
|
|
46
46
|
Image: import("alinea/core/Type").Type<{
|
|
47
|
-
image: import("
|
|
47
|
+
image: import("alinea/field/link").ImageField<undefined>;
|
|
48
48
|
}>;
|
|
49
49
|
}>>;
|
|
50
|
-
withInitial: import("
|
|
51
|
-
nested: import("
|
|
50
|
+
withInitial: import("alinea/core").RichTextField<{}, import("alinea/field/richtext").RichTextOptions<{}>>;
|
|
51
|
+
nested: import("alinea/core").RichTextField<{
|
|
52
52
|
Inner: import("alinea/core/Type").Type<{
|
|
53
|
-
checkbox1: import("
|
|
54
|
-
checkbox2: import("
|
|
55
|
-
title: import("
|
|
56
|
-
content: import("
|
|
53
|
+
checkbox1: import("alinea/field/check").CheckField;
|
|
54
|
+
checkbox2: import("alinea/field/check").CheckField;
|
|
55
|
+
title: import("alinea/field/text").TextField;
|
|
56
|
+
content: import("alinea/core").RichTextField<{}, import("alinea/field/richtext").RichTextOptions<{}>>;
|
|
57
57
|
}>;
|
|
58
58
|
NestLayout: import("alinea/core/Type").Type<{
|
|
59
|
-
tabA: import("
|
|
60
|
-
tabB: import("
|
|
61
|
-
object: import("
|
|
62
|
-
fieldA: import("
|
|
63
|
-
fieldB: import("
|
|
59
|
+
tabA: import("alinea/field/text").TextField;
|
|
60
|
+
tabB: import("alinea/field/text").TextField;
|
|
61
|
+
object: import("alinea/field/object").ObjectField<{
|
|
62
|
+
fieldA: import("alinea/field/text").TextField;
|
|
63
|
+
fieldB: import("alinea/field/text").TextField;
|
|
64
64
|
}>;
|
|
65
65
|
}>;
|
|
66
|
-
}, import("
|
|
66
|
+
}, import("alinea/field/richtext").RichTextOptions<{
|
|
67
67
|
Inner: import("alinea/core/Type").Type<{
|
|
68
|
-
checkbox1: import("
|
|
69
|
-
checkbox2: import("
|
|
70
|
-
title: import("
|
|
71
|
-
content: import("
|
|
68
|
+
checkbox1: import("alinea/field/check").CheckField;
|
|
69
|
+
checkbox2: import("alinea/field/check").CheckField;
|
|
70
|
+
title: import("alinea/field/text").TextField;
|
|
71
|
+
content: import("alinea/core").RichTextField<{}, import("alinea/field/richtext").RichTextOptions<{}>>;
|
|
72
72
|
}>;
|
|
73
73
|
NestLayout: import("alinea/core/Type").Type<{
|
|
74
|
-
tabA: import("
|
|
75
|
-
tabB: import("
|
|
76
|
-
object: import("
|
|
77
|
-
fieldA: import("
|
|
78
|
-
fieldB: import("
|
|
74
|
+
tabA: import("alinea/field/text").TextField;
|
|
75
|
+
tabB: import("alinea/field/text").TextField;
|
|
76
|
+
object: import("alinea/field/object").ObjectField<{
|
|
77
|
+
fieldA: import("alinea/field/text").TextField;
|
|
78
|
+
fieldB: import("alinea/field/text").TextField;
|
|
79
79
|
}>;
|
|
80
80
|
}>;
|
|
81
81
|
}>>;
|
|
82
82
|
}>>;
|
|
83
83
|
Page: import("alinea/core/Type").Type<{
|
|
84
|
-
name: import("
|
|
85
|
-
name2: import("
|
|
86
|
-
title: import("
|
|
87
|
-
path: import("
|
|
84
|
+
name: import("alinea/field/path").PathField & import("alinea/field/text").TextField;
|
|
85
|
+
name2: import("alinea/field/text").TextField;
|
|
86
|
+
title: import("alinea/field/text").TextField;
|
|
87
|
+
path: import("alinea/field/path").PathField;
|
|
88
88
|
}>;
|
|
89
89
|
Container: import("alinea/core/Type").Type<{
|
|
90
|
-
title: import("
|
|
91
|
-
path: import("
|
|
92
|
-
name: import("
|
|
90
|
+
title: import("alinea/field/text").TextField;
|
|
91
|
+
path: import("alinea/field/path").PathField;
|
|
92
|
+
name: import("alinea/field/text").TextField;
|
|
93
93
|
}>;
|
|
94
94
|
};
|
|
95
95
|
workspaces: {
|
|
96
96
|
main: import("alinea/core/Workspace").Workspace<{
|
|
97
97
|
pages: import("alinea/core/Root").Root<{
|
|
98
98
|
entry1: import("alinea/core/Page").PageSeed<{
|
|
99
|
-
name: import("
|
|
100
|
-
name2: import("
|
|
101
|
-
title: import("
|
|
102
|
-
path: import("
|
|
99
|
+
name: import("alinea/field/path").PathField & import("alinea/field/text").TextField;
|
|
100
|
+
name2: import("alinea/field/text").TextField;
|
|
101
|
+
title: import("alinea/field/text").TextField;
|
|
102
|
+
path: import("alinea/field/path").PathField;
|
|
103
103
|
}, Record<string, any>>;
|
|
104
104
|
entry2: import("alinea/core/Page").PageSeed<{
|
|
105
|
-
title: import("
|
|
106
|
-
path: import("
|
|
107
|
-
name: import("
|
|
105
|
+
title: import("alinea/field/text").TextField;
|
|
106
|
+
path: import("alinea/field/path").PathField;
|
|
107
|
+
name: import("alinea/field/text").TextField;
|
|
108
108
|
}, Record<string, any>>;
|
|
109
109
|
}>;
|
|
110
110
|
multiLanguage: import("alinea/core/Root").Root<{
|
|
111
111
|
localised1: import("alinea/core/Page").PageSeed<{
|
|
112
|
-
name: import("
|
|
113
|
-
name2: import("
|
|
114
|
-
title: import("
|
|
115
|
-
path: import("
|
|
112
|
+
name: import("alinea/field/path").PathField & import("alinea/field/text").TextField;
|
|
113
|
+
name2: import("alinea/field/text").TextField;
|
|
114
|
+
title: import("alinea/field/text").TextField;
|
|
115
|
+
path: import("alinea/field/path").PathField;
|
|
116
116
|
}, Record<string, any>>;
|
|
117
117
|
localised2: import("alinea/core/Page").PageSeed<{
|
|
118
|
-
title: import("
|
|
119
|
-
path: import("
|
|
120
|
-
name: import("
|
|
118
|
+
title: import("alinea/field/text").TextField;
|
|
119
|
+
path: import("alinea/field/path").PathField;
|
|
120
|
+
name: import("alinea/field/text").TextField;
|
|
121
121
|
}, Record<string, any>>;
|
|
122
122
|
}>;
|
|
123
123
|
media: import("alinea/core/media/MediaRoot").MediaRoot<{
|
|
124
124
|
dir: import("alinea/core/Page").PageSeed<{
|
|
125
|
-
title: import("
|
|
126
|
-
path: import("
|
|
125
|
+
title: import("alinea/field/hidden").HiddenField<string>;
|
|
126
|
+
path: import("alinea/field/hidden").HiddenField<string>;
|
|
127
127
|
}, Record<string, any>>;
|
|
128
128
|
'file1.png': import("alinea/core/Page").PageSeed<{
|
|
129
|
-
title: import("
|
|
130
|
-
path: import("
|
|
131
|
-
location: import("
|
|
132
|
-
extension: import("
|
|
133
|
-
size: import("
|
|
134
|
-
hash: import("
|
|
135
|
-
width: import("
|
|
136
|
-
height: import("
|
|
137
|
-
preview: import("
|
|
138
|
-
averageColor: import("
|
|
139
|
-
focus: import("
|
|
129
|
+
title: import("alinea/field/hidden").HiddenField<string>;
|
|
130
|
+
path: import("alinea/field/hidden").HiddenField<string>;
|
|
131
|
+
location: import("alinea/field/hidden").HiddenField<string>;
|
|
132
|
+
extension: import("alinea/field/hidden").HiddenField<string>;
|
|
133
|
+
size: import("alinea/field/hidden").HiddenField<number>;
|
|
134
|
+
hash: import("alinea/field/hidden").HiddenField<string>;
|
|
135
|
+
width: import("alinea/field/hidden").HiddenField<number>;
|
|
136
|
+
height: import("alinea/field/hidden").HiddenField<number>;
|
|
137
|
+
preview: import("alinea/field/hidden").HiddenField<string>;
|
|
138
|
+
averageColor: import("alinea/field/hidden").HiddenField<string>;
|
|
139
|
+
focus: import("alinea/field/hidden").HiddenField<{
|
|
140
140
|
x: number;
|
|
141
141
|
y: number;
|
|
142
142
|
}>;
|
|
143
|
-
thumbHash: import("
|
|
143
|
+
thumbHash: import("alinea/field/hidden").HiddenField<string>;
|
|
144
144
|
}, Record<string, any>>;
|
|
145
145
|
}>;
|
|
146
146
|
}>;
|
|
147
147
|
};
|
|
148
|
-
} & import("alinea/core/driver/TestDriver").TestApi & import("
|
|
148
|
+
} & import("alinea/core/driver/TestDriver").TestApi & import("alinea/core/CMS").CMS;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const TypeWithTabs: import("alinea/core/Type").Type<{
|
|
2
|
-
name: import("
|
|
3
|
-
name2: import("
|
|
4
|
-
title: import("
|
|
5
|
-
path: import("
|
|
2
|
+
name: import("alinea/field/path").PathField & import("alinea/field/text").TextField;
|
|
3
|
+
name2: import("alinea/field/text").TextField;
|
|
4
|
+
title: import("alinea/field/text").TextField;
|
|
5
|
+
path: import("alinea/field/path").PathField;
|
|
6
6
|
}>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var package_default = {
|
|
3
3
|
bin: "./dist/cli.js",
|
|
4
4
|
name: "alinea",
|
|
5
|
-
version: "0.9.
|
|
5
|
+
version: "0.9.7",
|
|
6
6
|
license: "MIT",
|
|
7
7
|
type: "module",
|
|
8
8
|
scripts: {
|
|
@@ -76,7 +76,7 @@ var package_default = {
|
|
|
76
76
|
sass: "^1.63.4",
|
|
77
77
|
sharp: "0.32.6",
|
|
78
78
|
speedscope: "^1.14.0",
|
|
79
|
-
typescript: "^5.
|
|
79
|
+
typescript: "^5.4.5",
|
|
80
80
|
"typescript-plugin-css-modules": "^5.0.2",
|
|
81
81
|
uvu: "^0.5.1"
|
|
82
82
|
},
|
package/dist/cli/Serve.js
CHANGED
package/dist/cli/bin.js
CHANGED
package/dist/core/CMS.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare abstract class CMS extends GraphRealm {
|
|
|
16
16
|
commit(...operations: Array<Operation>): Promise<{
|
|
17
17
|
commitHash: string;
|
|
18
18
|
}>;
|
|
19
|
-
get schema(): import("
|
|
19
|
+
get schema(): import("alinea/alinea").Schema<{}>;
|
|
20
20
|
get workspaces(): Record<string, Workspace>;
|
|
21
21
|
}
|
|
22
22
|
export declare namespace CMS {
|
package/dist/core/Config.d.ts
CHANGED
|
@@ -40,25 +40,25 @@ export declare namespace Config {
|
|
|
40
40
|
export declare function createConfig<Definition extends Config>(definition: Definition): Definition & {
|
|
41
41
|
schema: {
|
|
42
42
|
MediaLibrary: Type<{
|
|
43
|
-
title: import("
|
|
44
|
-
path: import("
|
|
43
|
+
title: import("alinea/field/hidden").HiddenField<string>;
|
|
44
|
+
path: import("alinea/field/hidden").HiddenField<string>;
|
|
45
45
|
}>;
|
|
46
46
|
MediaFile: Type<{
|
|
47
|
-
title: import("
|
|
48
|
-
path: import("
|
|
49
|
-
location: import("
|
|
50
|
-
extension: import("
|
|
51
|
-
size: import("
|
|
52
|
-
hash: import("
|
|
53
|
-
width: import("
|
|
54
|
-
height: import("
|
|
55
|
-
preview: import("
|
|
56
|
-
averageColor: import("
|
|
57
|
-
focus: import("
|
|
47
|
+
title: import("alinea/field/hidden").HiddenField<string>;
|
|
48
|
+
path: import("alinea/field/hidden").HiddenField<string>;
|
|
49
|
+
location: import("alinea/field/hidden").HiddenField<string>;
|
|
50
|
+
extension: import("alinea/field/hidden").HiddenField<string>;
|
|
51
|
+
size: import("alinea/field/hidden").HiddenField<number>;
|
|
52
|
+
hash: import("alinea/field/hidden").HiddenField<string>;
|
|
53
|
+
width: import("alinea/field/hidden").HiddenField<number>;
|
|
54
|
+
height: import("alinea/field/hidden").HiddenField<number>;
|
|
55
|
+
preview: import("alinea/field/hidden").HiddenField<string>;
|
|
56
|
+
averageColor: import("alinea/field/hidden").HiddenField<string>;
|
|
57
|
+
focus: import("alinea/field/hidden").HiddenField<{
|
|
58
58
|
x: number;
|
|
59
59
|
y: number;
|
|
60
60
|
}>;
|
|
61
|
-
thumbHash: import("
|
|
61
|
+
thumbHash: import("alinea/field/hidden").HiddenField<string>;
|
|
62
62
|
}>;
|
|
63
63
|
};
|
|
64
64
|
dashboard: {
|
package/dist/core/Edit.d.ts
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { File } from '@alinea/iso';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import type { ListRow } from 'alinea/core/shape/ListShape';
|
|
2
|
+
import { LinkEditor, LinksEditor } from 'alinea/field/link/LinkEditor';
|
|
3
|
+
import { LinkField, LinksField } from 'alinea/field/link/LinkField';
|
|
5
4
|
import type { Entry } from './Entry.js';
|
|
5
|
+
import { Reference } from './Reference.js';
|
|
6
6
|
import { TextDoc } from './TextDoc.js';
|
|
7
7
|
import { CreateOperation, DeleteOp, EditOperation, UploadOperation, UploadOptions } from './Transaction.js';
|
|
8
8
|
import { Type } from './Type.js';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
import { ListEditor, ListField } from './field/ListField.js';
|
|
10
|
+
import { RichTextEditor, RichTextField } from './field/RichTextField.js';
|
|
11
|
+
import type { ListRow } from './shape/ListShape';
|
|
12
|
+
export declare function update<Definition>(entryId: string, type?: Type<Definition>): EditOperation<Definition>;
|
|
13
|
+
export declare function create<Definition>(type: Type<Definition>): CreateOperation<Definition>;
|
|
14
|
+
export declare function createEntry(entry: Entry): CreateOperation<unknown>;
|
|
15
|
+
export declare function remove(entryId: string): DeleteOp;
|
|
16
|
+
export declare function upload(file: File | [string, Uint8Array], options?: UploadOptions): UploadOperation;
|
|
17
|
+
export declare function archive(entryId: string): EditOperation<unknown>;
|
|
18
|
+
export declare function publish(entryId: string): EditOperation<unknown>;
|
|
19
|
+
export declare function list<StoredValue extends ListRow, QueryValue extends ListRow>(field: ListField<StoredValue, QueryValue, any>, current?: Array<StoredValue>): ListEditor<StoredValue>;
|
|
20
|
+
export declare function richText<Blocks = unknown>(field?: RichTextField<Blocks, any>, current?: TextDoc<Blocks>): RichTextEditor<Blocks>;
|
|
21
|
+
export declare function link<StoredValue extends Reference, QueryValue>(field: LinkField<StoredValue, QueryValue>): LinkEditor<StoredValue>;
|
|
22
|
+
export declare function links<StoredValue extends ListRow, QueryValue>(field: LinksField<StoredValue, QueryValue>): LinksEditor<StoredValue>;
|
package/dist/core/Edit.js
CHANGED
|
@@ -1,51 +1,58 @@
|
|
|
1
1
|
import "../chunks/chunk-U5RRZUYZ.js";
|
|
2
2
|
|
|
3
3
|
// src/core/Edit.ts
|
|
4
|
-
import {
|
|
5
|
-
import { RichTextEditor } from "alinea/core/field/RichTextField";
|
|
4
|
+
import { LinkEditor, LinksEditor } from "alinea/field/link/LinkEditor";
|
|
6
5
|
import {
|
|
7
6
|
CreateOperation,
|
|
8
7
|
DeleteOp,
|
|
9
8
|
EditOperation,
|
|
10
9
|
UploadOperation
|
|
11
10
|
} from "./Transaction.js";
|
|
12
|
-
|
|
11
|
+
import { ListEditor } from "./field/ListField.js";
|
|
12
|
+
import { RichTextEditor } from "./field/RichTextField.js";
|
|
13
|
+
function update(entryId, type) {
|
|
13
14
|
return new EditOperation(entryId);
|
|
14
15
|
}
|
|
15
|
-
(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return new RichTextEditor(current);
|
|
46
|
-
}
|
|
47
|
-
Edit2.richText = richText;
|
|
48
|
-
})(Edit || (Edit = {}));
|
|
16
|
+
function create(type) {
|
|
17
|
+
return new CreateOperation({}, type);
|
|
18
|
+
}
|
|
19
|
+
function createEntry(entry) {
|
|
20
|
+
return new CreateOperation(entry);
|
|
21
|
+
}
|
|
22
|
+
function remove(entryId) {
|
|
23
|
+
return new DeleteOp(entryId);
|
|
24
|
+
}
|
|
25
|
+
function upload(file, options) {
|
|
26
|
+
return new UploadOperation(file, options);
|
|
27
|
+
}
|
|
28
|
+
function archive(entryId) {
|
|
29
|
+
return update(entryId).archive();
|
|
30
|
+
}
|
|
31
|
+
function publish(entryId) {
|
|
32
|
+
return update(entryId).publish();
|
|
33
|
+
}
|
|
34
|
+
function list(field, current) {
|
|
35
|
+
return new ListEditor(current);
|
|
36
|
+
}
|
|
37
|
+
function richText(field, current) {
|
|
38
|
+
return new RichTextEditor(current);
|
|
39
|
+
}
|
|
40
|
+
function link(field) {
|
|
41
|
+
return new LinkEditor();
|
|
42
|
+
}
|
|
43
|
+
function links(field) {
|
|
44
|
+
return new LinksEditor();
|
|
45
|
+
}
|
|
49
46
|
export {
|
|
50
|
-
|
|
47
|
+
archive,
|
|
48
|
+
create,
|
|
49
|
+
createEntry,
|
|
50
|
+
link,
|
|
51
|
+
links,
|
|
52
|
+
list,
|
|
53
|
+
publish,
|
|
54
|
+
remove,
|
|
55
|
+
richText,
|
|
56
|
+
update,
|
|
57
|
+
upload
|
|
51
58
|
};
|
package/dist/core/Query.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ export declare namespace Query {
|
|
|
13
13
|
const isNot: <T>(a: EV<T>, b: EV<T>) => Expr<boolean>;
|
|
14
14
|
const isNull: <T>(a: EV<T>) => Expr<boolean>;
|
|
15
15
|
const isNotNull: <T>(a: EV<T>) => Expr<boolean>;
|
|
16
|
-
const isIn: <T>(a: EV<T>, b: EV<
|
|
17
|
-
const isNotIn: <T>(a: EV<T>, b: EV<
|
|
16
|
+
const isIn: <T>(a: EV<T>, b: EV<ReadonlyArray<T>> | Cursor.Find<T>) => Expr<boolean>;
|
|
17
|
+
const isNotIn: <T>(a: EV<T>, b: EV<ReadonlyArray<T>> | Cursor.Find<T>) => Expr<boolean>;
|
|
18
18
|
const isGreater: <T>(a: EV<T>, b: EV<T>) => Expr<boolean>;
|
|
19
19
|
const isGreaterOrEqual: <T>(a: EV<T>, b: EV<T>) => Expr<boolean>;
|
|
20
20
|
const isLess: <T>(a: EV<T>, b: EV<T>) => Expr<boolean>;
|
|
@@ -26,8 +26,8 @@ export declare namespace Query {
|
|
|
26
26
|
const remainder: (a: EV<number>, b: EV<number>) => Expr<number>;
|
|
27
27
|
const concat: (a: EV<string>, b: EV<string>) => Expr<string>;
|
|
28
28
|
const like: (a: EV<string>, b: EV<string>) => Expr<boolean>;
|
|
29
|
-
const at: <T>(a: EV<T
|
|
30
|
-
const includes: <T>(a: EV<T
|
|
29
|
+
const at: <T>(a: EV<Array<T>>, index: number) => Expr<T | null>;
|
|
30
|
+
const includes: <T>(a: EV<Array<T>>, value: EV<T>) => Expr<boolean>;
|
|
31
31
|
const url: Expr<string>;
|
|
32
32
|
const path: Expr<string>;
|
|
33
33
|
const title: Expr<string>;
|
|
@@ -6,17 +6,17 @@ export declare function fileSummarySelect(): {
|
|
|
6
6
|
workspace: import("../pages/Expr.js").Expr<string>;
|
|
7
7
|
root: import("../pages/Expr.js").Expr<string>;
|
|
8
8
|
title: import("../pages/Expr.js").Expr<string>;
|
|
9
|
-
extension: import("
|
|
10
|
-
size: import("
|
|
11
|
-
preview: import("
|
|
12
|
-
thumbHash: import("
|
|
13
|
-
averageColor: import("
|
|
14
|
-
focus: import("
|
|
9
|
+
extension: import("alinea/field/hidden").HiddenField<string>;
|
|
10
|
+
size: import("alinea/field/hidden").HiddenField<number>;
|
|
11
|
+
preview: import("alinea/field/hidden").HiddenField<string>;
|
|
12
|
+
thumbHash: import("alinea/field/hidden").HiddenField<string>;
|
|
13
|
+
averageColor: import("alinea/field/hidden").HiddenField<string>;
|
|
14
|
+
focus: import("alinea/field/hidden").HiddenField<{
|
|
15
15
|
x: number;
|
|
16
16
|
y: number;
|
|
17
17
|
}>;
|
|
18
|
-
width: import("
|
|
19
|
-
height: import("
|
|
18
|
+
width: import("alinea/field/hidden").HiddenField<number>;
|
|
19
|
+
height: import("alinea/field/hidden").HiddenField<number>;
|
|
20
20
|
parents: import("../pages/Cursor.js").Cursor.Find<{
|
|
21
21
|
entryId: string;
|
|
22
22
|
i18nId: string;
|
|
@@ -96,10 +96,10 @@ export declare class Tree {
|
|
|
96
96
|
children<N extends Narrow>(narrow?: N, depth?: number): Cursor.Find<Output<N>>;
|
|
97
97
|
parents<N extends Narrow>(depth?: number): Cursor.Find<Output<N>>;
|
|
98
98
|
parents<N extends Narrow>(narrow?: N, depth?: number): Cursor.Find<Output<N>>;
|
|
99
|
-
previous: <N extends Narrow>(narrow?: N
|
|
100
|
-
next: <N extends Narrow>(narrow?: N
|
|
101
|
-
parent: <N extends Narrow>(narrow?: N
|
|
102
|
-
siblings: <N extends Narrow>(narrow?: N
|
|
99
|
+
previous: <N extends Narrow>(narrow?: N) => Cursor.Get<Output<N>>;
|
|
100
|
+
next: <N extends Narrow>(narrow?: N) => Cursor.Get<Output<N>>;
|
|
101
|
+
parent: <N extends Narrow>(narrow?: N) => Cursor.Get<Output<N>>;
|
|
102
|
+
siblings: <N extends Narrow>(narrow?: N) => Cursor.Find<Output<N>>;
|
|
103
103
|
translations: (includeSelf?: boolean) => Cursor.Find<Entry>;
|
|
104
104
|
}
|
|
105
105
|
export {};
|
|
@@ -13,21 +13,21 @@ export declare const entryRoute: Route<{
|
|
|
13
13
|
} | undefined;
|
|
14
14
|
};
|
|
15
15
|
revisionId: string;
|
|
16
|
-
activePhase: import("
|
|
17
|
-
phaseInUrl: import("jotai").Atom<import("
|
|
18
|
-
selectedPhase: import("jotai").Atom<import("
|
|
16
|
+
activePhase: import("alinea/core/EntryRow").EntryPhase;
|
|
17
|
+
phaseInUrl: import("jotai").Atom<import("alinea/core/EntryRow").EntryPhase | undefined>;
|
|
18
|
+
selectedPhase: import("jotai").Atom<import("alinea/core/EntryRow").EntryPhase>;
|
|
19
19
|
entryData: import("./atoms/EntryEditorAtoms.js").EntryData;
|
|
20
20
|
editMode: import("jotai").PrimitiveAtom<import("./atoms/EntryEditorAtoms.js").EditMode> & {
|
|
21
21
|
init: import("./atoms/EntryEditorAtoms.js").EditMode;
|
|
22
22
|
};
|
|
23
23
|
activeVersion: import("./atoms/EntryEditorAtoms.js").Version;
|
|
24
|
-
type: import("
|
|
24
|
+
type: import("alinea/alinea").Type;
|
|
25
25
|
yUpdate: import("jotai").Atom<Uint8Array>;
|
|
26
26
|
activeTitle: import("jotai").Atom<string>;
|
|
27
27
|
hasChanges: import("jotai").PrimitiveAtom<boolean> & {
|
|
28
28
|
init: boolean;
|
|
29
29
|
};
|
|
30
|
-
draftEntry: import("jotai").Atom<Promise<import("
|
|
30
|
+
draftEntry: import("jotai").Atom<Promise<import("alinea/core/EntryRow").EntryRow>>;
|
|
31
31
|
saveDraft: import("jotai").WritableAtom<null, [], Promise<void>> & {
|
|
32
32
|
init: null;
|
|
33
33
|
};
|
|
@@ -66,7 +66,7 @@ export declare const entryRoute: Route<{
|
|
|
66
66
|
};
|
|
67
67
|
isLoading: import("jotai").Atom<boolean>;
|
|
68
68
|
showHistory: import("jotai").WritableAtom<boolean, [value: boolean], void>;
|
|
69
|
-
revisionsAtom: import("jotai").Atom<Promise<import("
|
|
69
|
+
revisionsAtom: import("jotai").Atom<Promise<import("alinea/backend/History").Revision[]>>;
|
|
70
70
|
previewRevision: import("jotai").PrimitiveAtom<{
|
|
71
71
|
ref: string;
|
|
72
72
|
file: string;
|
|
@@ -76,21 +76,21 @@ export declare const entryRoute: Route<{
|
|
|
76
76
|
file: string;
|
|
77
77
|
} | undefined;
|
|
78
78
|
};
|
|
79
|
-
preview: import("
|
|
80
|
-
form: import("jotai").Atom<import("
|
|
79
|
+
preview: import("alinea/core/Preview").Preview | undefined;
|
|
80
|
+
form: import("jotai").Atom<import("alinea/dashboard").FormAtoms<object>>;
|
|
81
81
|
view: import("react").ComponentType<import("./view/EntryEdit.js").EntryEditProps & {
|
|
82
|
-
type: import("
|
|
82
|
+
type: import("alinea/alinea").Type<object>;
|
|
83
83
|
}> | undefined;
|
|
84
84
|
parents: {
|
|
85
85
|
entryId: string;
|
|
86
86
|
path: string;
|
|
87
87
|
}[];
|
|
88
|
-
client: import("
|
|
89
|
-
config: import("
|
|
88
|
+
client: import("alinea/core/Connection").Connection;
|
|
89
|
+
config: import("alinea/alinea").Config;
|
|
90
90
|
entryId: string;
|
|
91
91
|
versions: import("./atoms/EntryEditorAtoms.js").Version[];
|
|
92
|
-
phases: Record<import("
|
|
93
|
-
availablePhases: import("
|
|
92
|
+
phases: Record<import("alinea/core/EntryRow").EntryPhase, import("./atoms/EntryEditorAtoms.js").Version>;
|
|
93
|
+
availablePhases: import("alinea/core/EntryRow").EntryPhase[];
|
|
94
94
|
translations: {
|
|
95
95
|
locale: string;
|
|
96
96
|
entryId: string;
|
|
@@ -112,21 +112,21 @@ export declare const draftRoute: Route<{
|
|
|
112
112
|
} | undefined;
|
|
113
113
|
};
|
|
114
114
|
revisionId: string;
|
|
115
|
-
activePhase: import("
|
|
116
|
-
phaseInUrl: import("jotai").Atom<import("
|
|
117
|
-
selectedPhase: import("jotai").Atom<import("
|
|
115
|
+
activePhase: import("alinea/core/EntryRow").EntryPhase;
|
|
116
|
+
phaseInUrl: import("jotai").Atom<import("alinea/core/EntryRow").EntryPhase | undefined>;
|
|
117
|
+
selectedPhase: import("jotai").Atom<import("alinea/core/EntryRow").EntryPhase>;
|
|
118
118
|
entryData: import("./atoms/EntryEditorAtoms.js").EntryData;
|
|
119
119
|
editMode: import("jotai").PrimitiveAtom<import("./atoms/EntryEditorAtoms.js").EditMode> & {
|
|
120
120
|
init: import("./atoms/EntryEditorAtoms.js").EditMode;
|
|
121
121
|
};
|
|
122
122
|
activeVersion: import("./atoms/EntryEditorAtoms.js").Version;
|
|
123
|
-
type: import("
|
|
123
|
+
type: import("alinea/alinea").Type;
|
|
124
124
|
yUpdate: import("jotai").Atom<Uint8Array>;
|
|
125
125
|
activeTitle: import("jotai").Atom<string>;
|
|
126
126
|
hasChanges: import("jotai").PrimitiveAtom<boolean> & {
|
|
127
127
|
init: boolean;
|
|
128
128
|
};
|
|
129
|
-
draftEntry: import("jotai").Atom<Promise<import("
|
|
129
|
+
draftEntry: import("jotai").Atom<Promise<import("alinea/core/EntryRow").EntryRow>>;
|
|
130
130
|
saveDraft: import("jotai").WritableAtom<null, [], Promise<void>> & {
|
|
131
131
|
init: null;
|
|
132
132
|
};
|
|
@@ -165,7 +165,7 @@ export declare const draftRoute: Route<{
|
|
|
165
165
|
};
|
|
166
166
|
isLoading: import("jotai").Atom<boolean>;
|
|
167
167
|
showHistory: import("jotai").WritableAtom<boolean, [value: boolean], void>;
|
|
168
|
-
revisionsAtom: import("jotai").Atom<Promise<import("
|
|
168
|
+
revisionsAtom: import("jotai").Atom<Promise<import("alinea/backend/History").Revision[]>>;
|
|
169
169
|
previewRevision: import("jotai").PrimitiveAtom<{
|
|
170
170
|
ref: string;
|
|
171
171
|
file: string;
|
|
@@ -175,21 +175,21 @@ export declare const draftRoute: Route<{
|
|
|
175
175
|
file: string;
|
|
176
176
|
} | undefined;
|
|
177
177
|
};
|
|
178
|
-
preview: import("
|
|
179
|
-
form: import("jotai").Atom<import("
|
|
178
|
+
preview: import("alinea/core/Preview").Preview | undefined;
|
|
179
|
+
form: import("jotai").Atom<import("alinea/dashboard").FormAtoms<object>>;
|
|
180
180
|
view: import("react").ComponentType<import("./view/EntryEdit.js").EntryEditProps & {
|
|
181
|
-
type: import("
|
|
181
|
+
type: import("alinea/alinea").Type<object>;
|
|
182
182
|
}> | undefined;
|
|
183
183
|
parents: {
|
|
184
184
|
entryId: string;
|
|
185
185
|
path: string;
|
|
186
186
|
}[];
|
|
187
|
-
client: import("
|
|
188
|
-
config: import("
|
|
187
|
+
client: import("alinea/core/Connection").Connection;
|
|
188
|
+
config: import("alinea/alinea").Config;
|
|
189
189
|
entryId: string;
|
|
190
190
|
versions: import("./atoms/EntryEditorAtoms.js").Version[];
|
|
191
|
-
phases: Record<import("
|
|
192
|
-
availablePhases: import("
|
|
191
|
+
phases: Record<import("alinea/core/EntryRow").EntryPhase, import("./atoms/EntryEditorAtoms.js").Version>;
|
|
192
|
+
availablePhases: import("alinea/core/EntryRow").EntryPhase[];
|
|
193
193
|
translations: {
|
|
194
194
|
locale: string;
|
|
195
195
|
entryId: string;
|
|
@@ -13,6 +13,6 @@ export declare const queryClientAtom: import("jotai").PrimitiveAtom<QueryClient>
|
|
|
13
13
|
init: QueryClient;
|
|
14
14
|
};
|
|
15
15
|
export declare const clientAtom: import("jotai").Atom<Connection>;
|
|
16
|
-
export declare const configAtom: import("jotai").Atom<import("
|
|
16
|
+
export declare const configAtom: import("jotai").Atom<import("alinea/alinea").Config>;
|
|
17
17
|
export declare const useSession: () => Session | undefined;
|
|
18
|
-
export declare const useConfig: () => import("
|
|
18
|
+
export declare const useConfig: () => import("alinea/alinea").Config;
|
|
@@ -93,7 +93,7 @@ export declare const entryEditorAtoms: import("jotai/vanilla/utils/atomFamily.js
|
|
|
93
93
|
};
|
|
94
94
|
isLoading: import("jotai").Atom<boolean>;
|
|
95
95
|
showHistory: import("jotai").WritableAtom<boolean, [value: boolean], void>;
|
|
96
|
-
revisionsAtom: import("jotai").Atom<Promise<import("
|
|
96
|
+
revisionsAtom: import("jotai").Atom<Promise<import("alinea/backend/History").Revision[]>>;
|
|
97
97
|
previewRevision: import("jotai").PrimitiveAtom<{
|
|
98
98
|
ref: string;
|
|
99
99
|
file: string;
|
|
@@ -103,7 +103,7 @@ export declare const entryEditorAtoms: import("jotai/vanilla/utils/atomFamily.js
|
|
|
103
103
|
file: string;
|
|
104
104
|
} | undefined;
|
|
105
105
|
};
|
|
106
|
-
preview: import("
|
|
106
|
+
preview: import("alinea/core/Preview").Preview | undefined;
|
|
107
107
|
form: import("jotai").Atom<FormAtoms<object>>;
|
|
108
108
|
view: import("react").ComponentType<import("../view/EntryEdit.js").EntryEditProps & {
|
|
109
109
|
type: Type<object>;
|
|
@@ -210,7 +210,7 @@ export declare function createEntryEditor(entryData: EntryData): {
|
|
|
210
210
|
};
|
|
211
211
|
isLoading: import("jotai").Atom<boolean>;
|
|
212
212
|
showHistory: import("jotai").WritableAtom<boolean, [value: boolean], void>;
|
|
213
|
-
revisionsAtom: import("jotai").Atom<Promise<import("
|
|
213
|
+
revisionsAtom: import("jotai").Atom<Promise<import("alinea/backend/History").Revision[]>>;
|
|
214
214
|
previewRevision: import("jotai").PrimitiveAtom<{
|
|
215
215
|
ref: string;
|
|
216
216
|
file: string;
|
|
@@ -220,7 +220,7 @@ export declare function createEntryEditor(entryData: EntryData): {
|
|
|
220
220
|
file: string;
|
|
221
221
|
} | undefined;
|
|
222
222
|
};
|
|
223
|
-
preview: import("
|
|
223
|
+
preview: import("alinea/core/Preview").Preview | undefined;
|
|
224
224
|
form: import("jotai").Atom<FormAtoms<object>>;
|
|
225
225
|
view: import("react").ComponentType<import("../view/EntryEdit.js").EntryEditProps & {
|
|
226
226
|
type: Type<object>;
|
|
@@ -10,19 +10,19 @@ export declare const workspaceAtom: import("jotai").Atom<{
|
|
|
10
10
|
source: string;
|
|
11
11
|
mediaDir?: string | undefined;
|
|
12
12
|
icon?: import("react").ComponentType | undefined;
|
|
13
|
-
preview?: import("
|
|
13
|
+
preview?: import("alinea/core/Preview").Preview | undefined;
|
|
14
14
|
name: string;
|
|
15
15
|
}>;
|
|
16
16
|
export declare const rootAtom: import("jotai").Atom<{
|
|
17
17
|
label: string;
|
|
18
|
-
contains?: (string | import("
|
|
18
|
+
contains?: (string | import("alinea/alinea").Type)[] | undefined;
|
|
19
19
|
icon?: import("react").ComponentType | undefined;
|
|
20
20
|
i18n?: import("alinea/core/Root").RootI18n | undefined;
|
|
21
21
|
view?: import("react").ComponentType<{
|
|
22
22
|
root: import("alinea/core/Root").RootData;
|
|
23
23
|
}> | undefined;
|
|
24
24
|
isMediaRoot?: boolean | undefined;
|
|
25
|
-
preview?: import("
|
|
25
|
+
preview?: import("alinea/core/Preview").Preview | undefined;
|
|
26
26
|
name: string;
|
|
27
27
|
}>;
|
|
28
28
|
export declare const preferredLanguageAtom: import("jotai").WritableAtom<string | undefined, [string | typeof import("jotai/utils").RESET | ((prev: string | undefined) => string | typeof import("jotai/utils").RESET | undefined) | undefined], void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useConfig: () => import("
|
|
1
|
+
export declare const useConfig: () => import("alinea/alinea").Config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useGraph(): import("
|
|
1
|
+
export declare function useGraph(): import("alinea/core/Graph").Graph;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const useRoot: () => {
|
|
3
3
|
label: string;
|
|
4
|
-
contains?: (string | import("
|
|
4
|
+
contains?: (string | import("alinea/alinea").Type)[] | undefined;
|
|
5
5
|
icon?: import("react").ComponentType | undefined;
|
|
6
|
-
i18n?: import("
|
|
6
|
+
i18n?: import("alinea/core/Root").RootI18n | undefined;
|
|
7
7
|
view?: import("react").ComponentType<{
|
|
8
|
-
root: import("
|
|
8
|
+
root: import("alinea/core/Root").RootData;
|
|
9
9
|
}> | undefined;
|
|
10
10
|
isMediaRoot?: boolean | undefined;
|
|
11
|
-
preview?: import("
|
|
11
|
+
preview?: import("alinea/core/Preview").Preview | undefined;
|
|
12
12
|
name: string;
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useSession: () => import("
|
|
1
|
+
export declare const useSession: () => import("alinea/core/Session").Session;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
export declare const useWorkspace: () => {
|
|
3
3
|
label: string;
|
|
4
4
|
roots: {
|
|
5
|
-
[x: string]: import("
|
|
5
|
+
[x: string]: import("alinea/alinea").Root;
|
|
6
6
|
};
|
|
7
7
|
color: string;
|
|
8
8
|
source: string;
|
|
9
9
|
mediaDir?: string | undefined;
|
|
10
10
|
icon?: import("react").ComponentType | undefined;
|
|
11
|
-
preview?: import("
|
|
11
|
+
preview?: import("alinea/core/Preview").Preview | undefined;
|
|
12
12
|
name: string;
|
|
13
13
|
};
|
|
@@ -9,9 +9,9 @@ export interface LoaderState<T> {
|
|
|
9
9
|
export declare function loader<Value>(asynAtom: Atom<Promise<Value>>): import("jotai").WritableAtom<(get: <Value>(atom: Atom<Value>) => Value, { setSelf }: {
|
|
10
10
|
readonly signal: AbortSignal;
|
|
11
11
|
readonly setSelf: <A extends unknown[]>(...args: A) => unknown;
|
|
12
|
-
}) => LoaderState<
|
|
12
|
+
}) => LoaderState<Value_1>, [value: Value_1], void> & {
|
|
13
13
|
init: (get: <Value>(atom: Atom<Value>) => Value, { setSelf }: {
|
|
14
14
|
readonly signal: AbortSignal;
|
|
15
15
|
readonly setSelf: <A extends unknown[]>(...args: A) => unknown;
|
|
16
|
-
}) => LoaderState<
|
|
16
|
+
}) => LoaderState<Value_1>;
|
|
17
17
|
};
|
|
@@ -13,4 +13,4 @@ export type Change<T> = {
|
|
|
13
13
|
value: T;
|
|
14
14
|
};
|
|
15
15
|
export declare function diffList<T>(a: Array<T>, b: Array<T>, equals: (a: T, b: T) => boolean): Array<Change<T>>;
|
|
16
|
-
export declare function diffRecord(kind: RecordShape, targetA: any, targetB: any): [string, import("
|
|
16
|
+
export declare function diffRecord(kind: RecordShape, targetA: any, targetB: any): [string, import("alinea/core/Shape").Shape<any, any>][];
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Projection } from 'alinea/core/pages/Projection';
|
|
2
2
|
export declare function entrySummaryQuery(): {
|
|
3
|
-
entryId: import("
|
|
4
|
-
i18nId: import("
|
|
5
|
-
type: import("
|
|
6
|
-
workspace: import("
|
|
7
|
-
root: import("
|
|
8
|
-
title: import("
|
|
9
|
-
parents({ parents }: import("
|
|
3
|
+
entryId: import("alinea/core/pages/Expr").Expr<string>;
|
|
4
|
+
i18nId: import("alinea/core/pages/Expr").Expr<string>;
|
|
5
|
+
type: import("alinea/core/pages/Expr").Expr<string>;
|
|
6
|
+
workspace: import("alinea/core/pages/Expr").Expr<string>;
|
|
7
|
+
root: import("alinea/core/pages/Expr").Expr<string>;
|
|
8
|
+
title: import("alinea/core/pages/Expr").Expr<string>;
|
|
9
|
+
parents({ parents }: import("alinea/core/pages/Cursor").Tree): import("alinea/core/pages/Cursor").Cursor.Find<{
|
|
10
10
|
entryId: string;
|
|
11
11
|
i18nId: string;
|
|
12
12
|
title: string;
|
|
13
13
|
}>;
|
|
14
|
-
childrenAmount({ children }: import("
|
|
14
|
+
childrenAmount({ children }: import("alinea/core/pages/Cursor").Tree): import("alinea/core/pages/Cursor").Cursor<number>;
|
|
15
15
|
};
|
|
16
16
|
export declare const EntrySummaryRow: import("alinea/core/View").View<unknown, {
|
|
17
17
|
entryId: string;
|
|
@@ -18,17 +18,17 @@ export interface EntryLink<InferredFields = undefined> extends EntryReference {
|
|
|
18
18
|
fields: InferredFields;
|
|
19
19
|
}
|
|
20
20
|
export declare namespace EntryLink {
|
|
21
|
-
const entryId: import("
|
|
22
|
-
const i18nId: import("
|
|
23
|
-
const title: import("
|
|
24
|
-
const entryType: import("
|
|
25
|
-
const url: import("
|
|
26
|
-
const href: import("
|
|
27
|
-
const path: import("
|
|
21
|
+
const entryId: import("alinea/core/pages/Expr").Expr<string>;
|
|
22
|
+
const i18nId: import("alinea/core/pages/Expr").Expr<string>;
|
|
23
|
+
const title: import("alinea/core/pages/Expr").Expr<string>;
|
|
24
|
+
const entryType: import("alinea/core/pages/Expr").Expr<string>;
|
|
25
|
+
const url: import("alinea/core/pages/Expr").Expr<string>;
|
|
26
|
+
const href: import("alinea/core/pages/Expr").Expr<string>;
|
|
27
|
+
const path: import("alinea/core/pages/Expr").Expr<string>;
|
|
28
28
|
}
|
|
29
29
|
interface EntryOptions<Fields> extends LinkFieldOptions<EntryReference & InferStoredValue<Fields>>, Omit<EntryPickerOptions<Fields>, 'label' | 'hint' | 'selection'> {
|
|
30
30
|
}
|
|
31
|
-
export declare function entry<Fields = undefined>(label: Label, options?: WithoutLabel<EntryOptions<Fields>>): import("alinea/field/link/LinkField").LinkField<EntryReference & InferStoredValue<Fields>, EntryLink<{ [K_1 in keyof Fields as Fields[K_1] extends import("
|
|
31
|
+
export declare function entry<Fields = undefined>(label: Label, options?: WithoutLabel<EntryOptions<Fields>>): import("alinea/field/link/LinkField").LinkField<EntryReference & InferStoredValue<Fields>, EntryLink<{ [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/pages/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/pages/Expr").Expr<infer T_1> ? T_1 : never; } extends infer T ? { [K in keyof T]: { [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/pages/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/pages/Expr").Expr<infer T_1> ? T_1 : never; }[K]; } : never>>;
|
|
32
32
|
export declare namespace entry {
|
|
33
33
|
type EntryRow<Fields> = EntryLink<Type.Infer<Fields>> & ListRow;
|
|
34
34
|
interface EntryOptions<Fields> extends LinkFieldOptions<Array<EntryReference & ListRow & InferStoredValue<Fields>>>, Omit<EntryPickerOptions<Fields>, 'label' | 'hint' | 'selection'> {
|
|
@@ -15,18 +15,18 @@ export interface FileLink<InferredFields = undefined> extends EntryReference {
|
|
|
15
15
|
fields: InferredFields;
|
|
16
16
|
}
|
|
17
17
|
export declare namespace FileLink {
|
|
18
|
-
const title: import("
|
|
18
|
+
const title: import("alinea/core/pages/Expr").Expr<string>;
|
|
19
19
|
const url: import("../hidden").HiddenField<string>;
|
|
20
20
|
const href: import("../hidden").HiddenField<string>;
|
|
21
21
|
const extension: import("../hidden").HiddenField<string>;
|
|
22
22
|
const size: import("../hidden").HiddenField<number>;
|
|
23
23
|
}
|
|
24
|
-
export declare function filePicker<Fields>(multiple: boolean, options: Omit<EntryPickerOptions<Fields>, 'hint' | 'selection'>): import("
|
|
24
|
+
export declare function filePicker<Fields>(multiple: boolean, options: Omit<EntryPickerOptions<Fields>, 'hint' | 'selection'>): import("alinea/core/Picker").Picker<EntryReference, EntryPickerOptions<Fields>>;
|
|
25
25
|
export interface FileOptions<Fields> extends LinkFieldOptions<EntryReference & InferStoredValue<Fields>>, Omit<EntryPickerOptions<Fields>, 'label' | 'hint' | 'selection'> {
|
|
26
26
|
}
|
|
27
|
-
export declare function file<Fields = undefined>(label: Label, options?: WithoutLabel<FileOptions<Fields>>): import("alinea/field/link/LinkField").LinkField<EntryReference & InferStoredValue<Fields>, FileLink<{ [K_1 in keyof Fields as Fields[K_1] extends import("
|
|
27
|
+
export declare function file<Fields = undefined>(label: Label, options?: WithoutLabel<FileOptions<Fields>>): import("alinea/field/link/LinkField").LinkField<EntryReference & InferStoredValue<Fields>, FileLink<{ [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/pages/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/pages/Expr").Expr<infer T_1> ? T_1 : never; } extends infer T ? { [K in keyof T]: { [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/pages/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/pages/Expr").Expr<infer T_1> ? T_1 : never; }[K]; } : never>>;
|
|
28
28
|
export declare namespace file {
|
|
29
29
|
interface FilesOptions<Fields> extends LinkFieldOptions<Array<EntryReference & ListRow & InferStoredValue<Fields>>>, Omit<EntryPickerOptions<Fields>, 'label' | 'hint' | 'selection'> {
|
|
30
30
|
}
|
|
31
|
-
function multiple<Fields = undefined>(label: Label, options?: WithoutLabel<FilesOptions<Fields>>): import("alinea/field/link/LinkField").LinksField<EntryReference & ListRow & InferStoredValue<Fields>, FileLink<{ [K_1 in keyof Fields as Fields[K_1] extends import("
|
|
31
|
+
function multiple<Fields = undefined>(label: Label, options?: WithoutLabel<FilesOptions<Fields>>): import("alinea/field/link/LinkField").LinksField<EntryReference & ListRow & InferStoredValue<Fields>, FileLink<{ [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/pages/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/pages/Expr").Expr<infer T_1> ? T_1 : never; } extends infer T ? { [K in keyof T]: { [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/pages/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/pages/Expr").Expr<infer T_1> ? T_1 : never; }[K]; } : never>>;
|
|
32
32
|
}
|
|
@@ -24,7 +24,7 @@ export interface ImageLink<InferredFields = undefined> extends EntryReference {
|
|
|
24
24
|
fields: InferredFields;
|
|
25
25
|
}
|
|
26
26
|
export declare namespace ImageLink {
|
|
27
|
-
const title: import("
|
|
27
|
+
const title: import("alinea/core/pages/Expr").Expr<string>;
|
|
28
28
|
const src: import("../hidden").HiddenField<string>;
|
|
29
29
|
const extension: import("../hidden").HiddenField<string>;
|
|
30
30
|
const size: import("../hidden").HiddenField<number>;
|
|
@@ -13,9 +13,9 @@ export type AnyLink<InferredFields> = EntryLink<InferredFields> | UrlLink<Inferr
|
|
|
13
13
|
export interface LinkOptions<Definition, Row> extends LinkFieldOptions<Row> {
|
|
14
14
|
fields?: Definition | Type<Definition>;
|
|
15
15
|
}
|
|
16
|
-
export declare function link<Fields>(label: Label, options?: WithoutLabel<LinkOptions<Fields, Reference>>): import("alinea/field/link/LinkField").LinkField<Reference, AnyLink<{ [K_1 in keyof Fields as Fields[K_1] extends import("
|
|
16
|
+
export declare function link<Fields>(label: Label, options?: WithoutLabel<LinkOptions<Fields, Reference>>): import("alinea/field/link/LinkField").LinkField<Reference, AnyLink<{ [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/pages/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/pages/Expr").Expr<infer T_1> ? T_1 : never; } extends infer T ? { [K in keyof T]: { [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/pages/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/pages/Expr").Expr<infer T_1> ? T_1 : never; }[K]; } : never>>;
|
|
17
17
|
export declare namespace link {
|
|
18
|
-
function multiple<Fields>(label: Label, options?: WithoutLabel<LinkOptions<Fields, Array<ListRow>>>): import("alinea/field/link/LinkField").LinksField<ListRow, AnyLink<{ [K_1 in keyof Fields as Fields[K_1] extends import("
|
|
18
|
+
function multiple<Fields>(label: Label, options?: WithoutLabel<LinkOptions<Fields, Array<ListRow>>>): import("alinea/field/link/LinkField").LinksField<ListRow, AnyLink<{ [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/pages/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/pages/Expr").Expr<infer T_1> ? T_1 : never; } extends infer T ? { [K in keyof T]: { [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/pages/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/pages/Expr").Expr<infer T_1> ? T_1 : never; }[K]; } : never>>;
|
|
19
19
|
/** @deprecated Use Field.image */
|
|
20
20
|
const image: typeof imageLink;
|
|
21
21
|
/** @deprecated Use Field.entry */
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Reference } from 'alinea/core/Reference';
|
|
2
|
+
import { ListEditor } from 'alinea/core/field/ListField';
|
|
3
|
+
import { ListRow } from 'alinea/core/shape/ListShape';
|
|
4
|
+
export declare class LinkEditor<StoredValue extends Reference> {
|
|
5
|
+
row?: StoredValue;
|
|
6
|
+
constructor();
|
|
7
|
+
add(type: StoredValue['_type'], value: Omit<StoredValue, '_type' | '_id'>): this;
|
|
8
|
+
addUrl(data: {
|
|
9
|
+
url: string;
|
|
10
|
+
title: string;
|
|
11
|
+
target?: string;
|
|
12
|
+
}, fields?: Record<string, unknown>): this;
|
|
13
|
+
addEntry(entryId: string, fields?: Record<string, unknown>): this;
|
|
14
|
+
addImage(entryId: string, fields?: Record<string, unknown>): this;
|
|
15
|
+
addFile(entryId: string, fields?: Record<string, unknown>): this;
|
|
16
|
+
value(): StoredValue;
|
|
17
|
+
}
|
|
18
|
+
export declare class LinksEditor<StoredValue extends ListRow> extends ListEditor<StoredValue> {
|
|
19
|
+
addUrl(data: {
|
|
20
|
+
url: string;
|
|
21
|
+
title: string;
|
|
22
|
+
target?: string;
|
|
23
|
+
}): this;
|
|
24
|
+
addEntry(entryId: string): this;
|
|
25
|
+
addImage(entryId: string): this;
|
|
26
|
+
addFile(entryId: string): this;
|
|
27
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import "../../chunks/chunk-U5RRZUYZ.js";
|
|
2
|
+
|
|
3
|
+
// src/field/link/LinkEditor.ts
|
|
4
|
+
import { createId } from "alinea/core/Id";
|
|
5
|
+
import { Reference } from "alinea/core/Reference";
|
|
6
|
+
import { ListEditor } from "alinea/core/field/ListField";
|
|
7
|
+
import { EntryReference } from "alinea/picker/entry/EntryReference";
|
|
8
|
+
import { UrlReference } from "alinea/picker/url/UrlPicker";
|
|
9
|
+
var LinkEditor = class {
|
|
10
|
+
row;
|
|
11
|
+
constructor() {
|
|
12
|
+
}
|
|
13
|
+
add(type, value) {
|
|
14
|
+
this.row = {
|
|
15
|
+
[Reference.id]: createId(),
|
|
16
|
+
[Reference.type]: type,
|
|
17
|
+
...value
|
|
18
|
+
};
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
addUrl(data, fields) {
|
|
22
|
+
return this.add("url", {
|
|
23
|
+
[UrlReference.url]: data.url,
|
|
24
|
+
[UrlReference.title]: data.title,
|
|
25
|
+
[UrlReference.target]: data.target ?? "_blank",
|
|
26
|
+
...fields
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
addEntry(entryId, fields) {
|
|
30
|
+
return this.add("entry", {
|
|
31
|
+
[EntryReference.entry]: entryId,
|
|
32
|
+
...fields
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
addImage(entryId, fields) {
|
|
36
|
+
return this.add("image", {
|
|
37
|
+
[EntryReference.entry]: entryId,
|
|
38
|
+
...fields
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
addFile(entryId, fields) {
|
|
42
|
+
return this.add("file", { [EntryReference.entry]: entryId, ...fields });
|
|
43
|
+
}
|
|
44
|
+
value() {
|
|
45
|
+
if (!this.row)
|
|
46
|
+
throw new Error("LinkEditor row not created");
|
|
47
|
+
return this.row;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
var LinksEditor = class extends ListEditor {
|
|
51
|
+
addUrl(data) {
|
|
52
|
+
return this.add("url", {
|
|
53
|
+
[UrlReference.url]: data.url,
|
|
54
|
+
[UrlReference.title]: data.title,
|
|
55
|
+
[UrlReference.target]: data.target ?? "_blank"
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
addEntry(entryId) {
|
|
59
|
+
return this.add("entry", { [EntryReference.entry]: entryId });
|
|
60
|
+
}
|
|
61
|
+
addImage(entryId) {
|
|
62
|
+
return this.add("image", { [EntryReference.entry]: entryId });
|
|
63
|
+
}
|
|
64
|
+
addFile(entryId) {
|
|
65
|
+
return this.add("file", { [EntryReference.entry]: entryId });
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
export {
|
|
69
|
+
LinkEditor,
|
|
70
|
+
LinksEditor
|
|
71
|
+
};
|
|
@@ -17,7 +17,7 @@ export declare namespace UrlLink {
|
|
|
17
17
|
}
|
|
18
18
|
export interface UrlOptions<Fields> extends LinkFieldOptions<UrlReference & InferStoredValue<Fields>>, UrlPickerOptions<Fields> {
|
|
19
19
|
}
|
|
20
|
-
export declare function url<Fields>(label: Label, options?: WithoutLabel<UrlOptions<Fields>>): import("alinea/field/link/LinkField").LinkField<UrlReference & InferStoredValue<Fields>, UrlLink<{ [K_1 in keyof Fields as Fields[K_1] extends import("
|
|
20
|
+
export declare function url<Fields>(label: Label, options?: WithoutLabel<UrlOptions<Fields>>): import("alinea/field/link/LinkField").LinkField<UrlReference & InferStoredValue<Fields>, UrlLink<{ [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/pages/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/pages/Expr").Expr<infer T_1> ? T_1 : never; } extends infer T ? { [K in keyof T]: { [K_1 in keyof Fields as Fields[K_1] extends import("alinea/core/pages/Expr").Expr<any> ? K_1 : never]: Fields[K_1] extends import("alinea/core/pages/Expr").Expr<infer T_1> ? T_1 : never; }[K]; } : never>>;
|
|
21
21
|
export declare namespace url {
|
|
22
22
|
type UrlRows<Fields> = UrlLink<Type.Infer<Fields>> & ListRow;
|
|
23
23
|
export interface UrlOptions<Fields> extends LinkFieldOptions<Array<UrlReference & ListRow & InferStoredValue<Fields>>>, UrlPickerOptions<Fields> {
|
|
@@ -26,19 +26,21 @@ var styles = fromModule(PickLink_module_default);
|
|
|
26
26
|
function linkForm(options) {
|
|
27
27
|
const isExistingLink = Boolean(options.link);
|
|
28
28
|
const fields = type({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
fields: {
|
|
30
|
+
link: createLink("Link", {
|
|
31
|
+
required: true,
|
|
32
|
+
initialValue: options.link
|
|
33
|
+
}),
|
|
34
|
+
description: text("Description", {
|
|
35
|
+
help: "Text to display inside the link element"
|
|
36
|
+
}),
|
|
37
|
+
title: text("Tooltip", {
|
|
38
|
+
help: "Extra information that describes the link, shown on hover"
|
|
39
|
+
}),
|
|
40
|
+
blank: check("Open link in new tab", {
|
|
41
|
+
inline: true
|
|
42
|
+
})
|
|
43
|
+
}
|
|
42
44
|
});
|
|
43
45
|
track.options(fields.description, (get) => {
|
|
44
46
|
const selected = get(fields.link);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as alinea from './alinea.js';
|
|
2
2
|
export { alinea as default };
|
|
3
3
|
export * as Config from './config.js';
|
|
4
|
-
export
|
|
4
|
+
export * as Edit from './core/Edit.js';
|
|
5
5
|
export { Query } from './core/Query.js';
|
|
6
6
|
export * as Field from './field.js';
|
|
7
7
|
export * from './types.js';
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import "./chunks/chunk-U5RRZUYZ.js";
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
import * as alinea from "./alinea.js";
|
|
5
5
|
import * as Config from "./config.js";
|
|
6
|
-
import
|
|
6
|
+
import * as Edit from "./core/Edit.js";
|
|
7
7
|
import { Query } from "./core/Query.js";
|
|
8
8
|
import * as Field from "./field.js";
|
|
9
9
|
export * from "./types.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
-
export declare const useElementSize: <T extends HTMLElement>(ref?: RefObject<T>
|
|
2
|
+
export declare const useElementSize: <T extends HTMLElement>(ref?: RefObject<T>) => {
|
|
3
3
|
height: number | undefined;
|
|
4
4
|
width: number | undefined;
|
|
5
5
|
ref: RefObject<T>;
|
|
@@ -25,7 +25,7 @@ interface Overrides {
|
|
|
25
25
|
small?: ComponentType<any>;
|
|
26
26
|
}
|
|
27
27
|
export declare function createTypo(styles: TypoStyles, overrides?: Overrides): (({ children, align }: PropsWithChildren<{
|
|
28
|
-
align?:
|
|
28
|
+
align?: 'left' | 'right' | 'center';
|
|
29
29
|
}>) => import("react/jsx-runtime").JSX.Element) & {
|
|
30
30
|
H1: import("./PropsWithAs.js").ComponentWithAs<{
|
|
31
31
|
flat?: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bin": "./dist/cli.js",
|
|
3
3
|
"name": "alinea",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.7",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"sass": "^1.63.4",
|
|
76
76
|
"sharp": "0.32.6",
|
|
77
77
|
"speedscope": "^1.14.0",
|
|
78
|
-
"typescript": "^5.
|
|
78
|
+
"typescript": "^5.4.5",
|
|
79
79
|
"typescript-plugin-css-modules": "^5.0.2",
|
|
80
80
|
"uvu": "^0.5.1"
|
|
81
81
|
},
|