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.
Files changed (96) hide show
  1. package/dist/.init/content/pages/welcome.json +1 -1
  2. package/dist/LICENSES.md +64 -64
  3. package/dist/adapter/next/previews.js +0 -2
  4. package/dist/bundled.d.ts +16 -5
  5. package/dist/chunks/{chunk-7IOKMUKO.js → chunk-6P4UVRPH.js} +1 -1
  6. package/dist/cli/Serve.js +1 -1
  7. package/dist/cli/bin.js +1 -1
  8. package/dist/cloud/CloudRemote.js +1 -1
  9. package/dist/components/Calendar.js +7 -7
  10. package/dist/components/Checkbox.js +3 -3
  11. package/dist/components/ColorSwatchPicker.js +2 -2
  12. package/dist/components/ComboBox.js +13 -13
  13. package/dist/components/DateField.js +3 -3
  14. package/dist/components/DatePicker.js +2 -2
  15. package/dist/components/DateRangePicker.js +7 -7
  16. package/dist/components/Disclosure.js +8 -8
  17. package/dist/components/Label.js +5 -5
  18. package/dist/components/List.js +52 -50
  19. package/dist/components/Menu.js +3 -3
  20. package/dist/components/Modal.js +2 -2
  21. package/dist/components/MultipleSelect.js +23 -23
  22. package/dist/components/NumberField.js +3 -3
  23. package/dist/components/ProgressCircle.js +4 -4
  24. package/dist/components/SearchField.js +9 -9
  25. package/dist/components/Select.js +8 -8
  26. package/dist/components/Surface.js +2 -2
  27. package/dist/components/Table.js +3 -3
  28. package/dist/components/Tabs.js +3 -3
  29. package/dist/components/TagGroup.js +3 -3
  30. package/dist/components/TextField.js +6 -6
  31. package/dist/components/TimeField.js +3 -3
  32. package/dist/components/Toolbar.js +2 -2
  33. package/dist/components/Tooltip.js +1 -1
  34. package/dist/components/Tree.js +6 -6
  35. package/dist/core/TextDoc.d.ts +1 -0
  36. package/dist/core/field/RichTextField.js +3 -3
  37. package/dist/dashboard/App.js +4 -2
  38. package/dist/dashboard/app/AccessDenied.js +4 -4
  39. package/dist/dashboard/app/ActivityStatus.js +14 -14
  40. package/dist/dashboard/app/AuthView.js +13 -13
  41. package/dist/dashboard/app/Badge.js +2 -2
  42. package/dist/dashboard/app/CompactField.js +9 -9
  43. package/dist/dashboard/app/DashboardErrorBoundary.js +6 -6
  44. package/dist/dashboard/app/DashboardLayout.js +6 -5
  45. package/dist/dashboard/app/EntryFields.js +2 -2
  46. package/dist/dashboard/app/EntryHeader.js +10 -10
  47. package/dist/dashboard/app/EntryReferences.js +8 -13
  48. package/dist/dashboard/app/EntrySidebar.js +27 -13
  49. package/dist/dashboard/app/EntrySidebarPreview.js +12 -12
  50. package/dist/dashboard/app/EntryTranslationBanner.js +5 -5
  51. package/dist/dashboard/app/Explorer.js +44 -44
  52. package/dist/dashboard/app/ExplorerCards.js +31 -31
  53. package/dist/dashboard/app/ExplorerFileCard.js +17 -17
  54. package/dist/dashboard/app/ExplorerList.js +12 -12
  55. package/dist/dashboard/app/ExplorerModal.js +4 -4
  56. package/dist/dashboard/app/ExplorerTable.js +44 -44
  57. package/dist/dashboard/app/LinkPicker.js +5 -5
  58. package/dist/dashboard/app/LocaleMenu.js +4 -4
  59. package/dist/dashboard/app/SidebarTree.js +40 -40
  60. package/dist/dashboard/app/WorkspaceMenu.js +14 -14
  61. package/dist/dashboard/app/WorkspaceRoots.js +22 -22
  62. package/dist/dashboard/app/editor/FileEditor.js +26 -26
  63. package/dist/dashboard/app/editor/FilePreview.js +5 -5
  64. package/dist/dashboard/app/modals/CreateEntry.js +5 -5
  65. package/dist/dashboard/app/pages/EntryPage.js +20 -20
  66. package/dist/dashboard/app/pages/SplashPage.js +45 -45
  67. package/dist/dashboard/app/pages/UsersPage.js +34 -34
  68. package/dist/dashboard/app/ui/DashboardModal.js +19 -19
  69. package/dist/dashboard/app/ui/Rail.js +3 -3
  70. package/dist/dashboard/app/ui/Sidebar.js +2 -2
  71. package/dist/dashboard/atoms/dashboard.js +2 -1
  72. package/dist/dashboard/atoms/editor.js +7 -0
  73. package/dist/dashboard/atoms/entry.d.ts +2 -4
  74. package/dist/dashboard/atoms/entry.js +8 -3
  75. package/dist/dashboard/atoms/root.d.ts +1 -0
  76. package/dist/dashboard/atoms/root.js +61 -35
  77. package/dist/dashboard/boot/Boot.js +7 -5
  78. package/dist/field/check/CheckField.view.js +2 -2
  79. package/dist/field/code/CodeField.view.js +12 -12
  80. package/dist/field/link/FileLink.js +1 -7
  81. package/dist/field/link/LinkField.view.js +35 -35
  82. package/dist/field/list/ListField.d.ts +5 -0
  83. package/dist/field/list/ListField.stories.d.ts +1 -0
  84. package/dist/field/list/ListField.view.js +59 -47
  85. package/dist/field/metadata/MetadataField.view.js +18 -18
  86. package/dist/field/richtext/PickTextLink.d.ts +3 -1
  87. package/dist/field/richtext/PickTextLink.js +7 -6
  88. package/dist/field/richtext/RichTextBlock.js +2 -2
  89. package/dist/field/richtext/RichTextDocument.js +8 -1
  90. package/dist/field/richtext/RichTextExtensions.js +23 -23
  91. package/dist/field/richtext/RichTextField.d.ts +3 -0
  92. package/dist/field/richtext/RichTextField.view.js +5 -5
  93. package/dist/field/richtext/RichTextInsertMenu.js +3 -3
  94. package/dist/index.css +17 -6
  95. package/dist/ui/RichText.js +33 -18
  96. 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
- min-height: auto;
1571
+ gap: 6px;
1573
1572
  margin-bottom: 8px;
1574
- margin-left: -8px;
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;
@@ -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
- const wrappers = marks?.map((mark) => ({
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 { [Node.type]: type, [ElementNode.content]: content, ...attrs } = node;
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 /* @__PURE__ */ jsx(Component, { ...element?.props, children: inner });
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 /* @__PURE__ */ jsx(el.type, { ...element?.props, ...el.props, children: inner });
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alinea",
3
- "version": "2.0.0-preview.6",
3
+ "version": "2.0.0-preview.7",
4
4
  "description": "Headless git-based CMS",
5
5
  "repository": "github:alineacms/alinea",
6
6
  "license": "MIT",