@dxos/app-framework 0.5.3-main.8ffbbae → 0.5.3-main.908ba4f

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/app-framework",
3
- "version": "0.5.3-main.8ffbbae",
3
+ "version": "0.5.3-main.908ba4f",
4
4
  "description": "A framework for building applications from composible plugins.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -15,14 +15,14 @@
15
15
  "@phosphor-icons/react": "^2.1.5",
16
16
  "@preact/signals-core": "^1.6.0",
17
17
  "zod": "^3.22.4",
18
- "@dxos/app-graph": "0.5.3-main.8ffbbae",
19
- "@dxos/async": "0.5.3-main.8ffbbae",
20
- "@dxos/echo-schema": "0.5.3-main.8ffbbae",
21
- "@dxos/log": "0.5.3-main.8ffbbae",
22
- "@dxos/invariant": "0.5.3-main.8ffbbae",
23
- "@dxos/debug": "0.5.3-main.8ffbbae",
24
- "@dxos/util": "0.5.3-main.8ffbbae",
25
- "@dxos/local-storage": "0.5.3-main.8ffbbae"
18
+ "@dxos/app-graph": "0.5.3-main.908ba4f",
19
+ "@dxos/async": "0.5.3-main.908ba4f",
20
+ "@dxos/debug": "0.5.3-main.908ba4f",
21
+ "@dxos/invariant": "0.5.3-main.908ba4f",
22
+ "@dxos/echo-schema": "0.5.3-main.908ba4f",
23
+ "@dxos/log": "0.5.3-main.908ba4f",
24
+ "@dxos/local-storage": "0.5.3-main.908ba4f",
25
+ "@dxos/util": "0.5.3-main.908ba4f"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/react": "^18.0.21",
@@ -4,7 +4,7 @@
4
4
 
5
5
  import React, { Component, type FC, type PropsWithChildren } from 'react';
6
6
 
7
- type Props = PropsWithChildren<{ data?: any; fallback: FC<{ error: Error; reset: () => void }> }>;
7
+ type Props = PropsWithChildren<{ data?: any; fallback: FC<{ data?: any; error: Error; reset: () => void }> }>;
8
8
  type State = { error: Error | undefined };
9
9
 
10
10
  /**
@@ -33,7 +33,7 @@ export class ErrorBoundary extends Component<Props, State> {
33
33
 
34
34
  override render() {
35
35
  if (this.state.error) {
36
- return <this.props.fallback error={this.state.error} reset={this.resetError} />;
36
+ return <this.props.fallback data={this.props.data} error={this.state.error} reset={this.resetError} />;
37
37
  }
38
38
 
39
39
  return this.props.children;
@@ -57,6 +57,11 @@ export const Layout = z.object({
57
57
  popoverAnchorId: z.string().optional(),
58
58
 
59
59
  toasts: z.array(Toast),
60
+
61
+ scrollIntoView: z
62
+ .string()
63
+ .optional()
64
+ .describe('The identifier of a component to scroll into view when it is mounted.'),
60
65
  });
61
66
 
62
67
  export type Layout = z.infer<typeof Layout>;
@@ -83,11 +88,7 @@ export const parseLayoutPlugin = (plugin: Plugin) => {
83
88
  const LAYOUT_ACTION = 'dxos.org/plugin/layout';
84
89
  export enum LayoutAction {
85
90
  SET_LAYOUT = `${LAYOUT_ACTION}/set-layout`,
86
-
87
- /** @deprecated */
88
- // TODO(wittjosiah): At minimum this should be renamed, "focus" means something very specific on a web page.
89
- // Consider removing this action entirely, it's maybe not generic enough to live here.
90
- FOCUS = `${LAYOUT_ACTION}/focus`,
91
+ SCROLL_INTO_VIEW = `${LAYOUT_ACTION}/scroll-into-view`,
91
92
  }
92
93
 
93
94
  /**
@@ -8,7 +8,7 @@ import type { IntentData } from '../IntentPlugin';
8
8
  import type { Plugin } from '../PluginHost';
9
9
 
10
10
  // NOTE(thure): These are chosen from RFC 1738’s `safe` characters: http://www.faqs.org/rfcs/rfc1738.html
11
- export const SLUG_LIST_SEPARATOR = '.';
11
+ export const SLUG_LIST_SEPARATOR = '+';
12
12
  export const SLUG_ENTRY_SEPARATOR = '_';
13
13
  export const SLUG_KEY_VALUE_SEPARATOR = '-';
14
14
  export const SLUG_PATH_SEPARATOR = '~';
@@ -101,6 +101,7 @@ export const parseNavigationPlugin = (plugin: Plugin) => {
101
101
  const NAVIGATION_ACTION = 'dxos.org/plugin/navigation';
102
102
  export enum NavigationAction {
103
103
  OPEN = `${NAVIGATION_ACTION}/open`,
104
+ SET = `${NAVIGATION_ACTION}/set`,
104
105
  ADJUST = `${NAVIGATION_ACTION}/adjust`,
105
106
  CLOSE = `${NAVIGATION_ACTION}/close`,
106
107
  }
@@ -117,6 +118,10 @@ export namespace NavigationAction {
117
118
  * A subtractive overlay to apply to `location.active` (i.e. the result is a subtraction from the previous active of the argument)
118
119
  */
119
120
  export type Close = IntentData<{ activeParts: ActiveParts }>;
121
+ /**
122
+ * The active parts to directly set, to be used when working with URLs or restoring a specific state.
123
+ */
124
+ export type Set = IntentData<{ activeParts: ActiveParts }>;
120
125
  /**
121
126
  * An atomic transaction to apply to `location.active`, describing which element to (attempt to) move to which location.
122
127
  */