@alpaca-editor/core 1.0.3956 → 1.0.3959

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 (247) hide show
  1. package/build.css +1 -1
  2. package/dist/components/ui/badge.d.ts +9 -0
  3. package/dist/components/ui/badge.js +23 -0
  4. package/dist/components/ui/badge.js.map +1 -0
  5. package/dist/components/ui/button.js +3 -3
  6. package/dist/components/ui/button.js.map +1 -1
  7. package/dist/components/ui/command.d.ts +18 -0
  8. package/dist/components/ui/command.js +35 -0
  9. package/dist/components/ui/command.js.map +1 -0
  10. package/dist/components/ui/dialog.d.ts +15 -0
  11. package/dist/components/ui/dialog.js +37 -0
  12. package/dist/components/ui/dialog.js.map +1 -0
  13. package/dist/components/ui/dropdown-menu.d.ts +25 -0
  14. package/dist/components/ui/dropdown-menu.js +52 -0
  15. package/dist/components/ui/dropdown-menu.js.map +1 -0
  16. package/dist/components/ui/input.d.ts +3 -0
  17. package/dist/components/ui/input.js +7 -0
  18. package/dist/components/ui/input.js.map +1 -0
  19. package/dist/components/ui/menubar.d.ts +26 -0
  20. package/dist/components/ui/menubar.js +55 -0
  21. package/dist/components/ui/menubar.js.map +1 -0
  22. package/dist/components/ui/popover.d.ts +9 -0
  23. package/dist/components/ui/popover.js +63 -0
  24. package/dist/components/ui/popover.js.map +1 -0
  25. package/dist/components/ui/switch.d.ts +4 -0
  26. package/dist/components/ui/switch.js +9 -0
  27. package/dist/components/ui/switch.js.map +1 -0
  28. package/dist/components/ui/tooltip.d.ts +7 -0
  29. package/dist/components/ui/tooltip.js +18 -0
  30. package/dist/components/ui/tooltip.js.map +1 -0
  31. package/dist/config/config.js +79 -63
  32. package/dist/config/config.js.map +1 -1
  33. package/dist/config/types.d.ts +3 -3
  34. package/dist/editor/ContentTree.js +1 -1
  35. package/dist/editor/ContentTree.js.map +1 -1
  36. package/dist/editor/Editor.js +6 -2
  37. package/dist/editor/Editor.js.map +1 -1
  38. package/dist/editor/FieldList.js +1 -1
  39. package/dist/editor/FieldList.js.map +1 -1
  40. package/dist/editor/FieldListField.js +1 -1
  41. package/dist/editor/FieldListField.js.map +1 -1
  42. package/dist/editor/ImageEditor.js +16 -6
  43. package/dist/editor/ImageEditor.js.map +1 -1
  44. package/dist/editor/MainLayout.js +4 -4
  45. package/dist/editor/MainLayout.js.map +1 -1
  46. package/dist/editor/MobileLayout.js +3 -3
  47. package/dist/editor/MobileLayout.js.map +1 -1
  48. package/dist/editor/PictureEditor.js +29 -15
  49. package/dist/editor/PictureEditor.js.map +1 -1
  50. package/dist/editor/Titlebar.js +6 -11
  51. package/dist/editor/Titlebar.js.map +1 -1
  52. package/dist/editor/ai/GhostWriter.js +1 -1
  53. package/dist/editor/ai/GhostWriter.js.map +1 -1
  54. package/dist/editor/client/EditorClient.d.ts +4 -2
  55. package/dist/editor/client/EditorClient.js +32 -11
  56. package/dist/editor/client/EditorClient.js.map +1 -1
  57. package/dist/editor/client/editContext.d.ts +4 -1
  58. package/dist/editor/client/editContext.js.map +1 -1
  59. package/dist/editor/client/operations.js +2 -2
  60. package/dist/editor/client/pageModelBuilder.js +3 -6
  61. package/dist/editor/client/pageModelBuilder.js.map +1 -1
  62. package/dist/editor/commands/itemCommands.d.ts +2 -0
  63. package/dist/editor/commands/itemCommands.js +180 -0
  64. package/dist/editor/commands/itemCommands.js.map +1 -1
  65. package/dist/editor/field-types/MultiLineText.js +1 -1
  66. package/dist/editor/field-types/MultiLineText.js.map +1 -1
  67. package/dist/editor/field-types/SingleLineText.js +1 -1
  68. package/dist/editor/field-types/SingleLineText.js.map +1 -1
  69. package/dist/editor/menubar/ActiveUsers.js +98 -4
  70. package/dist/editor/menubar/ActiveUsers.js.map +1 -1
  71. package/dist/editor/menubar/{ActionsMenu.d.ts → ItemActionsMenu.d.ts} +1 -1
  72. package/dist/editor/menubar/ItemActionsMenu.js +23 -0
  73. package/dist/editor/menubar/ItemActionsMenu.js.map +1 -0
  74. package/dist/editor/menubar/ItemLanguageVersion.js +2 -2
  75. package/dist/editor/menubar/ItemLanguageVersion.js.map +1 -1
  76. package/dist/editor/menubar/LanguageSelector.d.ts +1 -2
  77. package/dist/editor/menubar/LanguageSelector.js +23 -23
  78. package/dist/editor/menubar/LanguageSelector.js.map +1 -1
  79. package/dist/editor/menubar/PageSelector.js +7 -8
  80. package/dist/editor/menubar/PageSelector.js.map +1 -1
  81. package/dist/editor/menubar/PageViewerControls.js +22 -19
  82. package/dist/editor/menubar/PageViewerControls.js.map +1 -1
  83. package/dist/editor/menubar/PreviewSecondaryControls.js +2 -3
  84. package/dist/editor/menubar/PreviewSecondaryControls.js.map +1 -1
  85. package/dist/editor/menubar/User.js +1 -1
  86. package/dist/editor/menubar/User.js.map +1 -1
  87. package/dist/editor/menubar/VersionSelector.js +36 -31
  88. package/dist/editor/menubar/VersionSelector.js.map +1 -1
  89. package/dist/editor/menubar/WorkflowButton.d.ts +1 -0
  90. package/dist/editor/menubar/WorkflowButton.js +41 -0
  91. package/dist/editor/menubar/WorkflowButton.js.map +1 -0
  92. package/dist/editor/page-editor-chrome/FrameMenu.js +5 -5
  93. package/dist/editor/page-editor-chrome/FrameMenu.js.map +1 -1
  94. package/dist/editor/page-editor-chrome/SuggestionHighlightings.js +2 -2
  95. package/dist/editor/page-editor-chrome/SuggestionHighlightings.js.map +1 -1
  96. package/dist/editor/page-viewer/EditorForm.d.ts +2 -1
  97. package/dist/editor/page-viewer/EditorForm.js +61 -49
  98. package/dist/editor/page-viewer/EditorForm.js.map +1 -1
  99. package/dist/editor/page-viewer/PageViewer.d.ts +2 -1
  100. package/dist/editor/page-viewer/PageViewer.js +28 -44
  101. package/dist/editor/page-viewer/PageViewer.js.map +1 -1
  102. package/dist/editor/page-viewer/PageViewerFrame.js +1 -1
  103. package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
  104. package/dist/editor/reviews/Comments.js +9 -9
  105. package/dist/editor/reviews/Comments.js.map +1 -1
  106. package/dist/editor/reviews/SuggestedEdit.js +3 -3
  107. package/dist/editor/services/contentService.d.ts +18 -0
  108. package/dist/editor/services/contentService.js +6 -0
  109. package/dist/editor/services/contentService.js.map +1 -1
  110. package/dist/editor/services/editService.d.ts +5 -0
  111. package/dist/editor/services/editService.js +4 -0
  112. package/dist/editor/services/editService.js.map +1 -1
  113. package/dist/editor/services/systemService.d.ts +2 -1
  114. package/dist/editor/services/systemService.js +4 -1
  115. package/dist/editor/services/systemService.js.map +1 -1
  116. package/dist/editor/sidebar/ComponentTree.js +26 -10
  117. package/dist/editor/sidebar/ComponentTree.js.map +1 -1
  118. package/dist/editor/sidebar/Divider.d.ts +6 -0
  119. package/dist/editor/sidebar/Divider.js +6 -0
  120. package/dist/editor/sidebar/Divider.js.map +1 -0
  121. package/dist/editor/sidebar/LeftToolbar.d.ts +1 -0
  122. package/dist/editor/sidebar/LeftToolbar.js +16 -0
  123. package/dist/editor/sidebar/LeftToolbar.js.map +1 -0
  124. package/dist/editor/sidebar/SEOInfo.d.ts +1 -0
  125. package/dist/editor/sidebar/SEOInfo.js +169 -0
  126. package/dist/editor/sidebar/SEOInfo.js.map +1 -0
  127. package/dist/editor/sidebar/Sidebar.js +1 -1
  128. package/dist/editor/sidebar/Sidebar.js.map +1 -1
  129. package/dist/editor/sidebar/SidebarView.d.ts +3 -2
  130. package/dist/editor/sidebar/SidebarView.js +22 -60
  131. package/dist/editor/sidebar/SidebarView.js.map +1 -1
  132. package/dist/editor/sidebar/ViewSelector.js +66 -20
  133. package/dist/editor/sidebar/ViewSelector.js.map +1 -1
  134. package/dist/editor/ui/Icons.d.ts +4 -0
  135. package/dist/editor/ui/Icons.js +15 -3
  136. package/dist/editor/ui/Icons.js.map +1 -1
  137. package/dist/editor/ui/Section.js +1 -1
  138. package/dist/editor/ui/Section.js.map +1 -1
  139. package/dist/editor/ui/SimpleIconButton.d.ts +1 -2
  140. package/dist/editor/ui/SimpleIconButton.js +8 -13
  141. package/dist/editor/ui/SimpleIconButton.js.map +1 -1
  142. package/dist/editor/ui/SimpleTabs.js +2 -2
  143. package/dist/editor/ui/SimpleTabs.js.map +1 -1
  144. package/dist/editor/ui/SimpleToolbar.js +1 -1
  145. package/dist/editor/ui/SimpleToolbar.js.map +1 -1
  146. package/dist/editor/ui/Splitter.d.ts +4 -0
  147. package/dist/editor/ui/Splitter.js +6 -7
  148. package/dist/editor/ui/Splitter.js.map +1 -1
  149. package/dist/editor/views/CompareView.js +16 -4
  150. package/dist/editor/views/CompareView.js.map +1 -1
  151. package/dist/editor/views/SingleEditView.d.ts +2 -1
  152. package/dist/editor/views/SingleEditView.js +2 -2
  153. package/dist/editor/views/SingleEditView.js.map +1 -1
  154. package/dist/page-wizard/steps/ContentStep.js +1 -1
  155. package/dist/page-wizard/steps/ContentStep.js.map +1 -1
  156. package/dist/revision.d.ts +2 -2
  157. package/dist/revision.js +2 -2
  158. package/dist/splash-screen/NewPage.js +8 -6
  159. package/dist/splash-screen/NewPage.js.map +1 -1
  160. package/dist/splash-screen/RecentPages.js +3 -8
  161. package/dist/splash-screen/RecentPages.js.map +1 -1
  162. package/dist/styles.css +1519 -543
  163. package/dist/tour/Tour.js +79 -10
  164. package/dist/tour/Tour.js.map +1 -1
  165. package/dist/tour/default-tour.js +55 -45
  166. package/dist/tour/default-tour.js.map +1 -1
  167. package/dist/types.d.ts +19 -1
  168. package/package.json +13 -5
  169. package/src/components/ui/badge.tsx +46 -0
  170. package/src/components/ui/button.tsx +3 -3
  171. package/src/components/ui/command.tsx +184 -0
  172. package/src/components/ui/dialog.tsx +143 -0
  173. package/src/components/ui/dropdown-menu.tsx +257 -0
  174. package/src/components/ui/input.tsx +21 -0
  175. package/src/components/ui/menubar.tsx +276 -0
  176. package/src/components/ui/popover.tsx +113 -0
  177. package/src/components/ui/switch.tsx +31 -0
  178. package/src/components/ui/tooltip.tsx +61 -0
  179. package/src/config/config.tsx +102 -65
  180. package/src/config/types.ts +3 -3
  181. package/src/editor/ContentTree.tsx +1 -1
  182. package/src/editor/Editor.tsx +8 -2
  183. package/src/editor/FieldList.tsx +2 -2
  184. package/src/editor/FieldListField.tsx +1 -1
  185. package/src/editor/ImageEditor.tsx +44 -21
  186. package/src/editor/MainLayout.tsx +21 -16
  187. package/src/editor/MobileLayout.tsx +3 -2
  188. package/src/editor/PictureEditor.tsx +74 -45
  189. package/src/editor/Titlebar.tsx +12 -24
  190. package/src/editor/ai/GhostWriter.tsx +1 -1
  191. package/src/editor/client/EditorClient.tsx +55 -13
  192. package/src/editor/client/editContext.ts +5 -0
  193. package/src/editor/client/operations.ts +2 -2
  194. package/src/editor/client/pageModelBuilder.ts +3 -7
  195. package/src/editor/commands/itemCommands.tsx +272 -0
  196. package/src/editor/field-types/MultiLineText.tsx +1 -1
  197. package/src/editor/field-types/SingleLineText.tsx +1 -1
  198. package/src/editor/menubar/ActiveUsers.tsx +271 -5
  199. package/src/editor/menubar/ItemActionsMenu.tsx +89 -0
  200. package/src/editor/menubar/ItemLanguageVersion.tsx +7 -5
  201. package/src/editor/menubar/LanguageSelector.tsx +105 -134
  202. package/src/editor/menubar/PageSelector.tsx +25 -27
  203. package/src/editor/menubar/PageViewerControls.tsx +126 -78
  204. package/src/editor/menubar/PreviewSecondaryControls.tsx +0 -2
  205. package/src/editor/menubar/User.tsx +2 -2
  206. package/src/editor/menubar/VersionSelector.tsx +124 -99
  207. package/src/editor/menubar/WorkflowButton.tsx +115 -0
  208. package/src/editor/page-editor-chrome/FrameMenu.tsx +5 -5
  209. package/src/editor/page-editor-chrome/SuggestionHighlightings.tsx +2 -2
  210. package/src/editor/page-viewer/EditorForm.tsx +112 -87
  211. package/src/editor/page-viewer/PageViewer.tsx +75 -92
  212. package/src/editor/page-viewer/PageViewerFrame.tsx +1 -1
  213. package/src/editor/reviews/Comments.tsx +19 -20
  214. package/src/editor/reviews/SuggestedEdit.tsx +3 -3
  215. package/src/editor/services/contentService.ts +28 -0
  216. package/src/editor/services/editService.ts +12 -0
  217. package/src/editor/services/systemService.ts +5 -2
  218. package/src/editor/sidebar/ComponentTree.tsx +34 -12
  219. package/src/editor/sidebar/Divider.tsx +22 -0
  220. package/src/editor/sidebar/LeftToolbar.tsx +36 -0
  221. package/src/editor/sidebar/SEOInfo.tsx +265 -0
  222. package/src/editor/sidebar/Sidebar.tsx +1 -0
  223. package/src/editor/sidebar/SidebarView.tsx +77 -111
  224. package/src/editor/sidebar/ViewSelector.tsx +211 -43
  225. package/src/editor/ui/Icons.tsx +155 -10
  226. package/src/editor/ui/Section.tsx +1 -1
  227. package/src/editor/ui/SimpleIconButton.tsx +30 -28
  228. package/src/editor/ui/SimpleTabs.tsx +3 -3
  229. package/src/editor/ui/SimpleToolbar.tsx +1 -1
  230. package/src/editor/ui/Splitter.tsx +14 -7
  231. package/src/editor/views/CompareView.tsx +23 -11
  232. package/src/editor/views/SingleEditView.tsx +3 -0
  233. package/src/page-wizard/steps/ContentStep.tsx +0 -1
  234. package/src/revision.ts +2 -2
  235. package/src/splash-screen/NewPage.tsx +18 -13
  236. package/src/splash-screen/RecentPages.tsx +4 -10
  237. package/src/tour/Tour.tsx +125 -34
  238. package/src/tour/default-tour.tsx +55 -45
  239. package/src/types.ts +21 -1
  240. package/styles.css +301 -1
  241. package/dist/editor/menubar/ActionsMenu.js +0 -49
  242. package/dist/editor/menubar/ActionsMenu.js.map +0 -1
  243. package/dist/editor/menubar/SecondaryControls.d.ts +0 -1
  244. package/dist/editor/menubar/SecondaryControls.js +0 -17
  245. package/dist/editor/menubar/SecondaryControls.js.map +0 -1
  246. package/src/editor/menubar/ActionsMenu.tsx +0 -94
  247. package/src/editor/menubar/SecondaryControls.tsx +0 -45
