alinea 2.0.0-preview.4 → 2.0.0-preview.6

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 (187) hide show
  1. package/dist/.init/content/pages/welcome.json +1 -1
  2. package/dist/.init/src/cms.ts +1 -4
  3. package/dist/LICENSES.md +137 -137
  4. package/dist/adapter/next/cms.js +5 -1
  5. package/dist/adapter/next/handler.js +35 -6
  6. package/dist/adapter/next/previews.js +7 -1
  7. package/dist/adapter/next/syncCheck.d.ts +12 -0
  8. package/dist/adapter/next/syncCheck.js +59 -0
  9. package/dist/adapter/next/with-alinea.d.ts +0 -8
  10. package/dist/adapter/next/with-alinea.js +43 -19
  11. package/dist/adapter/vite/plugin.js +9 -4
  12. package/dist/backend/Handler.js +106 -0
  13. package/dist/backend/api/GithubApi.js +16 -7
  14. package/dist/backend/api/ProxyMedia.d.ts +3 -0
  15. package/dist/backend/api/ProxyMedia.js +39 -0
  16. package/dist/backend/api/S3Uploads.d.ts +1 -1
  17. package/dist/backend/router/Router.js +2 -0
  18. package/dist/backend/util/Syncable.js +1 -1
  19. package/dist/bundled.d.ts +166 -73
  20. package/dist/chunks/{chunk-XMOVGDFI.js → chunk-7IOKMUKO.js} +1 -1
  21. package/dist/chunks/{chunk-O7XWTMCB.js → chunk-D6RGFNUW.js} +73 -72
  22. package/dist/chunks/{chunk-VXZM6V4P.js → chunk-OFEKTDRF.js} +41 -41
  23. package/dist/cli/Generate.js +3 -4
  24. package/dist/cli/Serve.js +3 -2
  25. package/dist/cli/bin.js +1 -1
  26. package/dist/cli/generate/FillCache.d.ts +1 -1
  27. package/dist/cli/generate/FillCache.js +20 -9
  28. package/dist/cli/generate/GenerateDashboard.js +1 -0
  29. package/dist/cli/serve/CreateLocalServer.d.ts +1 -1
  30. package/dist/cli/serve/CreateLocalServer.js +42 -34
  31. package/dist/cli/serve/DevServer.js +1 -0
  32. package/dist/cli/static/init/cms.js +1 -4
  33. package/dist/cli/util/ContentType.d.ts +1 -0
  34. package/dist/cli/util/ContentType.js +36 -0
  35. package/dist/cli/util/Emitter.js +1 -1
  36. package/dist/cloud/CloudHandshake.d.ts +6 -0
  37. package/dist/cloud/CloudHandshake.js +67 -10
  38. package/dist/cloud/CloudRemote.js +24 -11
  39. package/dist/components/Breadcrumbs.js +7 -7
  40. package/dist/components/Button.js +5 -5
  41. package/dist/components/Calendar.js +7 -7
  42. package/dist/components/Checkbox.js +8 -8
  43. package/dist/components/CheckboxGroup.js +5 -5
  44. package/dist/components/ColorSwatch.js +5 -5
  45. package/dist/components/ColorSwatchPicker.js +7 -7
  46. package/dist/components/ComboBox.js +14 -14
  47. package/dist/components/DateField.js +8 -8
  48. package/dist/components/DatePicker.js +10 -10
  49. package/dist/components/DateRangePicker.js +11 -11
  50. package/dist/components/Dialog.js +5 -5
  51. package/dist/components/Disclosure.js +11 -11
  52. package/dist/components/DropZone.js +5 -5
  53. package/dist/components/Label.js +9 -9
  54. package/dist/components/Link.js +5 -5
  55. package/dist/components/List.d.ts +1 -1
  56. package/dist/components/List.js +37 -36
  57. package/dist/components/Menu.js +9 -9
  58. package/dist/components/Modal.js +8 -8
  59. package/dist/components/MultipleSelect.js +33 -33
  60. package/dist/components/NumberField.js +11 -11
  61. package/dist/components/Popover.js +5 -5
  62. package/dist/components/ProgressCircle.js +8 -8
  63. package/dist/components/RadioGroup.js +7 -7
  64. package/dist/components/SearchField.js +10 -10
  65. package/dist/components/Select.js +12 -12
  66. package/dist/components/Surface.js +3 -3
  67. package/dist/components/Switch.js +7 -7
  68. package/dist/components/Table.js +11 -11
  69. package/dist/components/Tabs.js +9 -9
  70. package/dist/components/TagGroup.js +7 -7
  71. package/dist/components/TextField.js +10 -10
  72. package/dist/components/TimeField.js +5 -5
  73. package/dist/components/Toggle.js +5 -5
  74. package/dist/components/Toolbar.js +6 -6
  75. package/dist/components/Tooltip.js +8 -8
  76. package/dist/components/Tree.js +13 -13
  77. package/dist/core/Config.d.ts +10 -3
  78. package/dist/core/Config.js +16 -1
  79. package/dist/core/Graph.d.ts +2 -2
  80. package/dist/core/Role.js +16 -14
  81. package/dist/core/TextDoc.d.ts +2 -0
  82. package/dist/core/TextDoc.js +1 -0
  83. package/dist/core/Workspace.d.ts +6 -5
  84. package/dist/core/db/EntryIndex.d.ts +3 -0
  85. package/dist/core/db/EntryIndex.js +55 -0
  86. package/dist/core/db/EntryTransaction.js +34 -32
  87. package/dist/core/db/EntryUrlConflictError.js +1 -1
  88. package/dist/core/db/LinkResolver.d.ts +8 -2
  89. package/dist/core/db/LinkResolver.js +27 -5
  90. package/dist/core/field/RichTextField.js +16 -10
  91. package/dist/core/media/MediaLocation.d.ts +9 -15
  92. package/dist/core/media/MediaLocation.js +29 -19
  93. package/dist/core/media/MediaTypes.js +1 -2
  94. package/dist/dashboard/App.js +4 -4
  95. package/dist/dashboard/app/ActivityStatus.js +31 -37
  96. package/dist/dashboard/app/AppShell.js +2 -2
  97. package/dist/dashboard/app/AuthView.js +12 -12
  98. package/dist/dashboard/app/Badge.js +2 -2
  99. package/dist/dashboard/app/CompactField.js +9 -9
  100. package/dist/dashboard/app/DashboardErrorBoundary.js +6 -6
  101. package/dist/dashboard/app/EntryFields.d.ts +3 -1
  102. package/dist/dashboard/app/EntryFields.js +11 -8
  103. package/dist/dashboard/app/EntryHeader.js +116 -84
  104. package/dist/dashboard/app/EntryHeaderActions.d.ts +21 -4
  105. package/dist/dashboard/app/EntryHeaderActions.js +48 -27
  106. package/dist/dashboard/app/EntryReferences.js +6 -6
  107. package/dist/dashboard/app/EntrySidebar.js +15 -15
  108. package/dist/dashboard/app/EntrySidebarPreview.js +4 -4
  109. package/dist/dashboard/app/EntryTranslationBanner.d.ts +3 -1
  110. package/dist/dashboard/app/EntryTranslationBanner.js +23 -20
  111. package/dist/dashboard/app/Explorer.d.ts +4 -2
  112. package/dist/dashboard/app/Explorer.js +53 -49
  113. package/dist/dashboard/app/ExplorerCards.js +31 -31
  114. package/dist/dashboard/app/ExplorerFileCard.js +16 -16
  115. package/dist/dashboard/app/ExplorerList.js +14 -15
  116. package/dist/dashboard/app/ExplorerModal.js +4 -4
  117. package/dist/dashboard/app/ExplorerTable.js +54 -54
  118. package/dist/dashboard/app/LinkPicker.js +5 -5
  119. package/dist/dashboard/app/LocaleMenu.d.ts +7 -0
  120. package/dist/dashboard/app/LocaleMenu.js +34 -18
  121. package/dist/dashboard/app/ReadOnlyBadge.d.ts +4 -0
  122. package/dist/dashboard/app/ReadOnlyBadge.js +33 -0
  123. package/dist/dashboard/app/SidebarTree.d.ts +3 -6
  124. package/dist/dashboard/app/SidebarTree.js +62 -57
  125. package/dist/dashboard/app/WorkspaceMenu.js +16 -16
  126. package/dist/dashboard/app/WorkspaceRoots.js +21 -21
  127. package/dist/dashboard/app/editor/FileEditor.d.ts +2 -3
  128. package/dist/dashboard/app/editor/FileEditor.js +24 -27
  129. package/dist/dashboard/app/editor/FilePreview.js +4 -4
  130. package/dist/dashboard/app/modals/CreateEntry.js +5 -5
  131. package/dist/dashboard/app/pages/EntryPage.js +72 -29
  132. package/dist/dashboard/app/pages/RootPage.js +3 -3
  133. package/dist/dashboard/app/pages/SplashPage.js +45 -45
  134. package/dist/dashboard/app/pages/UsersPage.js +36 -36
  135. package/dist/dashboard/app/ui/DashboardModal.js +21 -21
  136. package/dist/dashboard/app/ui/Rail.js +5 -5
  137. package/dist/dashboard/app/ui/Sidebar.js +2 -2
  138. package/dist/dashboard/atoms/activity.d.ts +0 -2
  139. package/dist/dashboard/atoms/activity.js +4 -10
  140. package/dist/dashboard/atoms/editor.d.ts +2 -1
  141. package/dist/dashboard/atoms/editor.js +4 -2
  142. package/dist/dashboard/atoms/entry.d.ts +2 -0
  143. package/dist/dashboard/atoms/entry.js +32 -14
  144. package/dist/dashboard/atoms/explorer.d.ts +4 -3
  145. package/dist/dashboard/atoms/explorer.js +61 -22
  146. package/dist/dashboard/atoms/link.d.ts +1 -1
  147. package/dist/dashboard/atoms/link.js +39 -55
  148. package/dist/dashboard/atoms/root.d.ts +7 -2
  149. package/dist/dashboard/atoms/root.js +51 -16
  150. package/dist/dashboard/atoms/upload.d.ts +1 -0
  151. package/dist/dashboard/atoms/upload.js +2 -1
  152. package/dist/dashboard/boot/ActivityEvent.d.ts +1 -1
  153. package/dist/dashboard/boot/DashboardWorker.js +2 -28
  154. package/dist/dashboard/fixture/cms.js +1 -4
  155. package/dist/dashboard/hook/UseSaveShortcut.d.ts +1 -0
  156. package/dist/dashboard/hook/UseSaveShortcut.js +24 -0
  157. package/dist/dashboard/hooks.d.ts +1 -1
  158. package/dist/dashboard/hooks.js +12 -3
  159. package/dist/field/check/CheckField.view.js +2 -2
  160. package/dist/field/code/CodeField.view.js +11 -11
  161. package/dist/field/date/DateField.view.js +5 -5
  162. package/dist/field/link/ImageLink.js +1 -3
  163. package/dist/field/link/LinkField.view.js +88 -62
  164. package/dist/field/list/ListField.view.js +25 -25
  165. package/dist/field/metadata/MetadataField.d.ts +3 -3
  166. package/dist/field/metadata/MetadataField.view.js +27 -20
  167. package/dist/field/object/ObjectField.view.js +11 -4
  168. package/dist/field/richtext/PickTextLink.js +5 -2
  169. package/dist/field/richtext/ReferenceLink.d.ts +2 -0
  170. package/dist/field/richtext/ReferenceLink.js +5 -0
  171. package/dist/field/richtext/RichTextBlock.js +2 -2
  172. package/dist/field/richtext/RichTextExtensions.js +24 -24
  173. package/dist/field/richtext/RichTextField.view.js +2 -2
  174. package/dist/field/richtext/RichTextInsertMenu.js +3 -3
  175. package/dist/field/richtext/extensions/Link.d.ts +1 -0
  176. package/dist/field/richtext/extensions/Link.js +1 -0
  177. package/dist/field/select/SelectField.view.js +1 -1
  178. package/dist/field/time/TimeField.d.ts +0 -2
  179. package/dist/field/time/TimeField.view.js +1 -1
  180. package/dist/index.css +44 -38
  181. package/dist/next.cjs +96 -19
  182. package/dist/picker/entry/EntryPicker.js +10 -12
  183. package/dist/picker/entry/EntryReference.d.ts +2 -0
  184. package/dist/picker/entry/EntryReference.js +1 -0
  185. package/dist/types.d.ts +0 -1
  186. package/package.json +1 -1
  187. package/dist/chunks/{chunk-6V4TAD2N.js → chunk-DNJX6CRV.js} +4 -4
