alinea 2.0.0-preview.2 → 2.0.0-preview.4

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 (178) hide show
  1. package/dist/.init/content/pages/welcome.json +1 -1
  2. package/dist/LICENSES.md +157 -103
  3. package/dist/adapter/next/DevRemote.js +10 -2
  4. package/dist/adapter/next/previews.js +4 -1
  5. package/dist/adapter/next/previews.spec.d.ts +1 -0
  6. package/dist/backend/Handler.js +14 -7
  7. package/dist/backend/api/BasicAuth.d.ts +1 -1
  8. package/dist/backend/api/BasicAuth.js +14 -14
  9. package/dist/backend/api/OAuth2.d.ts +3 -3
  10. package/dist/backend/api/OAuth2.js +7 -4
  11. package/dist/bundled.d.ts +159 -42
  12. package/dist/chunks/{chunk-Y7XOMJOC.js → chunk-CFNRVI3Y.js} +220 -247
  13. package/dist/chunks/chunk-D6UJHBJJ.js +183 -0
  14. package/dist/chunks/chunk-TIJTT5ZI.js +228 -0
  15. package/dist/chunks/{chunk-UVOEM4AH.js → chunk-XMOVGDFI.js} +1 -1
  16. package/dist/cli/Serve.js +1 -1
  17. package/dist/cli/bin.js +1 -1
  18. package/dist/cli/serve/LocalAuth.js +1 -1
  19. package/dist/cloud/AuthResult.d.ts +2 -0
  20. package/dist/cloud/CloudHandshake.d.ts +7 -0
  21. package/dist/cloud/CloudHandshake.js +64 -0
  22. package/dist/cloud/CloudRemote.d.ts +4 -1
  23. package/dist/cloud/CloudRemote.js +21 -3
  24. package/dist/components/Breadcrumbs.js +2 -2
  25. package/dist/components/Calendar.js +6 -6
  26. package/dist/components/Checkbox.js +3 -3
  27. package/dist/components/ComboBox.js +11 -11
  28. package/dist/components/DateField.js +3 -3
  29. package/dist/components/DatePicker.js +4 -4
  30. package/dist/components/DateRangePicker.js +6 -6
  31. package/dist/components/Disclosure.js +8 -8
  32. package/dist/components/Label.js +5 -5
  33. package/dist/components/List.js +34 -34
  34. package/dist/components/Menu.js +4 -4
  35. package/dist/components/Modal.js +3 -3
  36. package/dist/components/MultipleSelect.js +25 -25
  37. package/dist/components/NumberField.js +6 -6
  38. package/dist/components/ProgressCircle.js +2 -2
  39. package/dist/components/RadioGroup.js +2 -2
  40. package/dist/components/SearchField.js +3 -3
  41. package/dist/components/Select.js +7 -7
  42. package/dist/components/Surface.js +2 -2
  43. package/dist/components/Table.js +7 -7
  44. package/dist/components/Tabs.js +4 -4
  45. package/dist/components/TagGroup.js +2 -2
  46. package/dist/components/TextField.js +6 -6
  47. package/dist/components/TimeField.js +2 -2
  48. package/dist/components/Toggle.d.ts +1 -1
  49. package/dist/components/Toggle.js +2 -2
  50. package/dist/components/Toolbar.js +2 -2
  51. package/dist/components/Tooltip.js +3 -3
  52. package/dist/components/Tree.d.ts +4 -2
  53. package/dist/components/Tree.js +18 -4
  54. package/dist/core/Connection.d.ts +7 -4
  55. package/dist/core/Entry.d.ts +6 -0
  56. package/dist/core/Entry.js +10 -0
  57. package/dist/core/Graph.d.ts +1 -1
  58. package/dist/core/Id.d.ts +1 -0
  59. package/dist/core/Id.js +8 -0
  60. package/dist/core/Infer.d.ts +8 -1
  61. package/dist/core/db/EntryAliases.js +1 -4
  62. package/dist/core/db/EntryResolver.js +6 -6
  63. package/dist/core/db/EntryTransaction.js +1 -0
  64. package/dist/core/db/Operation.d.ts +2 -2
  65. package/dist/core/db/Operation.js +15 -4
  66. package/dist/dashboard/App.js +37 -17
  67. package/dist/dashboard/StoryProvider.js +2 -2
  68. package/dist/dashboard/app/AccessDenied.d.ts +16 -1
  69. package/dist/dashboard/app/AccessDenied.js +21 -12
  70. package/dist/dashboard/app/ActivityStatus.js +19 -19
  71. package/dist/dashboard/app/AppearanceToggle.d.ts +1 -0
  72. package/dist/dashboard/app/AppearanceToggle.js +43 -0
  73. package/dist/dashboard/app/AuthView.d.ts +1 -1
  74. package/dist/dashboard/app/AuthView.js +16 -18
  75. package/dist/dashboard/app/Badge.js +2 -2
  76. package/dist/dashboard/app/CompactField.js +17 -17
  77. package/dist/dashboard/app/DashboardErrorBoundary.js +22 -10
  78. package/dist/dashboard/app/DashboardLayout.js +15 -8
  79. package/dist/dashboard/app/DashboardMeta.d.ts +2 -1
  80. package/dist/dashboard/app/DashboardMeta.js +20 -5
  81. package/dist/dashboard/app/EntryFields.js +6 -6
  82. package/dist/dashboard/app/EntryHeader.js +25 -25
  83. package/dist/dashboard/app/EntryReferences.js +16 -16
  84. package/dist/dashboard/app/EntrySidebar.js +26 -26
  85. package/dist/dashboard/app/EntrySidebarPreview.js +61 -34
  86. package/dist/dashboard/app/EntrySidebarPreview.story.d.ts +6 -1
  87. package/dist/dashboard/app/EntryTranslationBanner.js +8 -8
  88. package/dist/dashboard/app/Explorer.d.ts +2 -1
  89. package/dist/dashboard/app/Explorer.js +79 -67
  90. package/dist/dashboard/app/ExplorerCards.js +62 -66
  91. package/dist/dashboard/app/ExplorerFileCard.js +20 -20
  92. package/dist/dashboard/app/ExplorerList.js +22 -22
  93. package/dist/dashboard/app/ExplorerModal.js +3 -3
  94. package/dist/dashboard/app/ExplorerPickerContent.js +2 -2
  95. package/dist/dashboard/app/ExplorerTable.js +68 -68
  96. package/dist/dashboard/app/ImagePicker.js +7 -7
  97. package/dist/dashboard/app/LinkPicker.js +44 -24
  98. package/dist/dashboard/app/LocaleMenu.js +5 -7
  99. package/dist/dashboard/app/SidebarLayout.js +7 -7
  100. package/dist/dashboard/app/SidebarTree.js +66 -74
  101. package/dist/dashboard/app/WorkspaceMenu.d.ts +10 -3
  102. package/dist/dashboard/app/WorkspaceMenu.js +85 -64
  103. package/dist/dashboard/app/WorkspaceMenu.stories.d.ts +2 -0
  104. package/dist/dashboard/app/WorkspaceRoots.d.ts +3 -1
  105. package/dist/dashboard/app/WorkspaceRoots.js +82 -107
  106. package/dist/dashboard/app/editor/FileEditor.js +31 -31
  107. package/dist/dashboard/app/editor/FilePreview.js +4 -4
  108. package/dist/dashboard/app/editor/MediaAltField.view.js +4 -4
  109. package/dist/dashboard/app/modals/CreateEntry.js +14 -14
  110. package/dist/dashboard/app/pages/EntryPage.js +28 -30
  111. package/dist/dashboard/app/pages/RootPage.js +4 -4
  112. package/dist/dashboard/app/pages/SplashPage.d.ts +3 -0
  113. package/dist/dashboard/app/pages/SplashPage.js +414 -0
  114. package/dist/dashboard/app/pages/UsersPage.js +35 -35
  115. package/dist/dashboard/app/ui/DashboardModal.js +19 -19
  116. package/dist/dashboard/app/ui/Rail.js +3 -3
  117. package/dist/dashboard/atoms/ReactiveNode.js +1 -1
  118. package/dist/dashboard/atoms/activity.js +2 -3
  119. package/dist/dashboard/atoms/auth.d.ts +2 -0
  120. package/dist/dashboard/atoms/auth.js +6 -2
  121. package/dist/dashboard/atoms/config.js +1 -1
  122. package/dist/dashboard/atoms/core.js +2 -2
  123. package/dist/dashboard/atoms/create.js +1 -1
  124. package/dist/dashboard/atoms/dashboard.js +2 -2
  125. package/dist/dashboard/atoms/editor.js +1 -1
  126. package/dist/dashboard/atoms/entry.js +2 -2
  127. package/dist/dashboard/atoms/explorer.d.ts +1 -3
  128. package/dist/dashboard/atoms/explorer.js +7 -9
  129. package/dist/dashboard/atoms/graph.d.ts +1 -0
  130. package/dist/dashboard/atoms/graph.js +7 -2
  131. package/dist/dashboard/atoms/link.js +2 -2
  132. package/dist/dashboard/atoms/nav.d.ts +4 -3
  133. package/dist/dashboard/atoms/nav.js +10 -5
  134. package/dist/dashboard/atoms/preview.js +1 -1
  135. package/dist/dashboard/atoms/root.js +2 -2
  136. package/dist/dashboard/atoms/upload.js +1 -1
  137. package/dist/dashboard/atoms/user.d.ts +1 -1
  138. package/dist/dashboard/atoms/user.js +8 -6
  139. package/dist/dashboard/atoms/utils.js +2 -2
  140. package/dist/dashboard/boot/Boot.js +2 -4
  141. package/dist/dashboard/boot/DashboardWorker.js +34 -29
  142. package/dist/dashboard/editor/UseField.js +6 -6
  143. package/dist/dashboard/fixture/cms.d.ts +12 -0
  144. package/dist/dashboard/fixture/cms.js +53 -2
  145. package/dist/dashboard/hook/UseGraph.js +4 -4
  146. package/dist/dashboard/hook/UseRoot.js +4 -4
  147. package/dist/dashboard/hooks.js +16 -16
  148. package/dist/field/check/CheckField.view.js +2 -2
  149. package/dist/field/code/CodeField.view.js +15 -15
  150. package/dist/field/link/EntryLink.d.ts +1 -1
  151. package/dist/field/link/EntryLink.js +1 -0
  152. package/dist/field/link/Link.js +1 -0
  153. package/dist/field/link/LinkField.d.ts +5 -0
  154. package/dist/field/link/LinkField.view.js +81 -64
  155. package/dist/field/list/ListField.view.js +26 -26
  156. package/dist/field/localiser/LocalisedField.view.js +76 -5
  157. package/dist/field/metadata/MetadataField.d.ts +2 -0
  158. package/dist/field/metadata/MetadataField.js +2 -1
  159. package/dist/field/metadata/MetadataField.view.js +20 -20
  160. package/dist/field/richtext/PickTextLink.js +6 -6
  161. package/dist/field/richtext/RichTextBlock.js +6 -6
  162. package/dist/field/richtext/RichTextBlocks.js +1 -1
  163. package/dist/field/richtext/RichTextExtensions.js +23 -23
  164. package/dist/field/richtext/RichTextField.view.js +9 -9
  165. package/dist/field/richtext/RichTextState.js +1 -1
  166. package/dist/field/text/TextField.view.js +2 -2
  167. package/dist/index.css +436 -28
  168. package/dist/preview/PreviewMessage.d.ts +3 -0
  169. package/dist/preview/PreviewMessage.js +1 -0
  170. package/dist/preview/RegisterPreview.d.ts +1 -1
  171. package/dist/preview/RegisterPreview.js +28 -10
  172. package/dist/preview/react.d.ts +5 -1
  173. package/dist/preview/react.js +12 -9
  174. package/dist/preview/widget.js +6 -12
  175. package/dist/query.d.ts +7 -7
  176. package/package.json +1 -1
  177. package/dist/chunks/chunk-STAJCW4Z.js +0 -322
  178. package/dist/chunks/chunk-U4VOHNR2.js +0 -210
