alinea 0.4.2 → 0.4.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/chunks/{chunk-LRUUF55J.js → chunk-XAQKCJN6.js} +1 -1
- 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/media/MediaSchema.js +7 -1
- package/dist/dashboard/view/EntryTree.js +3 -1
- package/dist/index.css +37 -1
- package/dist/input/richtext/RichTextField.browser.js +1 -0
- package/dist/input/richtext/RichTextKit.js +1 -0
- package/dist/input/richtext/RichTextToolbar.js +18 -2
- package/dist/picker/entry/EntryPicker.d.ts +4 -0
- package/dist/picker/entry/EntryPicker.js +2 -1
- package/dist/picker/entry/EntryReference.d.ts +4 -0
- package/dist/picker/url/UrlPicker.browser.js +2 -2
- package/dist/picker/url/UrlPicker.d.ts +1 -1
- package/dist/picker/url/UrlPicker.js +1 -1
- package/dist/picker/url/UrlPickerRow.js +1 -1
- package/dist/ui/Typo.d.ts +4 -0
- package/dist/ui/Typo.js +1 -0
- package/dist/ui/util/CreateTypo.d.ts +6 -1
- package/dist/ui/util/CreateTypo.js +13 -0
- package/package.json +1 -1
package/dist/cli/Serve.js
CHANGED
package/dist/cli/bin.js
CHANGED
|
@@ -26,7 +26,13 @@ var MediaFile = type("File", {
|
|
|
26
26
|
height: hidden("Image height", Hint.Number()),
|
|
27
27
|
preview: hidden("Preview", Hint.String()),
|
|
28
28
|
averageColor: hidden("Average color", Hint.String()),
|
|
29
|
-
focus: hidden(
|
|
29
|
+
focus: hidden(
|
|
30
|
+
"Focus",
|
|
31
|
+
Hint.Object({
|
|
32
|
+
x: Hint.Number(),
|
|
33
|
+
y: Hint.Number()
|
|
34
|
+
})
|
|
35
|
+
),
|
|
30
36
|
thumbHash: hidden("Blur hash", Hint.String()),
|
|
31
37
|
[Meta]: {
|
|
32
38
|
isHidden: true
|
|
@@ -968,15 +968,17 @@ function EntryTreeItem({ item, data }) {
|
|
|
968
968
|
"button",
|
|
969
969
|
{
|
|
970
970
|
className: styles.tree.item.label(),
|
|
971
|
+
title: selectedEntry(locale, itemData).title,
|
|
971
972
|
style: { paddingLeft: px((item.getItemMeta().level + 1) * 12) },
|
|
972
973
|
children: [
|
|
973
|
-
|
|
974
|
+
/* @__PURE__ */ jsx("span", { className: styles.tree.item.icon(), children: /* @__PURE__ */ jsx(
|
|
974
975
|
Icon,
|
|
975
976
|
{
|
|
976
977
|
icon: isUntranslated ? IcRoundTranslate : icon ?? IcOutlineDescription
|
|
977
978
|
}
|
|
978
979
|
) }),
|
|
979
980
|
/* @__PURE__ */ jsx("span", { className: styles.tree.item.label.itemName(), children: selectedEntry(locale, itemData).title }),
|
|
981
|
+
item.isFolder() && /* @__PURE__ */ jsx("span", { className: styles.tree.item.arrow(), children: item.isExpanded() ? /* @__PURE__ */ jsx(Icon, { icon: IcRoundKeyboardArrowDown, size: 18 }) : /* @__PURE__ */ jsx(Icon, { icon: IcRoundKeyboardArrowRight, size: 18 }) }),
|
|
980
982
|
!isUntranslated && isDraft && /* @__PURE__ */ jsx("span", { className: styles.tree.status({ draft: true }), children: /* @__PURE__ */ jsx(Icon, { icon: IcRoundEdit }) }),
|
|
981
983
|
!isUntranslated && isArchived && /* @__PURE__ */ jsx("span", { className: styles.tree.status({ archived: true }), children: /* @__PURE__ */ jsx(Icon, { icon: IcRoundArchive, size: 18 }) })
|
|
982
984
|
]
|
package/dist/index.css
CHANGED
|
@@ -1016,7 +1016,7 @@ button {
|
|
|
1016
1016
|
align-items: center;
|
|
1017
1017
|
justify-content: center;
|
|
1018
1018
|
width: 1.25rem;
|
|
1019
|
-
margin-
|
|
1019
|
+
margin-left: auto;
|
|
1020
1020
|
height: 1.25rem;
|
|
1021
1021
|
flex-shrink: 0;
|
|
1022
1022
|
color: hsla(var(--alinea-negative), 0.5);
|
|
@@ -2745,6 +2745,7 @@ html[data-theme=dark] .alinea-Viewport {
|
|
|
2745
2745
|
.alinea-RichTextField-hyphenate,
|
|
2746
2746
|
.alinea-RichTextField-link,
|
|
2747
2747
|
.alinea-RichTextField-p,
|
|
2748
|
+
.alinea-RichTextField-h5,
|
|
2748
2749
|
.alinea-RichTextField-h4,
|
|
2749
2750
|
.alinea-RichTextField-h3,
|
|
2750
2751
|
.alinea-RichTextField-h2,
|
|
@@ -2802,6 +2803,17 @@ html[data-theme=dark] .alinea-Viewport {
|
|
|
2802
2803
|
.alinea-RichTextField-h4.alinea-RichTextField-is-flat {
|
|
2803
2804
|
margin-bottom: 0;
|
|
2804
2805
|
}
|
|
2806
|
+
.alinea-RichTextField-h5 {
|
|
2807
|
+
min-width: 0;
|
|
2808
|
+
font-size: 0.71875rem;
|
|
2809
|
+
font-weight: bold;
|
|
2810
|
+
margin-bottom: 0.1875rem;
|
|
2811
|
+
white-space: pre-line;
|
|
2812
|
+
text-rendering: optimizeLegibility;
|
|
2813
|
+
}
|
|
2814
|
+
.alinea-RichTextField-h5.alinea-RichTextField-is-flat {
|
|
2815
|
+
margin-bottom: 0;
|
|
2816
|
+
}
|
|
2805
2817
|
.alinea-RichTextField-p {
|
|
2806
2818
|
font-size: 0.875rem;
|
|
2807
2819
|
line-height: 1.6;
|
|
@@ -2876,6 +2888,7 @@ html[data-theme=dark] .alinea-Viewport {
|
|
|
2876
2888
|
.alinea-RichTextKit-hyphenate,
|
|
2877
2889
|
.alinea-RichTextKit-link,
|
|
2878
2890
|
.alinea-RichTextKit-p,
|
|
2891
|
+
.alinea-RichTextKit-h5,
|
|
2879
2892
|
.alinea-RichTextKit-h4,
|
|
2880
2893
|
.alinea-RichTextKit-h3,
|
|
2881
2894
|
h3.alinea-RichTextKit-heading,
|
|
@@ -2942,6 +2955,17 @@ h3.alinea-RichTextKit-is-flat.alinea-RichTextKit-heading {
|
|
|
2942
2955
|
.alinea-RichTextKit-h4.alinea-RichTextKit-is-flat {
|
|
2943
2956
|
margin-bottom: 0;
|
|
2944
2957
|
}
|
|
2958
|
+
.alinea-RichTextKit-h5 {
|
|
2959
|
+
min-width: 0;
|
|
2960
|
+
font-size: 0.71875rem;
|
|
2961
|
+
font-weight: bold;
|
|
2962
|
+
margin-bottom: 0.1875rem;
|
|
2963
|
+
white-space: pre-line;
|
|
2964
|
+
text-rendering: optimizeLegibility;
|
|
2965
|
+
}
|
|
2966
|
+
.alinea-RichTextKit-h5.alinea-RichTextKit-is-flat {
|
|
2967
|
+
margin-bottom: 0;
|
|
2968
|
+
}
|
|
2945
2969
|
.alinea-RichTextKit-p {
|
|
2946
2970
|
font-size: 0.875rem;
|
|
2947
2971
|
line-height: 1.6;
|
|
@@ -3895,6 +3919,7 @@ h3.alinea-RichTextKit-heading:not(:last-child) {
|
|
|
3895
3919
|
.alinea-Typo-hyphenate,
|
|
3896
3920
|
.alinea-Typo-link,
|
|
3897
3921
|
.alinea-Typo-p,
|
|
3922
|
+
.alinea-Typo-h5,
|
|
3898
3923
|
.alinea-Typo-h4,
|
|
3899
3924
|
.alinea-Typo-h3,
|
|
3900
3925
|
.alinea-Typo-h2,
|
|
@@ -3952,6 +3977,17 @@ h3.alinea-RichTextKit-heading:not(:last-child) {
|
|
|
3952
3977
|
.alinea-Typo-h4.alinea-Typo-is-flat {
|
|
3953
3978
|
margin-bottom: 0;
|
|
3954
3979
|
}
|
|
3980
|
+
.alinea-Typo-h5 {
|
|
3981
|
+
min-width: 0;
|
|
3982
|
+
font-size: 0.71875rem;
|
|
3983
|
+
font-weight: bold;
|
|
3984
|
+
margin-bottom: 0.1875rem;
|
|
3985
|
+
white-space: pre-line;
|
|
3986
|
+
text-rendering: optimizeLegibility;
|
|
3987
|
+
}
|
|
3988
|
+
.alinea-Typo-h5.alinea-Typo-is-flat {
|
|
3989
|
+
margin-bottom: 0;
|
|
3990
|
+
}
|
|
3955
3991
|
.alinea-Typo-p {
|
|
3956
3992
|
font-size: 0.875rem;
|
|
3957
3993
|
line-height: 1.6;
|
|
@@ -1270,6 +1270,7 @@ var RichTextField_module_default = {
|
|
|
1270
1270
|
"hyphenate": "alinea-RichTextField-hyphenate",
|
|
1271
1271
|
"link": "alinea-RichTextField-link",
|
|
1272
1272
|
"p": "alinea-RichTextField-p",
|
|
1273
|
+
"h5": "alinea-RichTextField-h5",
|
|
1273
1274
|
"h4": "alinea-RichTextField-h4",
|
|
1274
1275
|
"h3": "alinea-RichTextField-h3",
|
|
1275
1276
|
"h2": "alinea-RichTextField-h2",
|
|
@@ -1267,6 +1267,7 @@ var RichTextKit_module_default = {
|
|
|
1267
1267
|
"hyphenate": "alinea-RichTextKit-hyphenate",
|
|
1268
1268
|
"link": "alinea-RichTextKit-link",
|
|
1269
1269
|
"p": "alinea-RichTextKit-p",
|
|
1270
|
+
"h5": "alinea-RichTextKit-h5",
|
|
1270
1271
|
"h4": "alinea-RichTextKit-h4",
|
|
1271
1272
|
"h3": "alinea-RichTextKit-h3",
|
|
1272
1273
|
"heading": "alinea-RichTextKit-heading",
|
|
@@ -39,13 +39,15 @@ var Styles = /* @__PURE__ */ ((Styles2) => {
|
|
|
39
39
|
Styles2["h1"] = "Heading 1";
|
|
40
40
|
Styles2["h2"] = "Heading 2";
|
|
41
41
|
Styles2["h3"] = "Heading 3";
|
|
42
|
+
Styles2["h4"] = "Heading 4";
|
|
43
|
+
Styles2["h5"] = "Heading 5";
|
|
42
44
|
return Styles2;
|
|
43
45
|
})(Styles || {});
|
|
44
46
|
var RichTextToolbar = forwardRef(function RichTextToolbar2({ pickLink, editor, focusToggle }, ref) {
|
|
45
47
|
function exec() {
|
|
46
48
|
return editor.chain().focus(null, { scrollIntoView: false });
|
|
47
49
|
}
|
|
48
|
-
const selectedStyle = editor.isActive("heading", { level: 1 }) ? "h1" : editor.isActive("heading", { level: 2 }) ? "h2" : editor.isActive("heading", { level: 3 }) ? "h3" : "paragraph";
|
|
50
|
+
const selectedStyle = editor.isActive("heading", { level: 1 }) ? "h1" : editor.isActive("heading", { level: 2 }) ? "h2" : editor.isActive("heading", { level: 3 }) ? "h3" : editor.isActive("heading", { level: 4 }) ? "h4" : editor.isActive("heading", { level: 5 }) ? "h5" : "paragraph";
|
|
49
51
|
function handleLink() {
|
|
50
52
|
const attrs = editor.getAttributes("link");
|
|
51
53
|
const existing = attributesToReference(attrs);
|
|
@@ -76,7 +78,7 @@ var RichTextToolbar = forwardRef(function RichTextToolbar2({ pickLink, editor, f
|
|
|
76
78
|
} else {
|
|
77
79
|
exec().insertContent({
|
|
78
80
|
type: "text",
|
|
79
|
-
text: picked.
|
|
81
|
+
text: picked.title || link.title || link.url || "",
|
|
80
82
|
marks: [{ type: "link", attrs: attrs2 }]
|
|
81
83
|
}).run();
|
|
82
84
|
}
|
|
@@ -125,6 +127,20 @@ var RichTextToolbar = forwardRef(function RichTextToolbar2({ pickLink, editor, f
|
|
|
125
127
|
onClick: () => exec().setHeading({ level: 3 }).run(),
|
|
126
128
|
children: /* @__PURE__ */ jsx(Typo.H3, { flat: true, children: "Heading 3" })
|
|
127
129
|
}
|
|
130
|
+
),
|
|
131
|
+
/* @__PURE__ */ jsx(
|
|
132
|
+
DropdownMenu.Item,
|
|
133
|
+
{
|
|
134
|
+
onClick: () => exec().setHeading({ level: 4 }).run(),
|
|
135
|
+
children: /* @__PURE__ */ jsx(Typo.H4, { flat: true, children: "Heading 4" })
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ jsx(
|
|
139
|
+
DropdownMenu.Item,
|
|
140
|
+
{
|
|
141
|
+
onClick: () => exec().setHeading({ level: 5 }).run(),
|
|
142
|
+
children: /* @__PURE__ */ jsx(Typo.H5, { flat: true, children: "Heading 5" })
|
|
143
|
+
}
|
|
128
144
|
)
|
|
129
145
|
] })
|
|
130
146
|
] }),
|
|
@@ -27,6 +27,10 @@ export declare const imageFields: {
|
|
|
27
27
|
height: import("../../input/hidden.js").HiddenField<number>;
|
|
28
28
|
averageColor: import("../../input/hidden.js").HiddenField<string>;
|
|
29
29
|
thumbHash: import("../../input/hidden.js").HiddenField<string>;
|
|
30
|
+
focus: import("../../input/hidden.js").HiddenField<{
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
}>;
|
|
30
34
|
};
|
|
31
35
|
export interface EntryPickerOptions<T = {}> {
|
|
32
36
|
hint: Hint;
|
|
@@ -29,7 +29,8 @@ var imageFields = {
|
|
|
29
29
|
width: MediaFile.width,
|
|
30
30
|
height: MediaFile.height,
|
|
31
31
|
averageColor: MediaFile.averageColor,
|
|
32
|
-
thumbHash: MediaFile.thumbHash
|
|
32
|
+
thumbHash: MediaFile.thumbHash,
|
|
33
|
+
focus: MediaFile.focus
|
|
33
34
|
};
|
|
34
35
|
function entryPicker(options) {
|
|
35
36
|
const extra = options.fields && Type.shape(options.fields);
|
|
@@ -31,6 +31,10 @@ export interface ImageReference extends EntryLinkReference {
|
|
|
31
31
|
height: number;
|
|
32
32
|
averageColor: string;
|
|
33
33
|
thumbHash: string;
|
|
34
|
+
focus: {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
};
|
|
34
38
|
}
|
|
35
39
|
export declare namespace ImageReference {
|
|
36
40
|
function isImageReference(value: any): value is ImageReference;
|
|
@@ -21,7 +21,7 @@ var linkForm = type("Link", {
|
|
|
21
21
|
url: text("Url", {
|
|
22
22
|
help: "Url of the link"
|
|
23
23
|
}),
|
|
24
|
-
|
|
24
|
+
title: text("Description", {
|
|
25
25
|
optional: true,
|
|
26
26
|
help: "Text to display inside the link element"
|
|
27
27
|
}),
|
|
@@ -47,7 +47,7 @@ function UrlPickerForm({ options, onConfirm, onCancel }) {
|
|
|
47
47
|
type: "url",
|
|
48
48
|
ref: "url",
|
|
49
49
|
url: data.url,
|
|
50
|
-
|
|
50
|
+
title: data.title || "",
|
|
51
51
|
target: data.blank ? "_blank" : "_self"
|
|
52
52
|
};
|
|
53
53
|
onConfirm([reference]);
|
|
@@ -17,7 +17,7 @@ function urlPicker(options) {
|
|
|
17
17
|
return {
|
|
18
18
|
shape: new RecordShape("Url", {
|
|
19
19
|
url: new ScalarShape("Url"),
|
|
20
|
-
|
|
20
|
+
title: new ScalarShape("Title"),
|
|
21
21
|
target: new ScalarShape("Target")
|
|
22
22
|
}).concat(extra),
|
|
23
23
|
hint: Hint.Extern({ name: "UrlReference", package: "alinea/picker/url" }),
|
|
@@ -18,7 +18,7 @@ var styles = fromModule(UrlPickerRow_module_default);
|
|
|
18
18
|
function UrlPickerRow({ reference }) {
|
|
19
19
|
return /* @__PURE__ */ jsxs(HStack, { gap: 15, className: styles.root(), children: [
|
|
20
20
|
/* @__PURE__ */ jsx("span", { className: styles.root.url(), children: reference.url }),
|
|
21
|
-
/* @__PURE__ */ jsx("span", { className: styles.root.desc(), children: reference.
|
|
21
|
+
/* @__PURE__ */ jsx("span", { className: styles.root.desc(), children: reference.title })
|
|
22
22
|
] });
|
|
23
23
|
}
|
|
24
24
|
export {
|
package/dist/ui/Typo.d.ts
CHANGED
|
@@ -18,6 +18,10 @@ export declare const Typo: (({ children, align }: import("react").PropsWithChild
|
|
|
18
18
|
flat?: boolean | undefined;
|
|
19
19
|
light?: boolean | undefined;
|
|
20
20
|
}, "h4">;
|
|
21
|
+
H5: import("./util/PropsWithAs").ComponentWithAs<{
|
|
22
|
+
flat?: boolean | undefined;
|
|
23
|
+
light?: boolean | undefined;
|
|
24
|
+
}, "h5">;
|
|
21
25
|
P: import("./util/PropsWithAs").ComponentWithAs<{
|
|
22
26
|
flat?: boolean | undefined;
|
|
23
27
|
light?: boolean | undefined;
|
package/dist/ui/Typo.js
CHANGED
|
@@ -2,12 +2,13 @@ import { ComponentType, HTMLProps, PropsWithChildren } from 'react';
|
|
|
2
2
|
import { GenericStyles, Styler } from './Styler.js';
|
|
3
3
|
type TypoStyles = {
|
|
4
4
|
root: Styler;
|
|
5
|
-
h1: Styler;
|
|
6
5
|
link: Styler;
|
|
7
6
|
small: Styler;
|
|
7
|
+
h1: Styler;
|
|
8
8
|
h2: Styler;
|
|
9
9
|
h3: Styler;
|
|
10
10
|
h4: Styler;
|
|
11
|
+
h5: Styler;
|
|
11
12
|
p: Styler;
|
|
12
13
|
hyphenate: Styler;
|
|
13
14
|
monospace: Styler;
|
|
@@ -31,6 +32,10 @@ export declare function createTypo(styles: TypoStyles, InternalLink?: ComponentT
|
|
|
31
32
|
flat?: boolean | undefined;
|
|
32
33
|
light?: boolean | undefined;
|
|
33
34
|
}, "h4">;
|
|
35
|
+
H5: import("./PropsWithAs.js").ComponentWithAs<{
|
|
36
|
+
flat?: boolean | undefined;
|
|
37
|
+
light?: boolean | undefined;
|
|
38
|
+
}, "h5">;
|
|
34
39
|
P: import("./PropsWithAs.js").ComponentWithAs<{
|
|
35
40
|
flat?: boolean | undefined;
|
|
36
41
|
light?: boolean | undefined;
|
|
@@ -65,6 +65,18 @@ function createTypo(styles, InternalLink) {
|
|
|
65
65
|
}
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
|
+
function H5Component(props, ref) {
|
|
69
|
+
const { as: Type = "h5", flat, light, ...rest } = props;
|
|
70
|
+
return /* @__PURE__ */ jsx(
|
|
71
|
+
Type,
|
|
72
|
+
{
|
|
73
|
+
ref,
|
|
74
|
+
id: idFor(rest.children),
|
|
75
|
+
...rest,
|
|
76
|
+
className: styles.h5.mergeProps(rest)({ flat, light })
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
68
80
|
function PComponent(props, ref) {
|
|
69
81
|
const { as: Type = "p", flat, light, ...rest } = props;
|
|
70
82
|
return /* @__PURE__ */ jsx(
|
|
@@ -109,6 +121,7 @@ function createTypo(styles, InternalLink) {
|
|
|
109
121
|
H2: forwardRefWithAs(H2Component),
|
|
110
122
|
H3: forwardRefWithAs(H3Component),
|
|
111
123
|
H4: forwardRefWithAs(H4Component),
|
|
124
|
+
H5: forwardRefWithAs(H5Component),
|
|
112
125
|
P: forwardRefWithAs(PComponent),
|
|
113
126
|
Link: LinkComponent,
|
|
114
127
|
link: styles.link,
|