@@ -6,17 +6,17 @@ import {
6
6
  $76d00c5a4edb230a$export$f6f0c3fe4ec306ea,
7
7
  $76d00c5a4edb230a$export$f850895b287ef28e,
8
8
  $76d00c5a4edb230a$export$fddc468cd8cb4db9
9
- } from "../chunks/chunk-VXZM6V4P.js";
9
+ } from "../chunks/chunk-OFEKTDRF.js";
10
+ import "../chunks/chunk-NIVGVRDS.js";
11
+ import "../chunks/chunk-IYAQC63Y.js";
12
+ import "../chunks/chunk-DNJX6CRV.js";
13
+ import "../chunks/chunk-AC4U3IMS.js";
10
14
  import {
11
15
  $42ceafc619f9c3ba$export$fb8073518f34e6ec
12
- } from "../chunks/chunk-O7XWTMCB.js";
16
+ } from "../chunks/chunk-D6RGFNUW.js";
13
17
  import "../chunks/chunk-RKDPDEF7.js";
14
- import "../chunks/chunk-NIVGVRDS.js";
15
- import "../chunks/chunk-IYAQC63Y.js";
16
18
  import "../chunks/chunk-SJBZFMQ2.js";
17
- import "../chunks/chunk-6V4TAD2N.js";
18
19
  import "../chunks/chunk-S4AU6SRS.js";