package/dist/index.css CHANGED
@@ -1567,6 +1567,7 @@
1567
1567
  .alinea-ListLabel {
1568
1568
  color: var(--alinea-fg-muted);
1569
1569
  border: none;
1570
+ flex-wrap: wrap;
1570
1571
  align-items: flex-start;
1571
1572
  min-height: auto;
1572
1573
  margin-bottom: 8px;
@@ -3216,6 +3217,24 @@
3216
3217
  font-size: 12px;
3217
3218
  }
3218
3219
  }
3220
+ &[data-variant=icon-small] {
3221
+ background: none;
3222
+ border: 0;
3223
+ border-radius: 6px;
3224
+ height: 26px;
3225
+ padding: 0;
3226
+ & .alinea-ToggleButton {
3227
+ border-radius: 6px;
3228
+ width: 26px;
3229
+ min-height: 26px;
3230
+ padding: 0;
3231
+ & [data-slot=icon] {
3232
+ width: 14px;
3233
+ height: 14px;
3234
+ font-size: 14px;
3235
+ }
3236
+ }
3237
+ }
3219
3238
  }
3220
3239
  .alinea-ToggleButton {
3221
3240
  appearance: none;
@@ -3235,6 +3254,7 @@
3235
3254
  gap: 6px;
3236
3255
  padding: 2px 6px;
3237
3256
  font-weight: 550;
3257
+ transition: color .25s ease-out, background-color .25s ease-out;
3238
3258
  display: inline-flex;
3239
3259
  & svg,
3240
3260
  & [data-slot=icon] {
@@ -3519,6 +3539,10 @@
3519
3539
  width: 16px;
3520
3540
  height: 16px;
3521
3541
  }
3542
+ .alinea-TreeItem-iconLink {
3543
+ color: inherit;
3544
+ display: flex;
3545
+ }
3522
3546
  .alinea-TreeItem-dragHandle {
3523
3547
  background: none;
3524
3548
  border: none;
@@ -3962,6 +3986,10 @@
3962
3986
  font-size: .9em;
3963
3987
  overflow: auto;
3964
3988
  }
3989
+ .alinea-DashboardErrorBoundary-actions {
3990
+ justify-content: flex-end;
3991
+ display: flex;
3992
+ }
3965
3993
 
3966
3994
  /* src/dashboard/app/DashboardLayout.module.css */
3967
3995
  .alinea-DashboardLayout-create {
@@ -5319,6 +5347,9 @@
5319
5347
  min-height: 0;
5320
5348
  position: relative;
5321
5349
  overflow: hidden;
5350
+ &.alinea-is-compact {
5351
+ border-radius: 0;
5352
+ }
5322
5353
  }
5323
5354
  .alinea-ExplorerTable {
5324
5355
  box-sizing: border-box;
@@ -5658,6 +5689,20 @@
5658
5689
  padding: 8px;
5659
5690
  display: flex;
5660
5691
  }
5692
+ .alinea-LinkPickerCompact-footer {
5693
+ border-top: 1px solid var(--alinea-border);
5694
+ flex: none;
5695
+ justify-content: space-between;
5696
+ align-items: center;
5697
+ gap: 12px;
5698
+ padding: 8px;
5699
+ display: flex;
5700
+ }
5701
+ .alinea-LinkPickerCompact-selection {
5702
+ color: var(--alinea-fg-muted);
5703
+ font-size: 13px;
5704
+ line-height: 20px;
5705
+ }
5661
5706
 
5662
5707
  /* src/dashboard/app/LocaleMenu.module.css */
5663
5708
  .alinea-LocaleMenu-trigger {
@@ -5853,6 +5898,345 @@
5853
5898
  }
5854
5899
  }
