alinea 2.0.0-preview.6 → 2.0.0-preview.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/.init/content/pages/welcome.json +1 -1
- package/dist/LICENSES.md +64 -64
- package/dist/adapter/next/previews.js +0 -2
- package/dist/bundled.d.ts +16 -5
- package/dist/chunks/{chunk-7IOKMUKO.js → chunk-6P4UVRPH.js} +1 -1
- package/dist/cli/Serve.js +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cloud/CloudRemote.js +1 -1
- package/dist/components/Calendar.js +7 -7
- package/dist/components/Checkbox.js +3 -3
- package/dist/components/ColorSwatchPicker.js +2 -2
- package/dist/components/ComboBox.js +13 -13
- package/dist/components/DateField.js +3 -3
- package/dist/components/DatePicker.js +2 -2
- package/dist/components/DateRangePicker.js +7 -7
- package/dist/components/Disclosure.js +8 -8
- package/dist/components/Label.js +5 -5
- package/dist/components/List.js +52 -50
- package/dist/components/Menu.js +3 -3
- package/dist/components/Modal.js +2 -2
- package/dist/components/MultipleSelect.js +23 -23
- package/dist/components/NumberField.js +3 -3
- package/dist/components/ProgressCircle.js +4 -4
- package/dist/components/SearchField.js +9 -9
- package/dist/components/Select.js +8 -8
- package/dist/components/Surface.js +2 -2
- package/dist/components/Table.js +3 -3
- package/dist/components/Tabs.js +3 -3
- package/dist/components/TagGroup.js +3 -3
- package/dist/components/TextField.js +6 -6
- package/dist/components/TimeField.js +3 -3
- package/dist/components/Toolbar.js +2 -2
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/Tree.js +6 -6
- package/dist/core/TextDoc.d.ts +1 -0
- package/dist/core/field/RichTextField.js +3 -3
- package/dist/dashboard/App.js +4 -2
- package/dist/dashboard/app/AccessDenied.js +4 -4
- package/dist/dashboard/app/ActivityStatus.js +14 -14
- package/dist/dashboard/app/AuthView.js +13 -13
- package/dist/dashboard/app/Badge.js +2 -2
- package/dist/dashboard/app/CompactField.js +9 -9
- package/dist/dashboard/app/DashboardErrorBoundary.js +6 -6
- package/dist/dashboard/app/DashboardLayout.js +6 -5
- package/dist/dashboard/app/EntryFields.js +2 -2
- package/dist/dashboard/app/EntryHeader.js +10 -10
- package/dist/dashboard/app/EntryReferences.js +8 -13
- package/dist/dashboard/app/EntrySidebar.js +27 -13
- package/dist/dashboard/app/EntrySidebarPreview.js +12 -12
- package/dist/dashboard/app/EntryTranslationBanner.js +5 -5
- package/dist/dashboard/app/Explorer.js +44 -44
- package/dist/dashboard/app/ExplorerCards.js +31 -31
- package/dist/dashboard/app/ExplorerFileCard.js +17 -17
- package/dist/dashboard/app/ExplorerList.js +12 -12
- package/dist/dashboard/app/ExplorerModal.js +4 -4
- package/dist/dashboard/app/ExplorerTable.js +44 -44
- package/dist/dashboard/app/LinkPicker.js +5 -5
- package/dist/dashboard/app/LocaleMenu.js +4 -4
- package/dist/dashboard/app/SidebarTree.js +40 -40
- package/dist/dashboard/app/WorkspaceMenu.js +14 -14
- package/dist/dashboard/app/WorkspaceRoots.js +22 -22
- package/dist/dashboard/app/editor/FileEditor.js +26 -26
- package/dist/dashboard/app/editor/FilePreview.js +5 -5
- package/dist/dashboard/app/modals/CreateEntry.js +5 -5
- package/dist/dashboard/app/pages/EntryPage.js +20 -20
- package/dist/dashboard/app/pages/SplashPage.js +45 -45
- package/dist/dashboard/app/pages/UsersPage.js +34 -34
- package/dist/dashboard/app/ui/DashboardModal.js +19 -19
- package/dist/dashboard/app/ui/Rail.js +3 -3
- package/dist/dashboard/app/ui/Sidebar.js +2 -2
- package/dist/dashboard/atoms/dashboard.js +2 -1
- package/dist/dashboard/atoms/editor.js +7 -0
- package/dist/dashboard/atoms/entry.d.ts +2 -4
- package/dist/dashboard/atoms/entry.js +8 -3
- package/dist/dashboard/atoms/root.d.ts +1 -0
- package/dist/dashboard/atoms/root.js +61 -35
- package/dist/dashboard/boot/Boot.js +7 -5
- package/dist/field/check/CheckField.view.js +2 -2
- package/dist/field/code/CodeField.view.js +12 -12
- package/dist/field/link/FileLink.js +1 -7
- package/dist/field/link/LinkField.view.js +35 -35
- package/dist/field/list/ListField.d.ts +5 -0
- package/dist/field/list/ListField.stories.d.ts +1 -0
- package/dist/field/list/ListField.view.js +59 -47
- package/dist/field/metadata/MetadataField.view.js +18 -18
- package/dist/field/richtext/PickTextLink.d.ts +3 -1
- package/dist/field/richtext/PickTextLink.js +7 -6
- package/dist/field/richtext/RichTextBlock.js +2 -2
- package/dist/field/richtext/RichTextDocument.js +8 -1
- package/dist/field/richtext/RichTextExtensions.js +23 -23
- package/dist/field/richtext/RichTextField.d.ts +3 -0
- package/dist/field/richtext/RichTextField.view.js +5 -5
- package/dist/field/richtext/RichTextInsertMenu.js +3 -3
- package/dist/index.css +17 -6
- package/dist/ui/RichText.js +33 -18
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -1566,17 +1566,23 @@
|
|
|
1566
1566
|
}
|
|
1567
1567
|
.alinea-ListLabel {
|
|
1568
1568
|
color: var(--alinea-fg-muted);
|
|
1569
|
-
border: none;
|
|
1570
1569
|
flex-wrap: wrap;
|
|
1571
1570
|
align-items: flex-start;
|
|
1572
|
-
|
|
1571
|
+
gap: 6px;
|
|
1573
1572
|
margin-bottom: 8px;
|
|
1574
|
-
|
|
1573
|
+
padding-block: 4px;
|
|
1574
|
+
display: flex;
|
|
1575
|
+
}
|
|
1576
|
+
.alinea-ListLabel .alinea-ListLabel-toggle {
|
|
1577
|
+
color: inherit;
|
|
1578
|
+
border: none;
|
|
1579
|
+
min-height: auto;
|
|
1580
|
+
margin-inline: -8px;
|
|
1575
1581
|
padding-block: 0;
|
|
1576
1582
|
}
|
|
1577
|
-
.alinea-ListLabel[data-hovered],
|
|
1578
|
-
.alinea-ListLabel[data-pressed],
|
|
1579
|
-
.alinea-ListLabel[data-active] {
|
|
1583
|
+
.alinea-ListLabel .alinea-ListLabel-toggle[data-hovered],
|
|
1584
|
+
.alinea-ListLabel .alinea-ListLabel-toggle[data-pressed],
|
|
1585
|
+
.alinea-ListLabel .alinea-ListLabel-toggle[data-active] {
|
|
1580
1586
|
background: none;
|
|
1581
1587
|
}
|
|
1582
1588
|
.alinea-ListError {
|
|
@@ -4437,6 +4443,11 @@
|
|
|
4437
4443
|
.alinea-EntrySidebar-disclosurePanel {
|
|
4438
4444
|
padding-top: 10px;
|
|
4439
4445
|
}
|
|
4446
|
+
.alinea-EntrySidebar-loading {
|
|
4447
|
+
justify-content: center;
|
|
4448
|
+
padding: 12px 0;
|
|
4449
|
+
display: flex;
|
|
4450
|
+
}
|
|
4440
4451
|
.alinea-EntrySidebar-previewPanel {
|
|
4441
4452
|
flex-direction: column;
|
|
4442
4453
|
flex: 1;
|
package/dist/ui/RichText.js
CHANGED
|
@@ -92,12 +92,14 @@ function defaultNodeElement(type, attributes, content) {
|
|
|
92
92
|
const href = attributes?.href;
|
|
93
93
|
const target = attributes?.target;
|
|
94
94
|
const title = attributes?.title;
|
|
95
|
+
const rel = attributes?.rel;
|
|
95
96
|
return /* @__PURE__ */ jsx(
|
|
96
97
|
"a",
|
|
97
98
|
{
|
|
98
99
|
href: typeof href === "string" ? href : void 0,
|
|
99
100
|
target: typeof target === "string" ? target : void 0,
|
|
100
|
-
title: typeof title === "string" ? title : void 0
|
|
101
|
+
title: typeof title === "string" ? title : void 0,
|
|
102
|
+
rel: typeof rel === "string" ? rel : void 0
|
|
101
103
|
}
|
|
102
104
|
);
|
|
103
105
|
}
|
|
@@ -143,37 +145,50 @@ function textAlignAttribute(value) {
|
|
|
143
145
|
function isComponentView(view) {
|
|
144
146
|
return Boolean(view) && !isValidElement(view);
|
|
145
147
|
}
|
|
148
|
+
function renderMarks(content, marks, views) {
|
|
149
|
+
return (marks ?? []).reduce((children, mark) => {
|
|
150
|
+
const element = nodeElement(mark[Mark.type], mark);
|
|
151
|
+
if (!element?.type) return children;
|
|
152
|
+
const View = views[String(element.type)];
|
|
153
|
+
if (isComponentView(View)) {
|
|
154
|
+
const Component = View;
|
|
155
|
+
return /* @__PURE__ */ jsx(Component, { ...element.props, children });
|
|
156
|
+
}
|
|
157
|
+
const view = View ?? element;
|
|
158
|
+
return /* @__PURE__ */ jsx(view.type, { ...element.props, ...view.props, children });
|
|
159
|
+
}, content);
|
|
160
|
+
}
|
|
146
161
|
function RichTextNodeView({ views, node }) {
|
|
147
162
|
if (Node.isText(node)) {
|
|
148
163
|
const { [TextNode.text]: text, [TextNode.marks]: marks } = node;
|
|
149
164
|
const TextView = views.text;
|
|
150
165
|
const content = typeof TextView === "function" ? /* @__PURE__ */ jsx(TextView, { children: text }) : text ?? "";
|
|
151
|
-
|
|
152
|
-
type: mark[Mark.type],
|
|
153
|
-
element: nodeElement(mark[Mark.type], mark)
|
|
154
|
-
}));
|
|
155
|
-
return (wrappers ?? []).reduce((children, { element }) => {
|
|
156
|
-
if (!element?.type) return children;
|
|
157
|
-
const View = views[String(element.type)];
|
|
158
|
-
if (isComponentView(View)) {
|
|
159
|
-
const Component = View;
|
|
160
|
-
return /* @__PURE__ */ jsx(Component, { ...element.props, children });
|
|
161
|
-
}
|
|
162
|
-
const view = View ?? element;
|
|
163
|
-
return /* @__PURE__ */ jsx(view.type, { ...element.props, ...view.props, children });
|
|
164
|
-
}, content);
|
|
166
|
+
return renderMarks(content, marks, views);
|
|
165
167
|
}
|
|
166
168
|
if (Node.isElement(node)) {
|
|
167
|
-
const {
|
|
169
|
+
const {
|
|
170
|
+
[Node.type]: type,
|
|
171
|
+
[ElementNode.content]: content,
|
|
172
|
+
marks,
|
|
173
|
+
...attrs
|
|
174
|
+
} = node;
|
|
168
175
|
const element = nodeElement(type, attrs, content);
|
|
169
176
|
const View = type === "table" ? views.table : element?.type ? views[String(element.type)] : void 0;
|
|
170
177
|
const inner = content?.map((node2, i) => /* @__PURE__ */ jsx(RichTextNodeView, { views, node: node2 }, i)) ?? null;
|
|
171
178
|
if (isComponentView(View)) {
|
|
172
179
|
const Component = View;
|
|
173
|
-
return
|
|
180
|
+
return renderMarks(
|
|
181
|
+
/* @__PURE__ */ jsx(Component, { ...element?.props, children: inner }),
|
|
182
|
+
marks,
|
|
183
|
+
views
|
|
184
|
+
);
|
|
174
185
|
}
|
|
175
186
|
const el = View ?? element ?? { type: Fragment, props: {} };
|
|
176
|
-
return
|
|
187
|
+
return renderMarks(
|
|
188
|
+
/* @__PURE__ */ jsx(el.type, { ...element?.props, ...el.props, children: inner }),
|
|
189
|
+
marks,
|
|
190
|
+
views
|
|
191
|
+
);
|
|
177
192
|
}
|
|
178
193
|
if (Node.isBlock(node)) {
|
|
179
194
|
const { [Node.type]: type, [BlockNode.id]: id, ...attrs } = node;
|