19
- import "../chunks/chunk-AC4U3IMS.js";
20
20
  import {
21
21
  dist_default
22
22
  } from "../chunks/chunk-I4OYYAX5.js";
@@ -32,17 +32,17 @@ import { Surface } from "./Surface.js";
32
32
 
33
33
  // src/components/Table.module.css
34
34
  var Table_default = {
35
- "Column-label": "alinea-Column-label",
36
- "ColumnLabel": "alinea-Column-label",
37
35
  "Column": "alinea-Column",
36
+ "TableHeader": "alinea-TableHeader",
38
37
  "Column-sortIndicator": "alinea-Column-sortIndicator",
39
38
  "ColumnSortIndicator": "alinea-Column-sortIndicator",
39
+ "Table-table": "alinea-Table-table",
40
+ "TableTable": "alinea-Table-table",
40
41
  "Row": "alinea-Row",
41
42
  "TableBody": "alinea-TableBody",
42
43
  "Cell": "alinea-Cell",
43
- "Table-table": "alinea-Table-table",
44
- "TableTable": "alinea-Table-table",
45
- "TableHeader": "alinea-TableHeader",
44
+ "Column-label": "alinea-Column-label",
45
+ "ColumnLabel": "alinea-Column-label",
46
46
  "Table": "alinea-Table"
47
47
  };
48
48
 
@@ -3,15 +3,15 @@ import {
3
3
  $b4f18e3395fe64d7$export$3e41faf802a29e71,
4
4
  $b4f18e3395fe64d7$export$b2539bed5023c21c,
5
5
  $b4f18e3395fe64d7$export$e51a686c67fdaa2d
6
- } from "../chunks/chunk-VXZM6V4P.js";
7
- import "../chunks/chunk-O7XWTMCB.js";
8
- import "../chunks/chunk-RKDPDEF7.js";
6
+ } from "../chunks/chunk-OFEKTDRF.js";
9
7
  import "../chunks/chunk-NIVGVRDS.js";
10
8
  import "../chunks/chunk-IYAQC63Y.js";
9
+ import "../chunks/chunk-DNJX6CRV.js";
10
+ import "../chunks/chunk-AC4U3IMS.js";
11
+ import "../chunks/chunk-D6RGFNUW.js";
12
+ import "../chunks/chunk-RKDPDEF7.js";
11
13
  import "../chunks/chunk-SJBZFMQ2.js";
12
- import "../chunks/chunk-6V4TAD2N.js";
13
14
  import "../chunks/chunk-S4AU6SRS.js";
14
- import "../chunks/chunk-AC4U3IMS.js";
15
15
  import {
16
16
  dist_default
17
17
  } from "../chunks/chunk-I4OYYAX5.js";
@@ -19,12 +19,12 @@ import "../chunks/chunk-CQ52GEHY.js";
19
19
 
20
20
  // src/components/Tabs.module.css
21
21
  var Tabs_default = {
22
- "Tab": "alinea-Tab",
23
- "Tabs": "alinea-Tabs",
24
- "TabPanel": "alinea-TabPanel",
25
22
  "TabList-list": "alinea-TabList-list",
26
23
  "TabListList": "alinea-TabList-list",
27
- "TabList": "alinea-TabList"
24
+ "Tab": "alinea-Tab",
25
+ "TabList": "alinea-TabList",
26
+ "TabPanel": "alinea-TabPanel",
27
+ "Tabs": "alinea-Tabs"
28
28
  };
29
29
 
30
30
  // src/components/Tabs.tsx