5855
5900
 
5901
+ /* src/dashboard/app/pages/SplashPage.module.css */
5902
+ .alinea-SplashPage {
5903
+ background: var(--alinea-backdrop);
5904
+ width: 100%;
5905
+ min-width: 0;
5906
+ min-height: 100%;
5907
+ color: var(--alinea-fg);
5908
+ justify-content: center;
5909
+ align-items: safe center;
5910
+ padding: 24px;
5911
+ display: flex;
5912
+ }
5913
+ .alinea-SplashPage-content {
5914
+ grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
5915
+ align-items: start;
5916
+ gap: clamp(24px, 3vw, 40px);
5917
+ width: 100%;
5918
+ max-width: 1240px;
5919
+ display: grid;
5920
+ }
5921
+ .alinea-SplashPage-sidebar {
5922
+ flex-direction: column;
5923
+ justify-content: center;
5924
+ min-width: 0;
5925
+ min-height: calc(100dvh - 48px);
5926
+ display: flex;
5927
+ position: sticky;
5928
+ top: 24px;
5929
+ }
5930
+ .alinea-SplashPage-sidebar-content {
5931
+ flex-direction: column;
5932
+ align-items: stretch;
5933
+ gap: 8px;
5934
+ min-width: 0;
5935
+ display: flex;
5936
+ }
5937
+ .alinea-SplashPage-user {
5938
+ box-sizing: border-box;
5939
+ min-width: 0;
5940
+ min-height: 38px;
5941
+ color: var(--alinea-fg);
5942
+ font-size: var(--alinea-font-size-base);
5943
+ border: 1px solid #0000;
5944
+ align-items: center;
5945
+ gap: 9px;
5946
+ padding: 3px 8px;
5947
+ font-weight: 500;
5948
+ display: flex;
5949
+ }
5950
+ .alinea-SplashPage-user-label {
5951
+ text-overflow: ellipsis;
5952
+ white-space: nowrap;
5953
+ min-width: 0;
5954
+ overflow: hidden;
5955
+ }
5956
+ .alinea-SplashPage-action {
5957
+ width: 100%;
5958
+ min-width: 0;
5959
+ min-height: 38px;
5960
+ color: var(--alinea-fg-muted);
5961
+ justify-content: flex-start;
5962
+ gap: 9px;
5963
+ font-weight: 400;
5964
+ transition:
5965
+ color .25s ease-out,
5966
+ background-color .25s ease-out,
5967
+ box-shadow .25s ease-out;
5968
+ }
5969
+ .alinea-SplashPage-action[data-hovered] {
5970
+ color: var(--alinea-fg);
5971
+ background: var(--alinea-bg);
5972
+ box-shadow: var(--alinea-shadow);
5973
+ }
5974
+ .alinea-SplashPage-search-label {
5975
+ text-overflow: ellipsis;
5976
+ white-space: nowrap;
5977
+ min-width: 0;
5978
+ overflow: hidden;
5979
+ }
5980
+ .alinea-SplashPage-actionIcon {
5981
+ flex-shrink: 0;
5982
+ font-size: 16px;
5983
+ }
5984
+ .alinea-SplashPage-appearance {
5985
+ min-height: 38px;
5986
+ color: var(--alinea-fg-muted);
5987
+ font-size: var(--alinea-font-size-base);
5988
+ justify-content: space-between;
5989
+ align-items: center;
5990
+ gap: 12px;
5991
+ padding: 4px 5px 4px 9px;
5992
+ display: flex;
5993
+ }
5994
+ .alinea-SplashPage-appearance-label {
5995
+ font-size: inherit;
5996
+ }
5997
+ .alinea-SplashPage-grid {
5998
+ column-count: 2;
5999
+ align-self: center;
6000
+ column-gap: 16px;
6001
+ width: 100%;
6002
+ padding-block: 12px;
6003
+ }
6004
+ .alinea-SplashPage-card {
6005
+ --alinea-card-fg: var(--alinea-fg-muted);
6006
+ --alinea-card-fg-strong: var(--alinea-fg-muted);
6007
+ --alinea-card-fg-subtle: var(--alinea-fg-muted);
6008
+ break-inside: avoid;
6009
+ cursor: pointer;
6010
+ flex-direction: column;
6011
+ width: 100%;
6012
+ min-width: 0;
6013
+ margin-bottom: 16px;
6014
+ transition: box-shadow .25s ease-out;
6015
+ display: flex;
6016
+ }
6017
+ .alinea-SplashPage-card:hover,
6018
+ .alinea-SplashPage-card:focus-within,
6019
+ .alinea-SplashPage-card:has(.alinea-SplashPage-root[data-pressed]) {
6020
+ --alinea-card-fg: var(--alinea-fg);
6021
+ --alinea-card-fg-strong: var(--alinea-fg-strong);
6022
+ --alinea-card-fg-subtle: var(--alinea-fg-subtle);
6023
+ box-shadow: var(--alinea-shadow-modal), inset 0 0 0 1px var(--alinea-border-hover);
6024
+ }
6025
+ .alinea-SplashPage-card-header {
6026
+ flex-wrap: nowrap;
6027
+ align-items: center;
6028
+ min-width: 0;
6029
+ min-height: 50px;
6030
+ display: flex;
6031
+ }
6032
+ .alinea-SplashPage-card-header-title {
6033
+ flex: 0 auto;
6034
+ min-width: 0;
6035
+ max-width: 52%;
6036
+ }
6037
+ .alinea-SplashPage-card-header-button {
6038
+ text-align: left;
6039
+ --alinea-button-bg: transparent;
6040
+ --alinea-button-hovered: transparent;
6041
+ border: 0;
6042
+ border-radius: 0;
6043
+ align-items: center;
6044
+ gap: 12px;
6045
+ max-width: 100%;
6046
+ min-height: 48px;
6047
+ padding: 8px 10px 8px 14px;
6048
+ display: flex;
6049
+ }
6050
+ .alinea-SplashPage-card-header-button[data-hovered] {
6051
+ background: none;
6052
+ }
6053
+ .alinea-SplashPage-card-header-content {
6054
+ flex: 0 auto;
6055
+ align-items: center;
6056
+ gap: 12px;
6057
+ min-width: 0;
6058
+ display: flex;
6059
+ }
6060
+ .alinea-SplashPage-card-header-label {
6061
+ min-width: 0;
6062
+ color: var(--alinea-card-fg-strong);
6063
+ text-overflow: ellipsis;
6064
+ white-space: nowrap;
6065
+ flex: 1;
6066
+ font-size: 13px;
6067
+ font-weight: 600;
6068
+ transition: color .25s ease-out;
6069
+ overflow: hidden;
6070
+ }
6071
+ .alinea-SplashPage-entries {
6072
+ flex-direction: column;
6073
+ align-items: flex-start;
6074
+ min-width: 0;
6075
+ padding: 2px 14px 13px;
6076
+ display: flex;
6077
+ }
6078
+ .alinea-SplashPage-entries:empty {
6079
+ display: none;
6080
+ }
6081
+ .alinea-SplashPage-entry {
6082
+ --alinea-button-bg: transparent;
6083
+ --alinea-button-hovered: transparent;
6084
+ border: 0;
6085
+ border-radius: 6px;
6086
+ width: auto;
6087
+ max-width: 100%;
6088
+ min-height: 41px;
6089
+ padding: 4px 0 5px;
6090
+ font-weight: 400;
6091
+ display: inline-flex;
6092
+ }
6093
+ .alinea-SplashPage-entry[data-hovered] {
6094
+ background: none;
6095
+ }
6096
+ .alinea-SplashPage-entry-visual {
6097
+ width: 14px;
6098
+ height: 14px;
6099
+ color: var(--alinea-fg-muted);
6100
+ background: var(--alinea-bg);
6101
+ border-radius: 3px;
6102
+ justify-content: center;
6103
+ align-items: center;
6104
+ display: flex;
6105
+ overflow: hidden;
6106
+ }
6107
+ .alinea-SplashPage-entry-visual-icon {
6108
+ font-size: 11px;
6109
+ }
6110
+ .alinea-SplashPage-entry-time {
6111
+ font-variant-numeric: tabular-nums;
6112
+ white-space: nowrap;
6113
+ }
6114
+ .alinea-SplashPage-entry-content {
6115
+ flex-direction: column;
6116
+ align-items: stretch;
6117
+ gap: 0;
6118
+ min-width: 0;
6119
+ display: flex;
6120
+ }
6121
+ .alinea-SplashPage-entry-primary {
6122
+ align-items: center;
6123
+ gap: 6px;
6124
+ min-width: 0;
6125
+ display: flex;
6126
+ }
6127
+ .alinea-SplashPage-entry-title {
6128
+ min-width: 0;
6129
+ color: var(--alinea-card-fg-strong);
6130
+ text-overflow: ellipsis;
6131
+ white-space: nowrap;
6132
+ font-weight: 500;
6133
+ transition: color .25s ease-out;
6134
+ overflow: hidden;
6135
+ }
6136
+ .alinea-SplashPage-entry[data-hovered] .alinea-SplashPage-entry-title {
6137
+ text-underline-offset: 2px;
6138
+ text-decoration: underline;
6139
+ }
6140
+ .alinea-SplashPage-entry-meta {
6141
+ min-width: 0;
6142
+ color: var(--alinea-card-fg-subtle);
6143
+ font-size: inherit;
6144
+ white-space: nowrap;
6145
+ gap: 4px;
6146
+ font-weight: 400;
6147
+ line-height: 1.2;
6148
+ transition: color .25s ease-out;
6149
+ display: flex;
6150
+ overflow: hidden;
6151
+ }
6152
+ .alinea-SplashPage-entry-user {
6153
+ text-overflow: ellipsis;
6154
+ min-width: 0;
6155
+ overflow: hidden;
6156
+ }
6157
+ .alinea-SplashPage-card-footer {
6158
+ opacity: 0;
6159
+ pointer-events: none;
6160
+ flex-wrap: nowrap;
6161
+ flex: 1;
6162
+ justify-content: flex-start;
6163
+ align-items: center;
6164
+ gap: 4px 6px;
6165
+ min-width: 0;
6166
+ min-height: 50px;
6167
+ padding: 6px 12px 6px 2px;
6168
+ transition: opacity .25s ease-out;
6169
+ display: flex;
6170
+ overflow: hidden;
6171
+ }
6172
+ .alinea-SplashPage-card:hover .alinea-SplashPage-card-footer,
6173
+ .alinea-SplashPage-card:focus-within .alinea-SplashPage-card-footer,
6174
+ .alinea-SplashPage-card:has(.alinea-SplashPage-root[data-pressed]) .alinea-SplashPage-card-footer {
6175
+ opacity: 1;
6176
+ pointer-events: auto;
6177
+ }
6178
+ .alinea-SplashPage-root {
6179
+ min-width: 0;
6180
+ max-width: 132px;
6181
+ min-height: 28px;
6182
+ color: var(--alinea-card-fg-subtle);
6183
+ opacity: .62;
6184
+ text-overflow: ellipsis;
6185
+ white-space: nowrap;
6186
+ --alinea-button-bg: transparent;
6187
+ --alinea-button-hovered: transparent;
6188
+ padding-inline: 6px;
6189
+ font-size: 12px;
6190
+ font-weight: 400;
6191
+ transition: color .25s ease-out, opacity .25s ease-out;
6192
+ overflow: hidden;
6193
+ }
6194
+ .alinea-SplashPage-root[data-hovered] {
6195
+ color: var(--alinea-fg);
6196
+ opacity: 1;
6197
+ }
6198
+ .alinea-SplashPage-root-menuIcon {
6199
+ flex-shrink: 0;
6200
+ font-size: 16px;
6201
+ }
6202
+ @media (hover: none), (pointer: coarse) {
6203
+ .alinea-SplashPage-card-footer {
6204
+ opacity: 1;
6205
+ pointer-events: auto;
6206
+ }
6207
+ }
6208
+ @media (width <= 1100px) {
6209
+ .alinea-SplashPage-grid {
6210
+ column-count: 1;
6211
+ }
6212
+ }
6213
+ @media (width <= 760px) {
6214
+ .alinea-SplashPage-content {
6215
+ display: block;
6216
+ }
6217
+ .alinea-SplashPage-sidebar {
6218
+ min-height: 0;
6219
+ margin-bottom: 16px;
6220
+ position: static;
6221
+ }
6222
+ .alinea-SplashPage-sidebar-content {
6223
+ grid-template-columns: minmax(0, 1fr) auto;
6224
+ align-items: center;
6225
+ display: grid;
6226
+ }
6227
+ .alinea-SplashPage-appearance {
6228
+ grid-column: 1 / -1;
6229
+ }
6230
+ }
6231
+ @media (width <= 600px) {
6232
+ .alinea-SplashPage {
6233
+ padding: 8px;
6234
+ }
6235
+ .alinea-SplashPage-sidebar {
6236
+ margin-bottom: 8px;
6237
+ }
6238
+ }
6239
+
5856
6240
  /* src/dashboard/app/pages/UsersPage.module.css */