@@ -28,15 +28,11 @@ import { Sessions } from "../editor/sidebar/Sessions";
28
28
  import { Workbox } from "../editor/sidebar/Workbox";
29
29
  import { DictionaryEditor } from "../editor/sidebar/DictionaryEditor";
30
30
  import {
31
- BugIcon,
32
31
  EditIcon,
33
32
  GraphQLIcon,
34
33
  JsonIcon,
35
34
  PageWizardIcon,
36
35
  TreeIcon,
37
- WizardIcon,
38
- WorkboxIcon,
39
- UsersIcon,
40
36
  } from "../editor/ui/Icons";
41
37
  import { Debug } from "../editor/sidebar/Debug";
42
38
  import { GraphQL } from "../editor/sidebar/GraphQL";
@@ -65,6 +61,8 @@ import {
65
61
  publishItemCommand,
66
62
  renameItemCommand,
67
63
  duplicateItemCommand,
64
+ exportItemsCommand,
65
+ importItemsCommand,
68
66
  } from "../editor/commands/itemCommands";
69
67
  import { loadInsertOptions } from "../editor/services/editService";
70
68
  import { getDefaultTourSteps } from "../tour/default-tour";
@@ -103,20 +101,24 @@ import { ImageFieldEditor } from "../editor/field-types/ImageFieldEditor";
103
101
 