@@ -3,15 +3,15 @@ import {
3
3
  $3df3ddf5bafbc7b1$export$67ea30858aaf75e3,
4
4
  $3df3ddf5bafbc7b1$export$f9fef0f55402315b,
5
5
  $7705c033048f6da7$export$353f5b6fc5456de1
6
- } from "../chunks/chunk-VXZM6V4P.js";
7
- import "../chunks/chunk-O7XWTMCB.js";
8
- import "../chunks/chunk-RKDPDEF7.js";
6
+ } from "../chunks/chunk-OFEKTDRF.js";
9
7
  import "../chunks/chunk-NIVGVRDS.js";
10
8
  import "../chunks/chunk-IYAQC63Y.js";
9
+ import "../chunks/chunk-DNJX6CRV.js";
10
+ import "../chunks/chunk-AC4U3IMS.js";
11
+ import "../chunks/chunk-D6RGFNUW.js";
12
+ import "../chunks/chunk-RKDPDEF7.js";
11
13
  import "../chunks/chunk-SJBZFMQ2.js";
12
- import "../chunks/chunk-6V4TAD2N.js";
13
14
  import "../chunks/chunk-S4AU6SRS.js";
14
- import "../chunks/chunk-AC4U3IMS.js";
15
15
  import {
16
16
  dist_default
17
17
  } from "../chunks/chunk-I4OYYAX5.js";
@@ -24,10 +24,10 @@ import { Label, labelProps } from "./Label.js";
24
24
 
25
25
  // src/components/TagGroup.module.css
26
26
  var TagGroup_default = {
27
+ "Tag": "alinea-Tag",
27
28
  "TagGroup": "alinea-TagGroup",
28
29
  "TagGroup-list": "alinea-TagGroup-list",
29
- "TagGroupList": "alinea-TagGroup-list",
30
- "Tag": "alinea-Tag"
30
+ "TagGroupList": "alinea-TagGroup-list"
31
31
  };
32
32
 
33
33
  // src/components/TagGroup.tsx
@@ -2,15 +2,15 @@ import {
2
2
  $41fb335299a4a39e$export$f5b8910cec6cf069,
3
3
  $b8dcdc58eeae0d40$export$2c73285ae9390cec,
4
4
  $bd263d78e9bf3c56$export$f5c9f3c2c4054eec
5
- } from "../chunks/chunk-VXZM6V4P.js";
6
- import "../chunks/chunk-O7XWTMCB.js";
7
- import "../chunks/chunk-RKDPDEF7.js";
5
+ } from "../chunks/chunk-OFEKTDRF.js";
8
6
  import "../chunks/chunk-NIVGVRDS.js";
9
7
  import "../chunks/chunk-IYAQC63Y.js";
8
+ import "../chunks/chunk-DNJX6CRV.js";
9
+ import "../chunks/chunk-AC4U3IMS.js";
10
+ import "../chunks/chunk-D6RGFNUW.js";
11
+ import "../chunks/chunk-RKDPDEF7.js";
10
12
  import "../chunks/chunk-SJBZFMQ2.js";
11
- import "../chunks/chunk-6V4TAD2N.js";
12
13
  import "../chunks/chunk-S4AU6SRS.js";
13
- import "../chunks/chunk-AC4U3IMS.js";
14
14
  import {
15
15
  dist_default
16
16
  } from "../chunks/chunk-I4OYYAX5.js";
@@ -23,13 +23,13 @@ import { Label, labelProps } from "../components/Label.js";
23
23
  var TextField_default = {
24
24
  "TextField-multiline": "alinea-TextField-multiline",
25
25
  "TextFieldMultiline": "alinea-TextField-multiline",
26
- "TextField-multiline-shadow": "alinea-TextField-multiline-shadow",
27
- "TextFieldMultilineShadow": "alinea-TextField-multiline-shadow",
28
- "TextField-input": "alinea-TextField-input",
29
- "TextFieldInput": "alinea-TextField-input",
30
26
  "TextField": "alinea-TextField",
31
27
  "TextField-multiline-area": "alinea-TextField-multiline-area",
32
- "TextFieldMultilineArea": "alinea-TextField-multiline-area"
28
+ "TextFieldMultilineArea": "alinea-TextField-multiline-area",
29
+ "TextField-input": "alinea-TextField-input",
30
+ "TextFieldInput": "alinea-TextField-input",
31
+ "TextField-multiline-shadow": "alinea-TextField-multiline-shadow",
32
+ "TextFieldMultilineShadow": "alinea-TextField-multiline-shadow"
33
33
  };
34
34
 
35
35
  // src/components/TextField.tsx
@@ -2,15 +2,15 @@ import {
2
2
  $5400c097f4765e59$export$336ab7fa954c4b5f,
3
3
  $5400c097f4765e59$export$5eaee2322dd727eb,
4
4
  $5400c097f4765e59$export$7edc06cf1783b30f
5
- } from "../chunks/chunk-VXZM6V4P.js";
6
- import "../chunks/chunk-O7XWTMCB.js";
7
- import "../chunks/chunk-RKDPDEF7.js";
5
+ } from "../chunks/chunk-OFEKTDRF.js";
8
6
  import "../chunks/chunk-NIVGVRDS.js";
9
7
  import "../chunks/chunk-IYAQC63Y.js";
8
+ import "../chunks/chunk-DNJX6CRV.js";
9
+ import "../chunks/chunk-AC4U3IMS.js";
10
+ import "../chunks/chunk-D6RGFNUW.js";
11
+ import "../chunks/chunk-RKDPDEF7.js";
10
12
  import "../chunks/chunk-SJBZFMQ2.js";
11
- import "../chunks/chunk-6V4TAD2N.js";
12
13
  import "../chunks/chunk-S4AU6SRS.js";
13
- import "../chunks/chunk-AC4U3IMS.js";
14
14
  import {
15
15
  dist_default
16
16
  } from "../chunks/chunk-I4OYYAX5.js";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  $75afe627ae0cc0fa$export$d2b052e7b4be1756,