5857
6241
  .alinea-UsersPage {
5858
6242
  background: var(--alinea-bg);
@@ -6548,15 +6932,21 @@
6548
6932
  height: 24px;
6549
6933
  display: inline-flex;
6550
6934
  }
6935
+ .alinea-WorkspaceMenu-avatar-large {
6936
+ width: 32px;
6937
+ height: 32px;
6938
+ }
6551
6939
  .alinea-WorkspaceMenu-avatar-logo {
6552
6940
  width: 100%;
6553
6941
  height: 100%;
6554
6942
  }
6555
6943
  .alinea-WorkspaceMenu-avatarTrigger {
6556
6944
  justify-content: center;
6945
+ align-items: center;
6557
6946
  width: 32px;
6558
6947
  height: 32px;
6559
6948
  padding: 0;
6949
+ display: flex;
6560
6950
  }
6561
6951
  .alinea-WorkspaceMenu-trigger {
6562
6952
  cursor: pointer;
@@ -6637,8 +7027,9 @@
6637
7027
  }
6638
7028
  .alinea-WorkspaceRoots-profile-popover {
6639
7029
  min-width: 260px;
7030
+ font-size: var(--alinea-font-size-base);
6640
7031
  margin: 0;
6641
- padding: 0;
7032
+ padding: 4px;
6642
7033
  list-style: none;
6643
7034
  }
