@backmatter/studio 0.0.13 → 0.0.15

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 (41) hide show
  1. package/dist/chunks/{UiKitApp-ZZXQt3zy.js → UiKitApp-BDsrXN12.js} +323 -321
  2. package/dist/chunks/{WorkspaceRoutes-CCDPtLla.js → WorkspaceRoutes-BTZ1Ah4F.js} +33286 -33321
  3. package/dist/chunks/{dashboard-Dw0zfTXg.js → dashboard-FT7dm5wi.js} +2 -2
  4. package/dist/chunks/{index-DhZGCAru.js → index-DHJvh5Uy.js} +1 -1
  5. package/dist/dashboard.js +2 -2
  6. package/dist/index.js +51 -52
  7. package/dist/site-widget.js +9547 -10892
  8. package/package.json +2 -2
  9. package/src/api.ts +8 -26
  10. package/src/chat/ChangeCard.tsx +2 -10
  11. package/src/chat/ChatMessage.tsx +24 -19
  12. package/src/chat/ChatProvider.tsx +17 -15
  13. package/src/chat/DocListCard.tsx +2 -16
  14. package/src/chat/MentionPopover.tsx +8 -9
  15. package/src/chat/PointerChip.tsx +1 -1
  16. package/src/chat/chat-context.ts +7 -7
  17. package/src/chat/chat-helpers.ts +57 -14
  18. package/src/chrome/CommandPalette.tsx +2 -10
  19. package/src/chrome/ContentExplorerSidebar.tsx +51 -88
  20. package/src/chrome/EditorFocusContext.tsx +3 -3
  21. package/src/chrome/EditorStatusContext.tsx +0 -3
  22. package/src/chrome/WorkspaceNavContext.tsx +0 -2
  23. package/src/chrome/WorkspaceStatusBar.tsx +6 -23
  24. package/src/chrome/content-api-url.ts +3 -12
  25. package/src/chrome/content-repo-path.ts +8 -25
  26. package/src/chrome/content-type-groups.ts +0 -3
  27. package/src/chrome/folder-create-context.ts +15 -39
  28. package/src/pages/DocEditorPage.tsx +17 -33
  29. package/src/pages/EmbedChatPage.tsx +3 -3
  30. package/src/pages/EmbedPublishPage.tsx +2 -3
  31. package/src/pages/LegacyWorkspaceRedirect.tsx +2 -9
  32. package/src/pages/WorkspaceLayout.tsx +0 -5
  33. package/src/pages/preview-url.ts +6 -20
  34. package/src/pages/type-docs.ts +3 -6
  35. package/src/preview-frame.tsx +10 -4
  36. package/src/replica/store.ts +2 -10
  37. package/src/replica/types.ts +1 -2
  38. package/src/site-bar.tsx +3 -6
  39. package/src/site-dashboard-href.ts +1 -3
  40. package/src/site-widget.tsx +2 -3
  41. package/src/workspace-path.ts +3 -23
@@ -27,7 +27,6 @@ import { applyThemeClass } from "./theme/apply-theme-class";
27
27
  import { TooltipProvider } from "./ui/Tooltip";
28
28
 
29
29
  export type SiteWidgetDoc = {
30
- locale: string;
31
30
  type: string;
32
31
  slug: string;
33
32
  workspaceId: string;
@@ -200,12 +199,12 @@ function DocFocus({ doc }: { doc: SiteWidgetDoc }) {
200
199
  const { setFocus } = useEditorFocus();
201
200
  useEffect(() => {
202
201
  setFocus({
203
- docRef: { locale: doc.locale, type: doc.type, slug: doc.slug },
202
+ docRef: { type: doc.type, slug: doc.slug },
204
203
  frontmatter: {},
205
204
  body: "",
206
205
  selection: null,
207
206
  });
208
- }, [doc.locale, doc.type, doc.slug, setFocus]);
207
+ }, [doc.type, doc.slug, setFocus]);
209
208
  return null;
210
209
  }
211
210
 
@@ -7,18 +7,8 @@ export function contentTypePath(slug: string, type: string) {
7
7
  return `/${slug}/content/${type}`;
8
8
  }
9
9
 
10
- export function contentDocPath(
11
- slug: string,
12
- type: string,
13
- docSlug: string,
14
- locale: string,
15
- defaultLocale: string,
16
- ) {
17
- const path = `/${slug}/content/${type}/${docSlug}`;
18
- if (locale && locale !== defaultLocale) {
19
- return `${path}?locale=${encodeURIComponent(locale)}`;
20
- }
21
- return path;
10
+ export function contentDocPath(slug: string, type: string, docSlug: string) {
11
+ return `/${slug}/content/${type}/${docSlug}`;
22
12
  }
23
13
 
24
14
  export function mediaPath(slug: string) {
@@ -50,11 +40,7 @@ export function cmsWorkspaceSlug(pathname: string): string | null {
50
40
  return first;
51
41
  }
52
42
 
53
- export function rewriteLegacyWorkspacePath(
54
- pathname: string,
55
- slug: string,
56
- defaultLocale = "en",
57
- ): string {
43
+ export function rewriteLegacyWorkspacePath(pathname: string, slug: string): string {
58
44
  const rest = pathname.match(/^\/workspaces\/[^/]+(?:\/(.*))?$/)?.[1] ?? "";
59
45
  if (!rest) return workspaceHomePath(slug);
60
46
  const types = rest.match(/^types\/([^/]+)\/?$/);
@@ -65,8 +51,6 @@ export function rewriteLegacyWorkspacePath(
65
51
  slug,
66
52
  decodeURIComponent(docs[2]!),
67
53
  decodeURIComponent(docs[3]!),
68
- decodeURIComponent(docs[1]!),
69
- defaultLocale,
70
54
  );
71
55
  }
72
56
  if (rest === "github" || rest.startsWith("settings/")) {
@@ -75,10 +59,6 @@ export function rewriteLegacyWorkspacePath(
75
59
  return workspaceHomePath(slug);
76
60
  }
77
61
 
78
- export function defaultLocaleOf(locales: string[] | null | undefined) {
79
- return locales?.[0] || "en";
80
- }
81
-
82
62
  export function isWorkspaceEditorPath(pathname: string) {
83
63
  return /\/content\/[^/]+\/[^/]+\/?$/.test(pathname);
84
64
  }