3
3
  $bc25b811ec97a172$export$40258cc1d95ff477
4
- } from "../chunks/chunk-VXZM6V4P.js";
5
- import "../chunks/chunk-O7XWTMCB.js";
6
- import "../chunks/chunk-RKDPDEF7.js";
4
+ } from "../chunks/chunk-OFEKTDRF.js";
7
5
  import "../chunks/chunk-NIVGVRDS.js";
8
6
  import "../chunks/chunk-IYAQC63Y.js";
7
+ import "../chunks/chunk-DNJX6CRV.js";
8
+ import "../chunks/chunk-AC4U3IMS.js";
9
+ import "../chunks/chunk-D6RGFNUW.js";
10
+ import "../chunks/chunk-RKDPDEF7.js";
9
11
  import "../chunks/chunk-SJBZFMQ2.js";
10
- import "../chunks/chunk-6V4TAD2N.js";
11
12
  import "../chunks/chunk-S4AU6SRS.js";
12
- import "../chunks/chunk-AC4U3IMS.js";
13
13
  import {
14
14
  dist_default
15
15
  } from "../chunks/chunk-I4OYYAX5.js";
@@ -3,15 +3,15 @@ import {
3
3
  $75afe627ae0cc0fa$export$d2b052e7b4be1756,
4
4
  $db7105decd081705$export$4c260019440d418f,
5
5
  $e28ab3efe3e87743$export$1ff3c3f08ae963c0
6
- } from "../chunks/chunk-VXZM6V4P.js";
7
- import "../chunks/chunk-O7XWTMCB.js";
8
- import "../chunks/chunk-RKDPDEF7.js";
6
+ } from "../chunks/chunk-OFEKTDRF.js";
9
7
  import "../chunks/chunk-NIVGVRDS.js";
10
8
  import "../chunks/chunk-IYAQC63Y.js";
9
+ import "../chunks/chunk-DNJX6CRV.js";
10
+ import "../chunks/chunk-AC4U3IMS.js";
11
+ import "../chunks/chunk-D6RGFNUW.js";
12
+ import "../chunks/chunk-RKDPDEF7.js";
11
13
  import "../chunks/chunk-SJBZFMQ2.js";
12
- import "../chunks/chunk-6V4TAD2N.js";
13
14
  import "../chunks/chunk-S4AU6SRS.js";
14
- import "../chunks/chunk-AC4U3IMS.js";
15
15
  import {
16
16
  dist_default
17
17
  } from "../chunks/chunk-I4OYYAX5.js";
@@ -20,8 +20,8 @@ import "../chunks/chunk-CQ52GEHY.js";
20
20
  // src/components/Toolbar.module.css
21
21
  var Toolbar_default = {
22
22
  "Toolbar": "alinea-Toolbar",
23
- "ToolbarSeparator": "alinea-ToolbarSeparator",
24
23
  "ToolbarButton": "alinea-ToolbarButton",
24
+ "ToolbarSeparator": "alinea-ToolbarSeparator",
25
25
  "ToolbarGroup": "alinea-ToolbarGroup"
26
26
  };
27
27
 
@@ -2,15 +2,15 @@ import {
2
2
  $05a50f7d78b03ad9$export$28c660c63b792dea,
3
3
  $05a50f7d78b03ad9$export$8c610744efcf8a1d,
4
4
  $4fcfe18fac72dabd$export$746d02f47f4d381
5
- } from "../chunks/chunk-VXZM6V4P.js";
6
- import "../chunks/chunk-O7XWTMCB.js";
7
- import "../chunks/chunk-RKDPDEF7.js";
5
+ } from "../chunks/chunk-OFEKTDRF.js";
8
6
  import "../chunks/chunk-NIVGVRDS.js";
9
7
  import "../chunks/chunk-IYAQC63Y.js";
8
+ import "../chunks/chunk-DNJX6CRV.js";
9
+ import "../chunks/chunk-AC4U3IMS.js";
10
+ import "../chunks/chunk-D6RGFNUW.js";
11
+ import "../chunks/chunk-RKDPDEF7.js";
10
12
  import "../chunks/chunk-SJBZFMQ2.js";
11
- import "../chunks/chunk-6V4TAD2N.js";
12
13
  import "../chunks/chunk-S4AU6SRS.js";
13
- import "../chunks/chunk-AC4U3IMS.js";
14
14
  import {
15
15
  dist_default
16
16
  } from "../chunks/chunk-I4OYYAX5.js";
@@ -18,11 +18,11 @@ import "../chunks/chunk-CQ52GEHY.js";
18
18
 
19
19
  // src/components/Tooltip.module.css
20
20
  var Tooltip_default = {
21
- "Tooltip-arrow": "alinea-Tooltip-arrow",
22
- "TooltipArrow": "alinea-Tooltip-arrow",
21
+ "Tooltip": "alinea-Tooltip",
23
22
  "slide-in": "alinea-slide-in",
24
23
  "slideIn": "alinea-slide-in",
25
- "Tooltip": "alinea-Tooltip"
24
+ "Tooltip-arrow": "alinea-Tooltip-arrow",
25
+ "TooltipArrow": "alinea-Tooltip-arrow"
26
26
  };
27
27
 
28
28
  // src/components/Tooltip.tsx
@@ -3,15 +3,15 @@ import {
3
3
  $89d060d8eb451127$export$4b687e3f663d618c,
4
4
  $89d060d8eb451127$export$53d36ab85dc89436,
5
5
  $89d060d8eb451127$export$7fbedc92909ed28e
6
- } from "../chunks/chunk-VXZM6V4P.js";
7
- import "../chunks/chunk-O7XWTMCB.js";
8
- import "../chunks/chunk-RKDPDEF7.js";
6
+ } from "../chunks/chunk-OFEKTDRF.js";
9
7
  import "../chunks/chunk-NIVGVRDS.js";