6644
7035
  .alinea-WorkspaceRoots-profile-popover-surface {
@@ -6647,58 +7038,75 @@
6647
7038
  }
6648
7039
  .alinea-WorkspaceRoots-profile-popover-user,
6649
7040
  .alinea-WorkspaceRoots-profile-popover-item {
6650
- justify-content: space-between;
7041
+ min-height: 38px;
7042
+ font-size: inherit;
6651
7043
  align-items: center;
6652
- gap: 16px;
6653
- padding: 8px 16px;
6654
- font-size: 14px;
7044
+ gap: 9px;
7045
+ padding: 3px 8px;
6655
7046
  display: flex;
6656
7047
  }
6657
- .alinea-WorkspaceRoots-profile-popover-user,
6658
- .alinea-WorkspaceRoots-profile-popover-item:not(:last-child) {
6659
- border-bottom: 1px solid var(--alinea-border);
7048
+ .alinea-WorkspaceRoots-profile-popover-user {
7049
+ color: var(--alinea-fg);
7050
+ font-weight: 400;
7051
+ }
7052
+ .alinea-WorkspaceRoots-profile-popover-item {
7053
+ color: var(--alinea-fg-muted);
7054
+ justify-content: space-between;
7055
+ font-weight: 400;
6660
7056
  }
6661
7057
  .alinea-WorkspaceRoots-profile-popover-user-icon {
6662
7058
  flex-shrink: 0;
6663
- justify-content: center;
6664
- align-items: center;
6665
- width: 20px;
6666
- height: 20px;
6667
- display: inline-flex;
7059
+ font-size: 16px;
6668
7060
  }
6669
7061
  .alinea-WorkspaceRoots-profile-popover-user-title {
7062
+ min-width: 0;
7063
+ font-size: var(--alinea-font-size-base);
6670
7064
  text-overflow: ellipsis;
6671
7065
  white-space: nowrap;
6672
7066
  flex: 1;
6673
- min-width: 0;
7067
+ font-weight: 500;
6674
7068
  overflow: hidden;
6675
7069
  }
6676
7070
  .alinea-WorkspaceRoots-profile-popover-item-label {
7071
+ color: var(--alinea-fg-muted);
7072
+ font-size: var(--alinea-font-size-base);
6677
7073
  margin: 0;
6678
- }
6679
- .alinea-WorkspaceRoots-profile-popover-themeOptions {
6680
- gap: 8px;
6681
- display: flex;
7074
+ font-weight: 400;
7075
+ line-height: 24px;
6682
7076
  }
6683
7077
  .alinea-WorkspaceRoots-profile-popover-action {
6684
- padding: 4px;
6685
- font-size: 14px;
7078
+ font-size: inherit;
7079
+ padding: 0;
6686
7080
  display: flex;
6687
7081
  }
6688
- .alinea-WorkspaceRoots-profile-popover-action:first-of-type {
6689
- border-top: 1px solid var(--alinea-border);
6690
- }
6691
7082
  .alinea-WorkspaceRoots-profile-popover-action-button {
6692
- border-radius: 4px;
6693
- justify-content: flex-start;
6694
- gap: 8px;
6695
7083
  width: 100%;
6696
- font-weight: 500;
7084
+ min-height: 38px;
7085
+ font-size: var(--alinea-font-size-base);
7086
+ border-radius: 8px;
7087
+ justify-content: flex-start;
7088
+ gap: 9px;
7089
+ padding: 3px 8px;
7090
+ font-weight: 400;
7091
+ &[data-appearance=plain] {
7092
+ --alinea-button-default-plain-color: var(--alinea-fg-muted);
7093
+ }
7094
+ &[data-hovered] {
7095
+ --alinea-button-default-plain-color: var(--alinea-fg);
7096
+ }
7097
+ }
7098
+ .alinea-WorkspaceRoots-profile-popover-action-icon {
7099
+ flex-shrink: 0;
7100
+ font-size: 16px;
6697
7101
  }
6698
7102
  .alinea-WorkspaceRoots-profile-popover-action-label {
7103
+ min-width: 0;
7104
+ color: inherit;
7105
+ font-size: var(--alinea-font-size-base);
6699
7106
  text-overflow: ellipsis;
6700
7107
  white-space: nowrap;
6701
- min-width: 0;
7108
+ font-weight: 400;
7109
+ line-height: 24px;
6702
7110
  overflow: hidden;
6703
7111
  }
6704
7112
  .alinea-WorkspaceRoots-trigger {
@@ -2,6 +2,7 @@ import type { PreviewMetadata, PreviewPayload } from 'alinea/core/Preview';
2
2
  export declare enum PreviewAction {
3
3
  Ping = "[alinea-ping]",
4
4
  Pong = "[alinea-pong]",
5
+ Disconnect = "[alinea-disconnect]",
5
6
  Reload = "[alinea-reload]",
6
7
  Refetch = "[alinea-refetch]",
7
8
  Previous = "[alinea-previous]",
@@ -13,6 +14,8 @@ export type PreviewMessage = {
13
14
  action: PreviewAction.Ping;
14
15
  } | {
15
16
  action: PreviewAction.Pong;
17
+ } | {
18
+ action: PreviewAction.Disconnect;
16
19
  } | {
17
20
  action: PreviewAction.Reload;
18
21
  } | {
@@ -4,6 +4,7 @@ import "../chunks/chunk-CQ52GEHY.js";
4
4
  var PreviewAction = /* @__PURE__ */ ((PreviewAction2) => {
5
5
  PreviewAction2["Ping"] = "[alinea-ping]";
6
6
  PreviewAction2["Pong"] = "[alinea-pong]";
7
+ PreviewAction2["Disconnect"] = "[alinea-disconnect]";
7
8
  PreviewAction2["Reload"] = "[alinea-reload]";
8
9
  PreviewAction2["Refetch"] = "[alinea-refetch]";
9
10
  PreviewAction2["Previous"] = "[alinea-previous]";
@@ -3,4 +3,4 @@ export interface PreviewApi {
3
3
  preview(update: PreviewPayload): Promise<void>;
4
4
  setIsPreviewing(isPreviewing: boolean): void;
5
5
  }
6
- export declare function registerPreview(api: PreviewApi): (() => void) | undefined;
6
+ export declare function registerPreview(api: PreviewApi, hostOrigin: string): (() => void) | undefined;
@@ -2,22 +2,38 @@ import "../chunks/chunk-CQ52GEHY.js";
2
2
 
3
3
  // src/preview/RegisterPreview.ts
4
4
  import { PreviewAction } from "alinea/preview/PreviewMessage";
5
- function registerPreview(api) {
5
+ function registerPreview(api, hostOrigin) {
6
6
  if (typeof window === "undefined") return;
7
+ const host = window.parent !== window ? window.parent : window.opener;
8
+ if (!host) return;
7
9
  let observer = null;
8
- if (window.location !== window.parent.location) {
9
- window.parent.postMessage({ action: PreviewAction.Ping }, "*");
10
- addEventListener("message", handleMessage);
11
- console.info("[Alinea preview listener attached]");
12
- }
10
+ const checkHost = window.setInterval(() => {
11
+ if (host.closed) disconnect();
12
+ }, 1e3);
13
+ addEventListener("message", handleMessage);
14
+ host.postMessage({ action: PreviewAction.Ping }, hostOrigin);
15
+ console.info("[Alinea preview listener attached]");
13
16
  return () => {
17
+ clearInterval(checkHost);
14
18
  if (observer) observer.disconnect();
15
19
  removeEventListener("message", handleMessage);
16
20
  };
21
+ function disconnect() {
22
+ clearInterval(checkHost);
23
+ observer?.disconnect();
24
+ observer = null;
25
+ api.setIsPreviewing(false);
26
+ removeEventListener("message", handleMessage);
27
+ }
17
28
  function handleMessage(event) {
29
+ if (event.source !== host) return;
30
+ if (event.origin !== hostOrigin) return;
18
31
  if (!event.data || typeof event.data !== "object") return;
19
32
  const message = event.data;
20
33
  switch (message.action) {
34
+ case PreviewAction.Disconnect:
35
+ disconnect();
36
+ return;
21
37
  case PreviewAction.Preview:
22
38
  console.info("[Alinea preview received]");
23
39
  api.preview(message);
@@ -36,6 +52,7 @@ function registerPreview(api) {
36
52
  api.setIsPreviewing(true);
37
53
  try {
38
54
  fetchAndSendMetadata();
55
+ observer?.disconnect();
39
56
  observer = new MutationObserver(fetchAndSendMetadata);
40
57
  observer.observe(document.head, { childList: true });
41
58
  console.info("[Alinea meta data sent to parent]");
@@ -44,10 +61,11 @@ function registerPreview(api) {
44
61
  }
45
62
  }
46
63
  }
47
- }
48
- function fetchAndSendMetadata() {
49
- const meta = fetchMetadataFromDocument();
50
- window.parent.postMessage({ action: PreviewAction.Meta, ...meta }, "*");
64
+ function fetchAndSendMetadata() {
65
+ if (!host) return;
66
+ const meta = fetchMetadataFromDocument();
67
+ host.postMessage({ action: PreviewAction.Meta, ...meta }, hostOrigin);
68
+ }
51
69
  }
52
70
  function fetchMetadataFromDocument() {
53
71
  return {
@@ -1,4 +1,8 @@
1
1
  import { type PreviewApi } from './RegisterPreview.js';
2
- export declare function usePreview(api: Omit<PreviewApi, 'setIsPreviewing'>): {
2
+ export interface UsePreviewOptions {
3
+ hostOrigin: string;
4
+ preview: PreviewApi['preview'];
5
+ }
6
+ export declare function usePreview(options: UsePreviewOptions): {
3
7
  isPreviewing: boolean;
4
8
  };
@@ -3,18 +3,21 @@ import "../chunks/chunk-CQ52GEHY.js";
3
3
  // src/preview/react.ts
4
4
  import { useEffect, useRef, useState } from "react";
5
5
  import { registerPreview } from "./RegisterPreview.js";
6
- function usePreview(api) {
6
+ function usePreview(options) {
7
7
  const [isPreviewing, setIsPreviewing] = useState(false);
8
- const apiRef = useRef(api);
9
- apiRef.current = api;
8
+ const previewRef = useRef(options.preview);
9
+ previewRef.current = options.preview;
10
10
  useEffect(() => {
11
- return registerPreview({
12
- preview(update) {
13
- return apiRef.current.preview(update);
11
+ return registerPreview(
12
+ {
13
+ preview(update) {
14
+ return previewRef.current(update);
15
+ },
16
+ setIsPreviewing
14
17
  },
15
- setIsPreviewing
16
- });
17
- }, []);
18
+ options.hostOrigin
19
+ );
20
+ }, [options.hostOrigin]);
18
21
  return { isPreviewing };
19
22
  }
20
23
  export {