104
102
  import {
105
103
  BookA,
104
+ ClockIcon,
105
+ FolderTreeIcon,
106
106
  Ghost,
107
+ InboxIcon,
107
108
  Languages,
108
109
  Layers,
109
110
  MessageCircleMore,
110
111
  Settings,
112
+ SparklesIcon,
113
+ Users,
114
+ Bug,
111
115
  } from "lucide-react";
112
116
  import { GhostWriter } from "../editor/ai/GhostWriter";
113
- import { SecondaryControls } from "../editor/menubar/SecondaryControls";
114
117
 
115
118
  import { Command } from "../editor/commands/commands";
116
- import { PreviewSecondaryControls } from "../editor/menubar/PreviewSecondaryControls";
117
- import { AboutDialog } from "../editor/client/AboutDialog";
118
119
  import { NewPage } from "../splash-screen/NewPage";
119
120
  import { OpenPage } from "../splash-screen/OpenPage";
121
+ import { WorkflowButton } from "../editor/menubar/WorkflowButton";
120
122
  const defaultRichTextEditorProfile: RichTextEditorProfile = {
121
123
  toolbar: {
122
124
  groups: [
@@ -160,23 +162,30 @@ const pageEditorRightSidebar = {
160
162
  content: <ComponentTree />,
161
163
  initialSize: 20,
162
164
  },
163
- {
164
- name: "history",
165
- icon: "pi pi-clock",
166
- title: "History",
167
- content: <EditHistory />,
168
- initialSize: 15,
169
- },
170
165
  ],
171
166
  };
172
167
 
173
168
  const editView = <EditView />;
174
- const editPrimaryControls = <PageViewerControls />;
175
- const itemPageEditorSecondaryControls = <SecondaryControls />;
169
+ const editToolbar = <PageViewerControls />;
170
+
171
+ // Example of a simple toolbar with just primary controls
172
+ const simpleToolbar = (
173
+ <div className="flex w-full items-center border-b bg-gray-50 px-4 py-2">
174
+ <PageViewerControls />
175
+ </div>
176
+ );
177
+
178
+ // Example of a custom toolbar for specific view
179
+ const debugToolbar = (
180
+ <div className="flex w-full items-center justify-between border-b bg-gray-100 px-4 py-2">
181
+ <div className="flex items-center gap-2">
182
+ <span className="text-sm font-medium text-gray-600">Debug Mode</span>
183
+ </div>
184
+ </div>
185
+ );
176
186
 
177
187
  const pageEditorViewBase = {
178
- primaryControls: editPrimaryControls,
179
- secondaryControls: itemPageEditorSecondaryControls,
188
+ toolbar: editToolbar,
180
189
  rightSidebar: pageEditorRightSidebar,
181
190
  defaultCenterPanelView: editView,
182
191
  };
@@ -217,6 +226,8 @@ export const getConfiguration = (): EditorConfiguration => {
217
226
  duplicateItemCommand as Command<{ items: FullItem[] }>,
218
227
  copyItemsCommand as Command<{ items: FullItem[] }>,
219
228
  moveItemsCommand as Command<{ items: FullItem[] }>,
229
+ exportItemsCommand,
230
+ importItemsCommand,
220
231
  ],
221
232
  reviewcommands: [approveReviewCommand, rejectReviewCommand],
222
233
  },