10
8
  import "../chunks/chunk-IYAQC63Y.js";
9
+ import "../chunks/chunk-DNJX6CRV.js";
10
+ import "../chunks/chunk-AC4U3IMS.js";
11
+ import "../chunks/chunk-D6RGFNUW.js";
12
+ import "../chunks/chunk-RKDPDEF7.js";
11
13
  import "../chunks/chunk-SJBZFMQ2.js";
12
- import "../chunks/chunk-6V4TAD2N.js";
13
14
  import "../chunks/chunk-S4AU6SRS.js";
14
- import "../chunks/chunk-AC4U3IMS.js";
15
15
  import {
16
16
  dist_default
17
17
  } from "../chunks/chunk-I4OYYAX5.js";
@@ -25,18 +25,18 @@ import { Icon } from "./Icon.js";
25
25
 
26
26
  // src/components/Tree.module.css
27
27
  var Tree_default = {
28
- "Tree": "alinea-Tree",
28
+ "TreeItem-iconLink": "alinea-TreeItem-iconLink",
29
+ "TreeItemIconLink": "alinea-TreeItem-iconLink",
30
+ "TreeItem-foldIcon": "alinea-TreeItem-foldIcon",
31
+ "TreeItemFoldIcon": "alinea-TreeItem-foldIcon",
32
+ "TreeItem-dragHandle": "alinea-TreeItem-dragHandle",
33
+ "TreeItemDragHandle": "alinea-TreeItem-dragHandle",
29
34
  "TreeItem": "alinea-TreeItem",
35
+ "Tree": "alinea-Tree",
30
36
  "TreeItem-controls": "alinea-TreeItem-controls",
31
37
  "TreeItemControls": "alinea-TreeItem-controls",
32
- "TreeItem-dragHandle": "alinea-TreeItem-dragHandle",
33
- "TreeItemDragHandle": "alinea-TreeItem-dragHandle",
34
38
  "TreeItem-chevron": "alinea-TreeItem-chevron",
35
- "TreeItemChevron": "alinea-TreeItem-chevron",
36
- "TreeItem-foldIcon": "alinea-TreeItem-foldIcon",
37
- "TreeItemFoldIcon": "alinea-TreeItem-foldIcon",
38
- "TreeItem-iconLink": "alinea-TreeItem-iconLink",
39
- "TreeItemIconLink": "alinea-TreeItem-iconLink"
39
+ "TreeItemChevron": "alinea-TreeItem-chevron"
40
40
  };
41
41
 
42
42
  // src/components/Tree.tsx
@@ -18,7 +18,7 @@ export interface Config {
18
18
  preview?: Preview;
19
19
  /** Every edit will pass through a draft status before being published */
20
20
  enableDrafts?: boolean;
21
- /** The interval in seconds at which the frontend will poll for updates */
21
+ /** Fallback interval in seconds for polling content updates (freshness is primarily sha-driven) */
22
22
  syncInterval?: number;
23
23
  /** Maximum file upload size in bytes */
24
24
  maxUploadSize?: number;
@@ -29,9 +29,14 @@ export interface Config {
29
29
  };
30
30
  /** The url of the handler endpoint */
31
31
  handlerUrl?: string;
32
- /** The folder where public assets are stored, defaults to /public */
32
+ /** The public path where Alinea is mounted, defaults to /admin */
33
+ adminPath?: string;
34
+ /** The folder where public assets are stored, defaults to /public. */
33
35
  publicDir?: string;
34
- /** Filename of the generated dashboard, defaults to admin.html */
36
+ /**
37
+ * Filename of the generated dashboard, defaults to admin.html.
38
+ * @deprecated Use adminPath instead.
39
+ */
35
40
  dashboardFile?: string;
36
41
  /** Optional application-owned instrumentation for Alinea operations. */
37
42
  tracer?: Tracer;
@@ -41,6 +46,8 @@ export declare namespace Config {
41
46
  function baseUrl(config: Config, env?: string): string | undefined;
42
47
  function handlerUrl(config: Config): string;
43
48
  function adminPath(config: Config): string;
49
+ function filePathname(config: Config, file: string): string;
50
+ function dashboardFile(config: Config): string;
44
51
  function mainWorkspace(config: Config): WorkspaceInternal;
45
52
  function type(config: Config, name: string): Type | undefined;
46
53
  function rootContains(config: Config, root: Root, childType: Type): boolean;
@@ -28,10 +28,20 @@ var Config;
28
28
  }
29
29
  Config2.handlerUrl = handlerUrl;
30
30
  function adminPath(config) {
31
+ if (config.adminPath) return normalizeUrlPath(config.adminPath);
31
32
  const file = config.dashboardFile ?? "admin.html";
32
- return paths.basename(file, ".html");
33
+ return normalizeUrlPath(paths.basename(file, ".html"));
33
34
  }
34
35
  Config2.adminPath = adminPath;
36
+ function filePathname(config, file) {
37
+ return paths.join(adminPath(config), "file", file);
38
+ }
39
+ Config2.filePathname = filePathname;
40
+ function dashboardFile(config) {
41
+ if (!config.adminPath && config.dashboardFile) return config.dashboardFile;
42
+ return `${paths.relative("/", adminPath(config))}.html`;
43
+ }
44
+ Config2.dashboardFile = dashboardFile;
35
45
  function mainWorkspace(config) {
36
46
  const key = Object.keys(config.workspaces)[0];
37
47
  return getWorkspace(config.workspaces[key]);
@@ -130,6 +140,11 @@ var Config;
130
140
  }
131
141
  Config2.referencedViews = referencedViews;
132
142
  })(Config || (Config = {}));
143
+ function normalizeUrlPath(value) {
144
+ const normalized2 = paths.join("/", value, ".");
145
+ if (normalized2 === "/") throw new Error("adminPath must not be the root path");
146
+ return normalized2;
147
+ }
133
148
  var normalized = /* @__PURE__ */ new WeakSet();
134
149
  function createConfig(definition) {
135
150
  if (normalized.has(definition)) return definition;
@@ -127,9 +127,9 @@ export declare class QuerySettings {
127
127
  filter?: Filter<EntryFields>;
128
128
  /** Filter by search terms */
129
129
  search?: string | Array<string>;
130
- /** The time in seconds to poll for updates to content */
130
+ /** Fallback interval in seconds for polling content updates (freshness is primarily sha-driven) */
131
131
  syncInterval?: number;
132
- /** Disable polling for updates to content */
132
+ /** Disable syncing content updates */
133
133
  disableSync?: boolean;
134
134
  /** Skip the first N results */
135
135
  skip?: number;
package/dist/core/Role.js CHANGED
@@ -62,20 +62,23 @@ function pack(input) {
62
62
  }
63
63
  return result;
64
64
  }
65
+ function isAllowed(packed, permission) {
66
+ return (packed & permission) === permission && (packed & deny(permission)) === 0;
67
+ }
65
68
  function entitlements(packed) {
66
69
  return {
67
- create: Boolean(packed & Permission.Create),
68
- read: Boolean(packed & Permission.Read),
69
- update: Boolean(packed & Permission.Update),
70
- delete: Boolean(packed & Permission.Delete),
71
- reorder: Boolean(packed & Permission.Reorder),
72
- move: Boolean(packed & Permission.Move),
73
- publish: Boolean(packed & Permission.Publish),
74
- archive: Boolean(packed & Permission.Archive),
75
- upload: Boolean(packed & Permission.Upload),
76
- explore: Boolean(packed & Permission.Explore),
77
- manageMembers: Boolean(packed & Permission.ManageMembers),
78
- all: Boolean(packed & Permission.All)
70
+ create: isAllowed(packed, Permission.Create),
71
+ read: isAllowed(packed, Permission.Read),
72
+ update: isAllowed(packed, Permission.Update),
73
+ delete: isAllowed(packed, Permission.Delete),
74
+ reorder: isAllowed(packed, Permission.Reorder),
75
+ move: isAllowed(packed, Permission.Move),
76
+ publish: isAllowed(packed, Permission.Publish),
77
+ archive: isAllowed(packed, Permission.Archive),
78
+ upload: isAllowed(packed, Permission.Upload),
79
+ explore: isAllowed(packed, Permission.Explore),
80
+ manageMembers: isAllowed(packed, Permission.ManageMembers),
81
+ all: isAllowed(packed, Permission.All)
79
82
  };
80
83
  }
81
84
  var ACL = class extends Map {
@@ -163,8 +166,7 @@ var Policy = class _Policy {
163
166
  return result;
164
167
  }
165
168
  check(permission, resource) {
166
- const permissions = this.#permissionsOf(resource);
167
- return (permissions & permission) === permission && (permissions & deny(permission)) === 0;
169
+ return isAllowed(this.#permissionsOf(resource), permission);
168
170
  }
169
171
  assert(permission, resource) {
170
172
  if (!this.check(permission, resource))
@@ -18,6 +18,7 @@ export interface LinkMark extends Mark {
18
18
  _id: string;
19
19
  _link: 'entry' | 'file' | 'url';
20
20
  _entry?: string;
21
+ _locale?: string;
21
22
  _anchor?: string;
22
23
  _suffix?: string;
23
24
  }
@@ -25,6 +26,7 @@ export declare namespace LinkMark {
25
26
  const id = "_id";
26
27
  const link = "_link";
27
28
  const entry = "_entry";
29
+ const locale = "_locale";
28
30
  const anchor = "_anchor";
29
31
  const suffix = "_suffix";
30
32
  }
@@ -28,6 +28,7 @@ var LinkMark;
28
28
  LinkMark2.id = "_id";
29
29
  LinkMark2.link = "_link";
30
30
  LinkMark2.entry = "_entry";
31
+ LinkMark2.locale = "_locale";
31
32
  LinkMark2.anchor = "_anchor";
32
33
  LinkMark2.suffix = "_suffix";
33
34
  })(LinkMark || (LinkMark = {}));
@@ -1,22 +1,22 @@
1
1
  import type { Preview } from 'alinea/core/Preview';
2
2
  import type { ComponentType } from 'react';
3
- import type { MediaUrlResolver } from './media/MediaLocation.js';
4
3
  import { type HasWorkspace } from './Internal.js';
5
4
  import { Root } from './Root.js';
6
5
  import type { Schema } from './Schema.js';
7
6
  export interface WorkspaceMeta {
8
7
  /** A directory which contains the json entry files */
9
8
  source: string;
10
- /** The directory where media files are placed in case a file backend is used */
9
+ /**
10
+ * The directory where media files are placed
11
+ */
11
12
  mediaDir?: string;
12
- /** Prepare the public URL used when querying media files */
13
- mediaUrl?: string | MediaUrlResolver;
13
+ /** The public URL prefix used when querying media files */
14
+ mediaUrl?: string;
14
15
  /** The main theme color used in the dashboard */
15
16
  color?: string;
16
17
  icon?: ComponentType;
17
18
  preview?: Preview;
18
19
  }
19
- export type { MediaUrlMeta, MediaUrlResolver } from './media/MediaLocation.js';
20
20
  type Roots = Record<string, Root>;
21
21
  export interface RootsDefinition {
22
22
  [key: string]: Root;
@@ -44,3 +44,4 @@ export interface WorkspaceInternal extends WorkspaceConfig<RootsDefinition> {
44
44
  export declare function workspace<Roots extends RootsDefinition>(
45
45
  /** The name of the workspace */
46
46
  label: string, config: WorkspaceConfig<Roots>): Workspace<Roots>;
47
+ export {};
@@ -101,6 +101,8 @@ export declare class EntryGraph {
101
101
  constructor(config: Config, versionData: Map<string, EntryVersionData>, seeds: Map<string, Seed>);
102
102
  byId(id: string): EntryNode | undefined;
103
103
  candidateNodes(query: EntryNodeQuery): Array<EntryNode> | undefined;
104
+ byUrl(url: string): Iterable<Entry>;
105
+ byAlias(alias: string): Iterable<Entry>;
104
106
  get config(): Config;
105
107
  byDir(dir: string): EntryNode | undefined;
106
108
  entryByFilePath(filePath: string): Entry | undefined;
@@ -118,6 +120,7 @@ export declare class EntryIndex extends EventTarget {
118
120
  filter(filter: EntryCondition): Iterable<Entry>;
119
121
  findFirst<T extends Record<string, unknown>>(filter: (entry: Entry) => boolean): Entry<T> | undefined;
120
122
  findMany(filter: (entry: Entry) => boolean): Iterable<Entry>;
123
+ findByUrl(url: string, filter: (entry: Entry) => boolean): Entry | undefined;
121
124
  referencesTo(query: EntryReferenceQuery): Promise<EntryReferenceResult>;
122
125
  referencesFrom(sourceId: string): Promise<import("./EntryReference.js").EntryReference[]>;
123
126
  get references(): Promise<EntryReferenceIndex>;
@@ -1835,7 +1835,9 @@ import { entries, keys } from "../util/Objects.js";
1835
1835
  import { slugify } from "../util/Slugs.js";
1836
1836
  import { sourceChanges } from "./CommitRequest.js";
1837
1837
  import { EntryReferenceIndex } from "./EntryReferenceIndex.js";
1838
+ import { aliasesFromData, aliasUrl } from "./EntryAliases.js";
1838
1839
  import { EntryTransaction } from "./EntryTransaction.js";
1840
+ import { EntryUrlConflictError } from "./EntryUrlConflictError.js";
1839
1841
  import { IndexEvent } from "./IndexEvent.js";
1840
1842
  function combineConditions(a, b) {
1841
1843
  return {
@@ -2091,6 +2093,7 @@ var EntryGraph = class _EntryGraph {
2091
2093
  #byId = /* @__PURE__ */ new Map();
2092
2094
  #byDir = /* @__PURE__ */ new Map();
2093
2095
  #nodesBy = {
2096
+ alias: /* @__PURE__ */ new Map(),
2094
2097
  parentId: /* @__PURE__ */ new Map(),
2095
2098
  url: /* @__PURE__ */ new Map(),
2096
2099
  workspace: /* @__PURE__ */ new Map(),
@@ -2127,6 +2130,7 @@ var EntryGraph = class _EntryGraph {
2127
2130
  this.#nodeOrder.set(node, order);
2128
2131
  this.#indexNode(node);
2129
2132
  }
2133
+ this.#assertUniqueMediaUrls();
2130
2134
  }
2131
2135
  byId(id) {
2132
2136
  return this.#byId.get(id);
@@ -2199,6 +2203,53 @@ var EntryGraph = class _EntryGraph {
2199
2203
  );
2200
2204
  const urls = new Set(Array.from(node.values(), (language) => language.url));
2201
2205
  for (const url of urls) addToIndex(this.#nodesBy.url, url, node);
2206
+ const aliases = new Set(
2207
+ Array.from(node.values()).flatMap(
2208
+ (language) => (aliasesFromData(language.main.data) ?? []).flatMap((value) => {
2209
+ const url = aliasUrl(value);
2210
+ return url === void 0 ? [] : [url];
2211
+ })
2212
+ )
2213
+ );
2214
+ for (const alias of aliases) addToIndex(this.#nodesBy.alias, alias, node);
2215
+ }
2216
+ #assertUniqueMediaUrls() {
2217
+ const claims = /* @__PURE__ */ new Map();
2218
+ for (const node of this.nodes) {
2219
+ if (node.type !== "MediaFile") continue;
2220
+ const published = Array.from(
2221
+ node.filter({ entry: (entry) => entry.status === "published" })
2222
+ );
2223
+ const [representative] = published;
2224
+ if (!representative) continue;
2225
+ const urls = new Set(published.map((entry) => entry.url));
2226
+ for (const url of urls) {
2227
+ const existing = claims.get(url);
2228
+ if (existing && existing.id !== node.id) {
2229
+ throw new EntryUrlConflictError({
2230
+ url,
2231
+ entryId: existing.id,
2232
+ workspace: existing.workspace,
2233
+ root: existing.root
2234
+ });
2235
+ }
2236
+ claims.set(url, representative);
2237
+ }
2238
+ }
2239
+ }
2240
+ byUrl(url) {
2241
+ return this.filter({
2242
+ nodes: this.#nodesBy.url.get(url) ?? [],
2243
+ entry: (entry) => entry.url === url
2244
+ });
2245
+ }
2246
+ byAlias(alias) {
2247
+ return this.filter({
2248
+ nodes: this.#nodesBy.alias.get(alias) ?? [],
2249
+ entry: (entry) => (aliasesFromData(entry.data) ?? []).some(
2250
+ (value) => aliasUrl(value) === alias
2251
+ )
2252
+ });
2202
2253
  }
2203
2254
  #fromIndex(index, keys2) {
2204
2255
  if (keys2.length === 1) return [...index.get(keys2[0]) ?? []];
@@ -2473,6 +2524,10 @@ var EntryIndex = class _EntryIndex extends EventTarget {
2473
2524
  findMany(filter) {
2474
2525
  return this.graph.filter({ entry: filter });
2475
2526
  }
2527
+ findByUrl(url, filter) {
2528
+ for (const entry of this.graph.byUrl(url)) if (filter(entry)) return entry;
2529
+ for (const entry of this.graph.byAlias(url)) if (filter(entry)) return entry;
2530
+ }
2476
2531
  async referencesTo(query) {
2477
2532
  const references = await this.references;
2478
2533
  return references.referencesTo(query);