@@ -384,6 +395,7 @@ export const getConfiguration = (): EditorConfiguration => {
384
395
  expandTreeNode: "bafb88a1-506a-4671-b47b-1947730d25f6",
385
396
  },
386
397
  },
398
+ defaultPinnedViews: ["ai", "content-editor"],
387
399
  views: [
388
400
  {
389
401
  name: "splash-screen",
@@ -413,6 +425,7 @@ export const getConfiguration = (): EditorConfiguration => {
413
425
  name: "page-editor",
414
426
  title: "Edit",
415
427
  icon: <EditIcon />,
428
+ hidden: true,
416
429
  ...pageEditorViewBase,
417
430
  },
418
431
  // {
@@ -434,14 +447,14 @@ export const getConfiguration = (): EditorConfiguration => {
434
447
  // },
435
448
  {
436
449
  name: "ai",
437
- title: "AI",
438
- icon: <WizardIcon />,
450
+ title: "Agent",
451
+ icon: <SparklesIcon strokeWidth={1} />,
439
452
  leftSidebar: {
440
453
  panels: [
441
454
  {
442
455
  name: "ai-terminal",
443
456
  icon: "pi pi-comments",
444
- title: "AI",
457
+ title: "Agent",
445
458
  content: <EditorAiTerminal />,
446
459
  initialSize: 70,
447
460
  noOverflow: true,
@@ -450,9 +463,26 @@ export const getConfiguration = (): EditorConfiguration => {
450
463
  },
451
464
  ...pageEditorViewBase,
452
465
  },
466
+ {
467
+ name: "history",
468
+ title: "History",
469
+ icon: <ClockIcon strokeWidth={1} />,
470
+ leftSidebar: {
471
+ panels: [
472
+ {
473
+ name: "history",
474
+ icon: <ClockIcon strokeWidth={1} />,
475
+ title: "History",
476
+ content: <EditHistory />,
477
+ initialSize: 15,
478
+ },
479
+ ],
480
+ },
481
+ ...pageEditorViewBase,
482
+ },
453
483
  {
454
484
  name: "translate",
455
- icon: <Languages />,
485
+ icon: <Languages strokeWidth={1} />,
456
486
  title: "Translate",
457
487
  leftSidebar: {
458
488
  panels: [
@@ -470,7 +500,7 @@ export const getConfiguration = (): EditorConfiguration => {
470
500
  {
471
501
  name: "reviews",
472
502
  title: "Reviews",
473
- icon: <MessageCircleMore />,
503
+ icon: <MessageCircleMore strokeWidth={1} />,
474
504
  leftSidebar: {
475
505
  panels: [
476
506
  {
@@ -496,7 +526,7 @@ export const getConfiguration = (): EditorConfiguration => {
496
526
  {
497
527
  name: "publish",
498
528
  title: "Publish",
499
- icon: <WorkboxIcon />,
529
+ icon: <InboxIcon strokeWidth={1} />,
500
530
 
501
531
  leftSidebar: {
502
532
  panels: [
@@ -522,7 +552,7 @@ export const getConfiguration = (): EditorConfiguration => {
522
552
  {
523
553
  name: "content-editor",
524
554
  title: "Content Editor",
525
- icon: <TreeIcon />,
555
+ icon: <FolderTreeIcon strokeWidth={1} />,
526
556
  defaultCenterPanelView: editView,
527
557
  leftSidebar: {
528
558
  panels: [
@@ -536,14 +566,13 @@ export const getConfiguration = (): EditorConfiguration => {
536
566
  ],
537
567
  },
538
568
  rightSidebar: pageEditorRightSidebar,
539
- primaryControls: editPrimaryControls,
540
- secondaryControls: itemPageEditorSecondaryControls,
569
+ toolbar: editToolbar,
541
570
  },
542
571
 
543
572
  {
544
573
  name: "dictionary",
545
574
  title: "Dictionary",
546
- icon: <BookA />,
575
+ icon: <BookA strokeWidth={1} />,
547
576
  leftSidebar: {
548
577
  panels: [
549
578
  {
@@ -560,7 +589,7 @@ export const getConfiguration = (): EditorConfiguration => {
560
589
  {
561
590
  name: "sessions",
562
591
  title: "Sessions",
563
- icon: <UsersIcon />,
592
+ icon: <Users strokeWidth={1} />,
564
593
  leftSidebar: {
565
594
  panels: [
566
595
  {
@@ -577,8 +606,8 @@ export const getConfiguration = (): EditorConfiguration => {
577
606
  {
578
607
  name: "debug",
579
608
  title: "Debug",
580
- icon: <BugIcon />,
581
-
609
+ icon: <Bug strokeWidth={1} />,
610
+ toolbar: debugToolbar,
582
611
  leftSidebar: {
583
612
  panels: [
584
613
  {
@@ -611,7 +640,8 @@ export const getConfiguration = (): EditorConfiguration => {
611
640
  },
612
641
  ],
613
642
  },
614
- ...pageEditorViewBase,
643
+ rightSidebar: pageEditorRightSidebar,
644
+ defaultCenterPanelView: editView,
615
645
  },
616
646
  // {
617
647
  // name: "component-designer",
@@ -677,14 +707,14 @@ export const getConfiguration = (): EditorConfiguration => {
677
707
  {
678
708
  name: "control-center",
679
709
  title: "Control Center",
680
- icon: <Settings />,
710
+ icon: <Settings strokeWidth={1} />,
681
711
  defaultCenterPanelView: <Status />,
682
712
  menuBar: <></>,
683
713
  },
684
714
  ],
685
715
 
686
716
  titlebar: <Titlebar />,
687
- actionsMenu: {
717
+ itemActionsMenu: {
688
718
  itemsFactory: (editContext: EditContextType): MenuItemGroup[] => {
689
719
  const groups: MenuItemGroup[] = [];
690
720
 
@@ -751,36 +781,36 @@ export const getConfiguration = (): EditorConfiguration => {
751
781
  ],
752
782
  });
753
783
 
754
- groups.push({
755
- id: "about",
756
- label: "About",
757
- items: [
758
- {
759
- id: "about",
760
- label: "About",
761
- icon: "pi pi-info-circle",
762
- command: async () => {
763
- editContext.openDialog(AboutDialog, {});
764
- },
765
- },
766
- ],
767
- });
768
-
769
- groups.push({
770
- id: "account",
771
- label: "Account",
772
- items: [
773
- {
774
- id: "logout",
775
- label: "Log Out",
776
- icon: "pi pi-sign-out",
777
- command: async () => {
778
- // Redirect to Sitecore logout endpoint
779
- window.location.href = "/sitecore/login?action=logout";
780
- },
781
- },
782
- ],
783
- });
784
+ // groups.push({
785
+ // id: "about",
786
+ // label: "About",
787
+ // items: [
788
+ // {
789
+ // id: "about",
790
+ // label: "About",
791
+ // icon: "pi pi-info-circle",
792
+ // command: async () => {
793
+ // editContext.openDialog(AboutDialog, {});
794
+ // },
795
+ // },
796
+ // ],
797
+ // });
798
+
799
+ // groups.push({
800
+ // id: "account",
801
+ // label: "Account",
802
+ // items: [
803
+ // {
804
+ // id: "logout",
805
+ // label: "Log Out",
806
+ // icon: "pi pi-sign-out",
807
+ // command: async () => {
808
+ // // Redirect to Sitecore logout endpoint
809
+ // window.location.href = "/sitecore/login?action=logout";
810
+ // },
811
+ // },
812
+ // ],
813
+ // });
784
814
 
785
815
  return groups;
786
816
  },
@@ -888,6 +918,13 @@ export function configureForUser(
888
918
  user: User,
889
919
  ): EditorConfiguration {
890
920
  if (user.isLimitedPreviewUser) {
921
+ const previewToolbar = (
922
+ <div className="flex w-full items-center justify-between border-b bg-gray-50 px-4 py-2">
923
+ <PageViewerControls />
924
+ <WorkflowButton />
925
+ </div>
926
+ );
927
+
891
928
  return {
892
929
  ...configuration,
893
930
  activeTour: "preview",
@@ -907,7 +944,7 @@ export function configureForUser(
907
944
  ),
908
945
  ],
909
946
  },
910
- secondaryControls: <PreviewSecondaryControls />,
947
+ toolbar: previewToolbar,
911
948
  };
912
949
  }),
913
950
  },
@@ -79,8 +79,7 @@ export type EditorView = {
79
79
  leftSidebar?: Sidebar;
80
80
  rightSidebar?: Sidebar;
81
81
  hidden?: boolean;
82
- primaryControls?: ReactNode;
83
- secondaryControls?: ReactNode;
82
+ toolbar?: ReactNode;
84
83
  hideViewSelector?: boolean;
85
84
  visible?: (editContext: EditContextType) => boolean;
86
85
  beforeClose?: (editContext: EditContextType) => Promise<boolean>;
@@ -161,7 +160,8 @@ export type EditorConfiguration = {
161
160
  };
162
161
  };
163
162
  views: EditorView[];
164
- actionsMenu?: {
163
+ defaultPinnedViews?: string[];
164
+ itemActionsMenu?: {
165
165
  itemsFactory: (editContext: EditContextType) => MenuItemGroup[];
166
166
  };
167
167
  mainNavigation?: (MenuItem | Command<any>)[];
@@ -698,7 +698,7 @@ export default function ContentTree({
698
698
  );
699
699
  if (!memoizedTreeNodes.length)
700
700
  return (
701
- <div className="flex h-full items-center justify-center gap-2 bg-gray-50 text-xs text-gray-500">
701
+ <div className="flex h-full items-center justify-center gap-2 text-xs text-gray-500">
702
702
  <Spinner size="2xl" /> Loading...
703
703
  </div>
704
704
  );
@@ -5,10 +5,10 @@ import { EditorClient } from "./client/EditorClient";
5
5
  import { ItemDescriptor } from "./pageModel";
6
6
  import { EditorConfiguration } from "../config/types";
7
7
  import { useEffect, useState } from "react";
8
- import { SystemStatus, UserInfo } from "../types";
8
+ import { SystemStatus, UserInfo, UserPreferences } from "../types";
9
9
 
10
10
  import { getUserInfo } from "./services/editService";
11
- import { getSystemStatus } from "./services/systemService";
11
+ import { getSystemStatus, saveUserPreferences } from "./services/systemService";
12
12
  import uuid from "react-uuid";
13
13
  import { getConfiguration } from "../config/config";
14
14
 
@@ -85,6 +85,12 @@ export function Editor({
85
85
  item={page}
86
86
  sessionId={sessionId}
87
87
  userInfo={userInfo}
88
+ userPreferences={userInfo.preferences}
89
+ setUserPreferences={(preferences: Partial<UserPreferences>) => {
90
+ const newPreferences = { ...userInfo.preferences, ...preferences };
91
+ saveUserPreferences(newPreferences);
92
+ setUserInfo({ ...userInfo, preferences: newPreferences });
93
+ }}
88
94
  ></EditorClient>
89
95
  );
90
96
  }
@@ -45,8 +45,8 @@ export function FieldList({
45
45
  if (!fields) return;
46
46
 
47
47
  return (
48
- <div>
49
- <div className="tour-field-list sticky top-0 z-10 ml-[1px] flex items-center gap-2 border-y border-gray-200 bg-gray-50 p-2">
48
+ <div className="text-dark">
49
+ <div className="tour-field-list sticky top-0 z-10 ml-[1px] flex items-center gap-2 border-y border-gray-200 bg-white p-2">
50
50
  <i className="pi pi-search" />
51
51
  <div className="text-xs">Filter</div>
52
52
  <InputText
@@ -224,7 +224,7 @@ export default function FieldListField({
224
224
 
225
225
  <div className="flex-1">
226
226
  <div className="flex min-h-7 flex-wrap items-center gap-x-3 gap-y-1">
227
- <label className="block text-xs font-bold select-text">
227
+ <label className="block text-xs font-medium select-text">
228
228
  {title || field.displayName || field.name}
229
229
  </label>
230
230
 
@@ -3,6 +3,13 @@ import { useEditContext } from "./client/editContext";
3
3
  import { ImageField } from "./fieldTypes";
4
4
  //import { useDialog } from "./client/DialogContext";
5
5
  import { ClientFieldButton } from "../config/types";
6
+ import {
7
+ DropdownMenu,
8
+ DropdownMenuContent,
9
+ DropdownMenuItem,
10
+ DropdownMenuTrigger,
11
+ } from "../components/ui/dropdown-menu";
12
+ import { MagicEditIcon } from "./ui/Icons";
6
13
 
7
14
  export function ImageEditor({
8
15
  field,
@@ -11,7 +18,7 @@ export function ImageEditor({
11
18
  field: ImageField;
12
19
  style?: React.CSSProperties;
13
20
  }) {
14
- const [showMenu, setShowMenu] = useState(true);
21
+ const [showMenu, setShowMenu] = useState(false);
15
22
  const editContext = useEditContext();
16
23
  //const dialogContext = useDialog();
17
24
 
@@ -59,8 +66,6 @@ export function ImageEditor({
59
66
  <>
60
67
  <div
61
68
  className="absolute inset-0 flex items-center justify-center"
62
- onMouseEnter={() => setShowMenu(true)}
63
- onMouseLeave={() => setShowMenu(false)}
64
69
  style={style}
65
70
  data-testid="select-media"
66
71
  >
@@ -71,33 +76,51 @@ export function ImageEditor({
71
76
  className="max-h-full max-w-full object-contain"
72
77
  />
73
78
  )}
74
- {showMenu && (
75
- <div className="absolute inset-0 grid grid-cols-1 items-center justify-center gap-1.5 bg-black/50 p-3 text-sm">
76
- <Btn
77
- label={getImageSrc() ? "Change Image" : "Select Image"}
78
- icon="pi pi-image"
79
- onClick={() => selectMedia()}
80
- testId="select-media-button"
81
- className="min-w-[80px]"
82
- />
79
+
80
+ {/* Dropdown menu with button in bottom right corner */}
81
+ <DropdownMenu open={showMenu} onOpenChange={setShowMenu}>
82
+ <DropdownMenuTrigger asChild>
83
+ <button
84
+ className="text-dark border-gray-3 hover:bg-gray-5 absolute right-2 bottom-2 flex items-center justify-center gap-2 border bg-white p-2 opacity-70 shadow-lg transition-opacity hover:opacity-85"
85
+ onClick={(e) => {
86
+ e.stopPropagation();
87
+ }}
88
+ data-testid="menu-toggle-button"
89
+ >
90
+ <MagicEditIcon /> Edit
91
+ </button>
92
+ </DropdownMenuTrigger>
93
+ <DropdownMenuContent align="end" side="top" sideOffset={8}>
94
+ <DropdownMenuItem
95
+ onClick={() => {
96
+ selectMedia();
97
+ setShowMenu(false);
98
+ }}
99
+ >
100
+ <i className="pi pi-image" />
101
+ {getImageSrc() ? "Change Image" : "Select Image"}
102
+ </DropdownMenuItem>
103
+
83
104
  {editContext?.configuration?.fieldTypes["image"]?.buttons?.map(
84
105
  (button: ClientFieldButton) => (
85
- <Btn
106
+ <DropdownMenuItem
86
107
  key={button.id}
87
- label={button.label}
88
- icon={button.icon}
89
- onClick={() =>
108
+ onClick={() => {
90
109
  button?.clientAction?.({
91
110
  field,
92
111
  editContext,
93
112
  //dialogContext,
94
- })
95
- }
96
- />
113
+ });
114
+ setShowMenu(false);
115
+ }}
116
+ >
117
+ <i className={button.icon} />
118
+ {button.label}
119
+ </DropdownMenuItem>
97
120
  ),
98
121
  )}
99
- </div>
100
- )}
122
+ </DropdownMenuContent>
123
+ </DropdownMenu>
101
124
  </div>
102
125
  </>
103
126
  );
@@ -4,7 +4,7 @@ import { classNames } from "primereact/utils";
4
4
  import { useEditContext } from "./client/editContext";
5
5
  import { SidebarView } from "./sidebar/SidebarView";
6
6
  import { Splitter, SplitterPanel } from "./ui/Splitter";
7
- import { ViewSelector } from "./sidebar/ViewSelector";
7
+ import { LeftToolbar } from "./sidebar/LeftToolbar";
8
8
  import { Layers } from "lucide-react";
9
9
  import { MobileLayout } from "./MobileLayout";
10
10
 
@@ -44,6 +44,7 @@ export default function MainLayout(props: MainLayoutProps) {
44
44
  sidebar={v.leftSidebar!}
45
45
  editContext={editContext}
46
46
  active={props.view.name === v.name && !!v.leftSidebar}
47
+ onClose={() => editContext.switchView("page-editor")}
47
48
  />
48
49
  ))}
49
50
  </div>
@@ -61,7 +62,7 @@ export default function MainLayout(props: MainLayoutProps) {
61
62
  name: "rightSidebar",
62
63
  defaultSize: 250,
63
64
  content: props.rightSidebar,
64
- collapsible: true,
65
+ collapsible: false,
65
66
  });
66
67
  }
67
68
 
@@ -72,21 +73,25 @@ export default function MainLayout(props: MainLayoutProps) {
72
73
  }
73
74
 
74
75
  return (
75
- <div className={classNames("flex flex-col select-none", className)}>
76
- {editContext?.configuration.editor.titlebar}
76
+ <div className={classNames("flex select-none", className)}>
77
77
  <div className="flex flex-1">
78
- {!props.view.hideViewSelector && <ViewSelector />}
79
- <div className="flex-1">
80
- <Splitter
81
- localStorageKey="editor.panelSizes"
82
- expandLabel={
83
- <div className="flex items-center justify-center">
84
- <Layers size={14} />
85
- <div className="mt-3">{props.rightSidebarTitle} </div>
86
- </div>
87
- }
88
- panels={panels}
89
- />
78
+ {!props.view.hideViewSelector && <LeftToolbar />}
79
+ <div className="flex flex-1 flex-col">
80
+ {editContext?.configuration.editor.titlebar}
81
+ {editContext?.view?.toolbar}
82
+ <div className="bg-gray-4 flex-1">
83
+ <Splitter
84
+ localStorageKey="editor.panelSizes"
85
+ splitterClassName="bg-transparent"
86
+ expandLabel={
87
+ <div className="flex items-center justify-center">
88
+ <Layers size={14} />
89
+ <div className="mt-3">{props.rightSidebarTitle} </div>
90
+ </div>
91
+ }
92
+ panels={panels}
93
+ />
94
+ </div>
90
95
  </div>
91
96
  </div>
92
97
  {/* sidebars already rendered above; no hidden cache needed */}
@@ -1,6 +1,6 @@
1
1
  import { cn } from "../lib/utils";
2
2
  import { MainLayoutProps } from "./MainLayout";
3
- import { ViewSelector } from "./sidebar/ViewSelector";
3
+ import { LeftToolbar } from "./sidebar/LeftToolbar";
4
4
  import { useEditContext } from "./client/editContext";
5
5
  import { Splitter, SplitterPanel } from "./ui/Splitter";
6
6
  import { SidebarView } from "./sidebar/SidebarView";
@@ -41,6 +41,7 @@ export function MobileLayout(props: MainLayoutProps) {
41
41
  sidebar={v.leftSidebar!}
42
42
  editContext={editContext}
43
43
  active={props.view.name === v.name && !!v.leftSidebar}
44
+ onClose={() => editContext.switchView("page-editor")}
44
45
  />
45
46
  ))}
46
47
  </div>
@@ -58,7 +59,7 @@ export function MobileLayout(props: MainLayoutProps) {
58
59
  localStorageKey="mobile-layout-splitter"
59
60
  />
60
61
 
61
- {!props.view.hideViewSelector && <ViewSelector />}
62
+ {!props.view.hideViewSelector && <LeftToolbar />}
62
63
  {/* <div className="text-2xs fixed right-0 bottom-0 z-50 flex flex-col rounded-tl-2xl bg-gray-50/70 px-1 pt-1 text-center font-mono text-gray-400">
63
64
  <div title={buildDate}>{version}</div>
64
65
  </div> */}