@softov/scena 0.1.2 → 0.1.3
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/dist/core/builtins.d.ts +3 -0
- package/dist/{runtime → core}/builtins.js +1 -1
- package/dist/core/controls/command.d.ts +18 -0
- package/dist/{controls → core/controls}/command.js +2 -2
- package/dist/{controls → core/controls}/events.d.ts +1 -1
- package/dist/{controls → core/controls}/events.js +1 -1
- package/dist/core/controls/keybinding.d.ts +9 -0
- package/dist/{controls → core/controls}/keybinding.js +1 -1
- package/dist/core/controls/layout.d.ts +31 -0
- package/dist/{controls → core/controls}/layout.js +24 -7
- package/dist/core/controls/manifest.d.ts +21 -0
- package/dist/{controls → core/controls}/manifest.js +2 -2
- package/dist/core/controls/session.d.ts +16 -0
- package/dist/{controls → core/controls}/session.js +5 -13
- package/dist/{controls → core/controls}/shell.d.ts +2 -2
- package/dist/{controls → core/controls}/shell.js +1 -1
- package/dist/{controls → core/controls}/storage/layout-local.d.ts +1 -1
- package/dist/{controls → core/controls}/storage/session-local.d.ts +1 -1
- package/dist/{controls → core/controls}/when.d.ts +2 -2
- package/dist/{controls → core/controls}/when.js +1 -1
- package/dist/{converters → core/converters}/a2ui-v0.10.d.ts +1 -1
- package/dist/core/{component-graph.d.ts → graph/component-graph.d.ts} +1 -1
- package/dist/core/{component-graph.js → graph/component-graph.js} +1 -1
- package/dist/core/{mount-menu.d.ts → graph/mount-menu.d.ts} +1 -1
- package/dist/core/{mount-menu.js → graph/mount-menu.js} +1 -1
- package/dist/core/graph/mount-surface.d.ts +15 -0
- package/dist/core/{mount-surface.js → graph/mount-surface.js} +23 -4
- package/dist/core/{surface-presentation.d.ts → graph/surface-presentation.d.ts} +3 -3
- package/dist/{i18n → core/i18n}/i18n-backend.d.ts +1 -1
- package/dist/core/index.d.ts +34 -43
- package/dist/core/index.js +35 -38
- package/dist/core/{component-registry.d.ts → registry/component-registry.d.ts} +2 -2
- package/dist/core/{component-registry.js → registry/component-registry.js} +1 -1
- package/dist/core/registry/converter-registry.d.ts +2 -0
- package/dist/core/{converter-registry.js → registry/converter-registry.js} +1 -1
- package/dist/core/resolve/binding-resolver.d.ts +7 -0
- package/dist/core/{binding-resolver.js → resolve/binding-resolver.js} +2 -2
- package/dist/core/{dynamic-resolver.d.ts → resolve/dynamic-resolver.d.ts} +2 -2
- package/dist/core/{dynamic-resolver.js → resolve/dynamic-resolver.js} +1 -1
- package/dist/core/{path-resolver.d.ts → resolve/path-resolver.d.ts} +2 -2
- package/dist/core/{permissions.d.ts → resolve/permissions.d.ts} +1 -1
- package/dist/core/scena.d.ts +1 -1
- package/dist/core/scena.js +17 -16
- package/dist/core/{backends → store/backends}/modus-backend.d.ts +1 -1
- package/dist/core/{backends → store/backends}/storage-backend.d.ts +1 -1
- package/dist/core/{backends → store/backends}/yjs-backend.d.ts +1 -1
- package/dist/core/{reactive-store.d.ts → store/reactive-store.d.ts} +4 -4
- package/dist/core/{reactive-store.js → store/reactive-store.js} +2 -2
- package/dist/index.d.ts +8 -0
- package/dist/index.js +13 -0
- package/dist/porta/Limen.d.ts +1 -0
- package/dist/porta/Limen.js +1 -0
- package/dist/porta/PortaLock.d.ts +1 -0
- package/dist/porta/PortaLock.js +6 -2
- package/dist/porta/SigillumGate.d.ts +1 -0
- package/dist/porta/SigillumGate.js +1 -0
- package/dist/porta/commands.d.ts +1 -1
- package/dist/porta/login-form.block.d.ts +1 -1
- package/dist/porta/provider.d.ts +1 -1
- package/dist/porta/register-blocks.d.ts +2 -2
- package/dist/porta/register-blocks.js +4 -7
- package/dist/porta/register.d.ts +1 -1
- package/dist/porta/sigillum.d.ts +2 -2
- package/dist/react/DefaultShell.d.ts +47 -1
- package/dist/react/DefaultShell.js +81 -12
- package/dist/react/Scena.d.ts +2 -2
- package/dist/react/ScenaProvider.d.ts +1 -1
- package/dist/react/ShellSplitter.d.ts +1 -1
- package/dist/react/SurfaceArea.d.ts +5 -3
- package/dist/react/SurfaceArea.js +2 -2
- package/dist/react/ViewMount.d.ts +1 -1
- package/dist/react/ViewMount.js +4 -4
- package/dist/react/hooks/useI18n.d.ts +1 -1
- package/dist/react/hooks/useI18n.js +1 -1
- package/dist/react/hooks/useLabel.d.ts +1 -1
- package/dist/react/hooks/useLabel.js +1 -1
- package/dist/react/hooks/useLayout.d.ts +1 -1
- package/dist/react/hooks/useMounts.d.ts +1 -1
- package/dist/react/hooks/useStore.d.ts +1 -1
- package/dist/react/hooks/useStore.js +2 -2
- package/dist/react/hooks/useStoreLabel.d.ts +2 -2
- package/dist/react/hooks/useStoreLabel.js +1 -1
- package/dist/react/hooks/useSurfacePresentation.d.ts +3 -3
- package/dist/react/hooks/useSurfacePresentation.js +1 -1
- package/dist/react/mount-context.d.ts +1 -1
- package/dist/react/useSurfaceResize.d.ts +2 -2
- package/dist/runtime/client-handlers.d.ts +1 -1
- package/dist/runtime/in-memory-socket.d.ts +2 -2
- package/dist/runtime/index.d.ts +3 -3
- package/dist/runtime/index.js +2 -2
- package/dist/runtime/layout-commands.d.ts +3 -3
- package/dist/runtime/layout-commands.js +2 -2
- package/dist/runtime/opener-commands.d.ts +5 -5
- package/dist/runtime/opener-commands.js +3 -3
- package/dist/runtime/surface-bridge.d.ts +5 -5
- package/dist/runtime/surface-bridge.js +1 -1
- package/dist/{runtime → sdk}/args-schema.d.ts +1 -1
- package/dist/{core → sdk}/disposable.d.ts +3 -1
- package/dist/{types → sdk}/index.d.ts +1 -0
- package/dist/{types → sdk}/index.js +1 -0
- package/dist/{types → sdk}/label.d.ts +1 -0
- package/dist/{core → sdk}/label.js +0 -1
- package/dist/{types → sdk}/layout.d.ts +25 -0
- package/dist/{types → sdk}/mount-surface.d.ts +19 -1
- package/dist/{types → sdk}/scena.d.ts +2 -1
- package/dist/styles/bar.css +8 -4
- package/dist/styles/base.css +18 -16
- package/dist/styles/controller.d.ts +27 -0
- package/dist/styles/controller.js +74 -0
- package/dist/styles/form.css +10 -0
- package/dist/styles/index.d.ts +2 -0
- package/dist/styles/index.js +3 -0
- package/dist/styles/surface.css +69 -3
- package/dist/styles/themes/tokens.css +1 -1
- package/dist/ui/_utils.d.ts +1 -1
- package/dist/ui/_utils.js +2 -2
- package/dist/ui/campus/CampusMappa.js +1 -1
- package/dist/ui/chart/catalog.d.ts +1 -1
- package/dist/ui/control/ButtonBar.css +61 -0
- package/dist/ui/control/ButtonBar.d.ts +36 -0
- package/dist/ui/control/ButtonBar.js +42 -0
- package/dist/ui/control/ThemeModeToggle.css +22 -0
- package/dist/ui/control/ThemeModeToggle.d.ts +20 -0
- package/dist/ui/control/ThemeModeToggle.js +34 -0
- package/dist/ui/control/ThemePicker.css +24 -0
- package/dist/ui/control/ThemePicker.d.ts +27 -0
- package/dist/ui/control/ThemePicker.js +33 -0
- package/dist/ui/control/catalog.d.ts +1 -1
- package/dist/ui/control/catalog.js +5 -1
- package/dist/ui/control/index.d.ts +6 -0
- package/dist/ui/control/index.js +3 -0
- package/dist/ui/data/Filter.d.ts +1 -1
- package/dist/ui/data/Listable.d.ts +3 -2
- package/dist/ui/data/Listable.js +4 -2
- package/dist/ui/data/Pagination.d.ts +4 -1
- package/dist/ui/data/Pagination.js +37 -9
- package/dist/ui/data/Tree.d.ts +2 -2
- package/dist/ui/data/Tree.js +1 -1
- package/dist/ui/data/catalog.d.ts +1 -1
- package/dist/ui/display/Alert.css +15 -10
- package/dist/ui/display/Badge.css +22 -14
- package/dist/ui/display/Badge.d.ts +1 -1
- package/dist/ui/display/Badge.js +1 -1
- package/dist/ui/display/DetailHeader.css +3 -3
- package/dist/ui/display/DetailList.js +3 -2
- package/dist/ui/display/DetailNotFound.d.ts +1 -1
- package/dist/ui/display/DetailNotFound.js +1 -1
- package/dist/ui/display/Progress.d.ts +1 -1
- package/dist/ui/display/Progress.js +1 -1
- package/dist/ui/display/Spinner.d.ts +1 -1
- package/dist/ui/display/Spinner.js +1 -1
- package/dist/ui/display/StatusDot.css +46 -0
- package/dist/ui/display/StatusDot.d.ts +17 -0
- package/dist/ui/display/StatusDot.js +16 -0
- package/dist/ui/display/Svg.d.ts +1 -1
- package/dist/ui/display/Svg.js +1 -1
- package/dist/ui/display/catalog.d.ts +1 -1
- package/dist/ui/display/catalog.js +1 -0
- package/dist/ui/display/index.d.ts +2 -0
- package/dist/ui/display/index.js +1 -0
- package/dist/ui/forms/LoginForm.d.ts +1 -0
- package/dist/ui/forms/LoginForm.js +1 -0
- package/dist/ui/forms/SettingsContainer.d.ts +2 -1
- package/dist/ui/forms/SettingsContainer.js +2 -2
- package/dist/ui/forms/catalog.d.ts +1 -1
- package/dist/ui/index.d.ts +6 -1
- package/dist/ui/index.js +3 -1
- package/dist/ui/layout/BarLayout.d.ts +1 -1
- package/dist/ui/layout/FloatingLayout.d.ts +1 -1
- package/dist/ui/layout/InlineLayout.d.ts +1 -1
- package/dist/ui/layout/MountTitle.d.ts +2 -2
- package/dist/ui/layout/MountTitle.js +2 -2
- package/dist/ui/layout/RailLayout.d.ts +1 -1
- package/dist/ui/layout/SectionHeader.d.ts +2 -2
- package/dist/ui/layout/SectionHeader.js +4 -7
- package/dist/ui/layout/SingleLayout.d.ts +1 -1
- package/dist/ui/layout/SpatialCard.d.ts +2 -2
- package/dist/ui/layout/SpatialLayout.d.ts +1 -1
- package/dist/ui/layout/SplitLayout.d.ts +1 -1
- package/dist/ui/layout/StackHeader.d.ts +1 -1
- package/dist/ui/layout/StackLayout.d.ts +1 -1
- package/dist/ui/layout/TabLayout.d.ts +1 -1
- package/dist/ui/layout/TabPanelLayout.d.ts +2 -2
- package/dist/ui/layout/TabPanelLayout.js +1 -1
- package/dist/ui/layout/catalog.d.ts +1 -1
- package/dist/ui/layout/register.d.ts +2 -2
- package/dist/ui/layout/register.js +1 -1
- package/dist/ui/media/catalog.d.ts +1 -1
- package/dist/ui/menu/ActionList.d.ts +2 -2
- package/dist/ui/menu/ActionList.js +1 -1
- package/dist/ui/menu/ContainerMenu.d.ts +2 -2
- package/dist/ui/menu/ContextMenu.d.ts +2 -2
- package/dist/ui/menu/useChatPicker.d.ts +2 -2
- package/dist/ui/navigation/ActivityBarItem.css +81 -0
- package/dist/ui/navigation/ActivityBarItem.d.ts +61 -0
- package/dist/ui/navigation/ActivityBarItem.js +68 -0
- package/dist/ui/navigation/catalog.d.ts +1 -1
- package/dist/ui/navigation/catalog.js +1 -0
- package/dist/ui/navigation/index.d.ts +2 -0
- package/dist/ui/navigation/index.js +1 -0
- package/dist/ui/overlay/catalog.d.ts +1 -1
- package/dist/ui/register.d.ts +3 -3
- package/dist/ui/register.js +1 -1
- package/package.json +15 -7
- package/dist/controls/command.d.ts +0 -18
- package/dist/controls/keybinding.d.ts +0 -9
- package/dist/controls/layout.d.ts +0 -16
- package/dist/controls/manifest.d.ts +0 -21
- package/dist/controls/session.d.ts +0 -16
- package/dist/core/binding-resolver.d.ts +0 -7
- package/dist/core/converter-registry.d.ts +0 -2
- package/dist/core/label.d.ts +0 -2
- package/dist/core/mount-surface.d.ts +0 -15
- package/dist/runtime/builtins.d.ts +0 -3
- package/dist/types/disposable.d.ts +0 -3
- package/dist/types/disposable.js +0 -1
- package/dist/types/label.js +0 -1
- /package/dist/{controls → core/controls}/index.d.ts +0 -0
- /package/dist/{controls → core/controls}/index.js +0 -0
- /package/dist/{controls → core/controls}/storage/layout-local.js +0 -0
- /package/dist/{controls → core/controls}/storage/session-local.js +0 -0
- /package/dist/{converters → core/converters}/a2ui-v0.10.js +0 -0
- /package/dist/{converters → core/converters}/index.d.ts +0 -0
- /package/dist/{converters → core/converters}/index.js +0 -0
- /package/dist/core/{surface-presentation.js → graph/surface-presentation.js} +0 -0
- /package/dist/{i18n → core/i18n}/i18n-backend.js +0 -0
- /package/dist/{i18n → core/i18n}/registry.d.ts +0 -0
- /package/dist/{i18n → core/i18n}/registry.js +0 -0
- /package/dist/core/{path-resolver.js → resolve/path-resolver.js} +0 -0
- /package/dist/core/{permissions.js → resolve/permissions.js} +0 -0
- /package/dist/core/{backends → store/backends}/modus-backend.js +0 -0
- /package/dist/core/{backends → store/backends}/storage-backend.js +0 -0
- /package/dist/core/{backends → store/backends}/yjs-backend.js +0 -0
- /package/dist/core/{computed-dsl.d.ts → store/computed-dsl.d.ts} +0 -0
- /package/dist/core/{computed-dsl.js → store/computed-dsl.js} +0 -0
- /package/dist/{runtime → sdk}/args-schema.js +0 -0
- /package/dist/{types → sdk}/binding-resolver.d.ts +0 -0
- /package/dist/{types → sdk}/binding-resolver.js +0 -0
- /package/dist/{types → sdk}/colors.d.ts +0 -0
- /package/dist/{types → sdk}/colors.js +0 -0
- /package/dist/{types → sdk}/command.d.ts +0 -0
- /package/dist/{types → sdk}/command.js +0 -0
- /package/dist/{types → sdk}/component-graph.d.ts +0 -0
- /package/dist/{types → sdk}/component-graph.js +0 -0
- /package/dist/{types → sdk}/component-registry.d.ts +0 -0
- /package/dist/{types → sdk}/component-registry.js +0 -0
- /package/dist/{types → sdk}/converter-registry.d.ts +0 -0
- /package/dist/{types → sdk}/converter-registry.js +0 -0
- /package/dist/{core → sdk}/disposable.js +0 -0
- /package/dist/{types → sdk}/events.d.ts +0 -0
- /package/dist/{types → sdk}/events.js +0 -0
- /package/dist/{types → sdk}/host.d.ts +0 -0
- /package/dist/{types → sdk}/host.js +0 -0
- /package/dist/{types → sdk}/keybinding.d.ts +0 -0
- /package/dist/{types → sdk}/keybinding.js +0 -0
- /package/dist/{types → sdk}/layout.js +0 -0
- /package/dist/{types → sdk}/manifest.d.ts +0 -0
- /package/dist/{types → sdk}/manifest.js +0 -0
- /package/dist/{types → sdk}/mount-menu.d.ts +0 -0
- /package/dist/{types → sdk}/mount-menu.js +0 -0
- /package/dist/{types → sdk}/mount-surface.js +0 -0
- /package/dist/{types → sdk}/permissions.d.ts +0 -0
- /package/dist/{types → sdk}/permissions.js +0 -0
- /package/dist/{types → sdk}/query.d.ts +0 -0
- /package/dist/{types → sdk}/query.js +0 -0
- /package/dist/{types → sdk}/reactive-store.d.ts +0 -0
- /package/dist/{types → sdk}/reactive-store.js +0 -0
- /package/dist/{types → sdk}/scena.js +0 -0
- /package/dist/{types → sdk}/scope-backend.d.ts +0 -0
- /package/dist/{types → sdk}/scope-backend.js +0 -0
- /package/dist/{types → sdk}/session.d.ts +0 -0
- /package/dist/{types → sdk}/session.js +0 -0
- /package/dist/{types → sdk}/shell.d.ts +0 -0
- /package/dist/{types → sdk}/shell.js +0 -0
- /package/dist/{types → sdk}/when.d.ts +0 -0
- /package/dist/{types → sdk}/when.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isAction, isDataBinding, isFunctionCall, } from '
|
|
2
|
-
import { combineDisposables, disposableFrom } from '
|
|
1
|
+
import { isAction, isDataBinding, isFunctionCall, } from '../../sdk/component-graph.js';
|
|
2
|
+
import { combineDisposables, disposableFrom } from '../../sdk/disposable.js';
|
|
3
3
|
import { parsePath } from './path-resolver.js';
|
|
4
4
|
export function createBindingResolver(deps) {
|
|
5
5
|
const { store } = deps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Action, BindingPath, DataBinding, DynamicBoolean, DynamicNumber, DynamicString, DynamicStringList, DynamicValue, FunctionCall, PropValue } from '
|
|
2
|
-
import type { Scena } from '
|
|
1
|
+
import type { Action, BindingPath, DataBinding, DynamicBoolean, DynamicNumber, DynamicString, DynamicStringList, DynamicValue, FunctionCall, PropValue } from '../../sdk/component-graph.js';
|
|
2
|
+
import type { Scena } from '../../sdk/scena.js';
|
|
3
3
|
export declare function resolveDynamicValue(value: PropValue, dataContext: BindingPath | undefined, scena: Scena): unknown;
|
|
4
4
|
export declare function resolveFunctionCall(fc: FunctionCall, dataContext: BindingPath | undefined, scena: Scena): unknown;
|
|
5
5
|
export declare function resolveDynamicString(v: DynamicString, dataContext: BindingPath | undefined, scena: Scena): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isAction, isDataBinding, isFunctionCall, } from '
|
|
1
|
+
import { isAction, isDataBinding, isFunctionCall, } from '../../sdk/component-graph.js';
|
|
2
2
|
import { readPath, writePath } from './path-resolver.js';
|
|
3
3
|
// Resolves a DynamicValue to its concrete value.
|
|
4
4
|
// literal → returned as-is
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BindingPath } from '
|
|
2
|
-
import type { ReactiveStore, ScopeName } from '
|
|
1
|
+
import type { BindingPath } from '../../sdk/component-graph.js';
|
|
2
|
+
import type { ReactiveStore, ScopeName } from '../../sdk/reactive-store.js';
|
|
3
3
|
export interface ParsedPath {
|
|
4
4
|
absolute: boolean;
|
|
5
5
|
segments: string[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { PermissionEngine } from '
|
|
1
|
+
import type { PermissionEngine } from '../../sdk/permissions.js';
|
|
2
2
|
export declare function createPermissionEngine(): PermissionEngine;
|
package/dist/core/scena.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CreateScena } from '../
|
|
1
|
+
import type { CreateScena } from '../sdk/scena.js';
|
|
2
2
|
export declare const createScena: CreateScena;
|
package/dist/core/scena.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { createEventBus } from '
|
|
2
|
-
import { createWhenEngine } from '
|
|
3
|
-
import { createCommandRegistry } from '
|
|
4
|
-
import { createKeybindingRegistry } from '
|
|
5
|
-
import { createLayoutAPI, createLayoutRegistry } from '
|
|
6
|
-
import { createSessionAPI } from '
|
|
7
|
-
import { createShellRegistry } from '
|
|
8
|
-
import { createManifestAPI } from '
|
|
9
|
-
import { createPermissionEngine } from './permissions.js';
|
|
10
|
-
import { createReactiveStore } from './reactive-store.js';
|
|
11
|
-
import { createBindingResolver } from './binding-resolver.js';
|
|
12
|
-
import { createComponentRegistry } from './component-registry.js';
|
|
13
|
-
import { createConverterRegistry } from './converter-registry.js';
|
|
14
|
-
import { createMountSurfaceRegistry } from './mount-surface.js';
|
|
15
|
-
import { createMountMenuRegistry } from './mount-menu.js';
|
|
16
|
-
import { registerBuiltinFunctions } from '
|
|
1
|
+
import { createEventBus } from './controls/events.js';
|
|
2
|
+
import { createWhenEngine } from './controls/when.js';
|
|
3
|
+
import { createCommandRegistry } from './controls/command.js';
|
|
4
|
+
import { createKeybindingRegistry } from './controls/keybinding.js';
|
|
5
|
+
import { createLayoutAPI, createLayoutRegistry } from './controls/layout.js';
|
|
6
|
+
import { createSessionAPI } from './controls/session.js';
|
|
7
|
+
import { createShellRegistry } from './controls/shell.js';
|
|
8
|
+
import { createManifestAPI } from './controls/manifest.js';
|
|
9
|
+
import { createPermissionEngine } from './resolve/permissions.js';
|
|
10
|
+
import { createReactiveStore } from './store/reactive-store.js';
|
|
11
|
+
import { createBindingResolver } from './resolve/binding-resolver.js';
|
|
12
|
+
import { createComponentRegistry } from './registry/component-registry.js';
|
|
13
|
+
import { createConverterRegistry } from './registry/converter-registry.js';
|
|
14
|
+
import { createMountSurfaceRegistry } from './graph/mount-surface.js';
|
|
15
|
+
import { createMountMenuRegistry } from './graph/mount-menu.js';
|
|
16
|
+
import { registerBuiltinFunctions } from './builtins.js';
|
|
17
17
|
export const createScena = (opts = {}) => {
|
|
18
18
|
const events = opts.events ?? createEventBus();
|
|
19
19
|
const permissions = createPermissionEngine();
|
|
@@ -34,6 +34,7 @@ export const createScena = (opts = {}) => {
|
|
|
34
34
|
events,
|
|
35
35
|
store,
|
|
36
36
|
initial: opts.initialLayout,
|
|
37
|
+
surfaceDefaults: opts.surfaceDefaults,
|
|
37
38
|
storage: opts.layoutStorage,
|
|
38
39
|
});
|
|
39
40
|
const scenaRef = { current: null };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { BindingPath } from '
|
|
2
|
-
import type { EventBus } from '
|
|
3
|
-
import type { ReactiveStore, ScopeName, SocketBridge } from '
|
|
4
|
-
import type { ScopeBackendFactory } from '
|
|
1
|
+
import type { BindingPath } from '../../sdk/component-graph.js';
|
|
2
|
+
import type { EventBus } from '../../sdk/events.js';
|
|
3
|
+
import type { ReactiveStore, ScopeName, SocketBridge } from '../../sdk/reactive-store.js';
|
|
4
|
+
import type { ScopeBackendFactory } from '../../sdk/scope-backend.js';
|
|
5
5
|
interface Deps {
|
|
6
6
|
events: EventBus;
|
|
7
7
|
socket?: SocketBridge;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { disposableFrom } from '
|
|
2
|
-
import { parsePath, joinSegments, hasWildcard } from '
|
|
1
|
+
import { disposableFrom } from '../../sdk/disposable.js';
|
|
2
|
+
import { parsePath, joinSegments, hasWildcard } from '../resolve/path-resolver.js';
|
|
3
3
|
import { compileSelect } from './computed-dsl.js';
|
|
4
4
|
function makeNode() {
|
|
5
5
|
return { hasValue: false, value: undefined };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './core/index.js';
|
|
2
|
+
export { createSurfaceBridge } from './runtime/surface-bridge.js';
|
|
3
|
+
export { registerClientHandler, getClientHandler, } from './runtime/client-handlers.js';
|
|
4
|
+
export { createInMemorySocket } from './runtime/in-memory-socket.js';
|
|
5
|
+
export type { InMemorySocket } from './runtime/in-memory-socket.js';
|
|
6
|
+
export { registerLayoutCommands } from './runtime/layout-commands.js';
|
|
7
|
+
export { registerOpenerCommands } from './runtime/opener-commands.js';
|
|
8
|
+
export type { RegisterOpenerCommandsOptions } from './runtime/opener-commands.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// The package root export (`@softov/scena`).
|
|
2
|
+
//
|
|
3
|
+
// core/ is the store, the graph, the resolvers and the registries; runtime/ is
|
|
4
|
+
// the behaviour wired on top of a live scena — the surface bridge, the sockets,
|
|
5
|
+
// and the layout/opener command sets. Both are flat on the root surface, but
|
|
6
|
+
// they are assembled here rather than inside core/index.ts, so that core never
|
|
7
|
+
// imports the layer built on it.
|
|
8
|
+
export * from './core/index.js';
|
|
9
|
+
export { createSurfaceBridge } from './runtime/surface-bridge.js';
|
|
10
|
+
export { registerClientHandler, getClientHandler, } from './runtime/client-handlers.js';
|
|
11
|
+
export { createInMemorySocket } from './runtime/in-memory-socket.js';
|
|
12
|
+
export { registerLayoutCommands } from './runtime/layout-commands.js';
|
|
13
|
+
export { registerOpenerCommands } from './runtime/opener-commands.js';
|
package/dist/porta/Limen.d.ts
CHANGED
package/dist/porta/Limen.js
CHANGED
|
@@ -12,3 +12,4 @@ export function Limen({ permission, fallback, title = 'Welcome', subtitle, top,
|
|
|
12
12
|
return child ?? children;
|
|
13
13
|
return (_jsxs("div", { className: "porta-limen", children: [top ? _jsx("div", { className: "porta-limen__top", children: top }) : null, left ? _jsx("div", { className: "porta-limen__left", children: left }) : null, _jsx("div", { className: "porta-limen__center", children: _jsxs("div", { className: "porta-limen__panel", children: [_jsx("div", { className: "porta-limen__title", children: title }), subtitle ? _jsx("div", { className: "porta-limen__subtitle", children: subtitle }) : null, fallback ?? _jsx(Suspense, { fallback: _jsx("div", { children: "Loading..." }), children: _jsx(LoginForm, {}) })] }) }), right ? _jsx("div", { className: "porta-limen__right", children: right }) : null, bottom ? _jsx("div", { className: "porta-limen__bottom", children: bottom }) : null] }));
|
|
14
14
|
}
|
|
15
|
+
export default Limen;
|
package/dist/porta/PortaLock.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { lazy, Suspense } from 'react';
|
|
2
3
|
import { useStore } from '../react/hooks/useStore.js';
|
|
3
4
|
import { SIGILLUM_PATHS } from './sigillum.js';
|
|
4
|
-
import { LoginForm } from '../ui/forms/LoginForm.js';
|
|
5
5
|
import { hasScope } from './match.js';
|
|
6
6
|
import './PortaLock.css';
|
|
7
|
+
const LoginForm = lazy(() => import('../ui/forms/LoginForm.js').then((module) => ({
|
|
8
|
+
default: module.LoginForm,
|
|
9
|
+
})));
|
|
7
10
|
export function PortaLock({ permission, fallback, title, child, children, }) {
|
|
8
11
|
const session = useStore(SIGILLUM_PATHS.session) ?? null;
|
|
9
12
|
const ok = hasScope(session, permission);
|
|
10
13
|
if (ok)
|
|
11
14
|
return child ?? children;
|
|
12
|
-
return (_jsxs("div", { className: "porta-locked", children: [_jsx("span", { className: "porta-locked__title", children: title ?? (permission ? `Sign in required (${permission})` : 'Sign in required') }), fallback ?? _jsx(LoginForm, {})] }));
|
|
15
|
+
return (_jsxs("div", { className: "porta-locked", children: [_jsx("span", { className: "porta-locked__title", children: title ?? (permission ? `Sign in required (${permission})` : 'Sign in required') }), fallback ?? (_jsx(Suspense, { fallback: null, children: _jsx(LoginForm, {}) }))] }));
|
|
13
16
|
}
|
|
17
|
+
export default PortaLock;
|
package/dist/porta/commands.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentNode } from '../
|
|
1
|
+
import type { ComponentNode } from '../sdk/component-graph.js';
|
|
2
2
|
export declare const loginFormBlock: ComponentNode;
|
package/dist/porta/provider.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { DataBinding } from '../
|
|
2
|
+
import type { DataBinding } from '../sdk/component-graph.js';
|
|
3
3
|
export type ProviderLabel = string | DataBinding;
|
|
4
4
|
export type PortaProviderKind = 'oauth-button' | 'form-fields' | 'otp' | 'magic-link';
|
|
5
5
|
export interface AuthField {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Scena } from '../
|
|
2
|
-
import type { Disposable } from '../
|
|
1
|
+
import type { Scena } from '../sdk/scena.js';
|
|
2
|
+
import type { Disposable } from '../sdk/disposable.js';
|
|
3
3
|
export declare function registerPortaBlocks(scena: Scena): Disposable;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { combineDisposables } from '../
|
|
2
|
-
import { LoginForm } from '../ui/forms/LoginForm.js';
|
|
3
|
-
import { PortaLock } from './PortaLock.js';
|
|
4
|
-
import { Sigillum } from './SigillumGate.js';
|
|
1
|
+
import { combineDisposables } from '../sdk/disposable.js';
|
|
5
2
|
import { Limen } from './Limen.js';
|
|
6
3
|
// Registers the porta blocks as scena components so they can be referenced
|
|
7
4
|
// by name from ComponentNode trees and agent-sent payloads.
|
|
@@ -14,15 +11,15 @@ export function registerPortaBlocks(scena) {
|
|
|
14
11
|
return combineDisposables(scena.components.register({
|
|
15
12
|
component: 'Porta.LoginForm',
|
|
16
13
|
category: 'page',
|
|
17
|
-
renderer: { kind: 'react', load: async () => (
|
|
14
|
+
renderer: { kind: 'react', load: async () => import('../ui/forms/LoginForm.js') },
|
|
18
15
|
}), scena.components.register({
|
|
19
16
|
component: 'Porta.PortaLock',
|
|
20
17
|
category: 'page',
|
|
21
|
-
renderer: { kind: 'react', load: async () => (
|
|
18
|
+
renderer: { kind: 'react', load: async () => import('./PortaLock.js') },
|
|
22
19
|
}), scena.components.register({
|
|
23
20
|
component: 'Porta.Sigillum',
|
|
24
21
|
category: 'page',
|
|
25
|
-
renderer: { kind: 'react', load: async () => (
|
|
22
|
+
renderer: { kind: 'react', load: async () => import('./SigillumGate.js') },
|
|
26
23
|
}), scena.components.register({
|
|
27
24
|
component: 'Porta.Limen',
|
|
28
25
|
category: 'page',
|
package/dist/porta/register.d.ts
CHANGED
package/dist/porta/sigillum.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BindingPath } from '../
|
|
2
|
-
import type { Scena } from '../
|
|
1
|
+
import type { BindingPath } from '../sdk/component-graph.js';
|
|
2
|
+
import type { Scena } from '../sdk/scena.js';
|
|
3
3
|
import type { Session } from './provider.js';
|
|
4
4
|
export declare const SIGILLUM_PATHS: {
|
|
5
5
|
readonly session: BindingPath;
|
|
@@ -1 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+
import type { PresentationPolicy } from '../core/graph/surface-presentation.js';
|
|
2
|
+
export interface DefaultShellProps {
|
|
3
|
+
/**
|
|
4
|
+
* How this app's surfaces occupy space as the viewport narrows.
|
|
5
|
+
*
|
|
6
|
+
* scena ships the mechanism and no policy: whether a right sidebar floats
|
|
7
|
+
* before a left one is a claim about a specific app's information
|
|
8
|
+
* architecture. With none, every surface stays `docked` at every size, which
|
|
9
|
+
* is what this shell did before it read a policy at all.
|
|
10
|
+
*/
|
|
11
|
+
presentation?: PresentationPolicy;
|
|
12
|
+
/**
|
|
13
|
+
* Clicking the scrim closes whatever is overlaying `main`.
|
|
14
|
+
*
|
|
15
|
+
* On by default because a drawer that cannot be dismissed by tapping beside
|
|
16
|
+
* it is a trap on the size of screen that produces drawers in the first
|
|
17
|
+
* place. Pass false for an app that wants a modal drawer.
|
|
18
|
+
*/
|
|
19
|
+
dismissOnScrim?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Minimal flex shell.
|
|
23
|
+
*
|
|
24
|
+
* Each surface renders through `SurfaceArea`, which delegates to the layout
|
|
25
|
+
* registered for it (tab / split / stack / rail / inline / floating), and is
|
|
26
|
+
* stamped with the edge it closes on and the kind of region it is so that CSS
|
|
27
|
+
* can style it without matching its name.
|
|
28
|
+
*
|
|
29
|
+
* Two things it deliberately does itself rather than leaving to the app,
|
|
30
|
+
* because every app was otherwise writing them:
|
|
31
|
+
*
|
|
32
|
+
* - it resolves the presentation policy per surface, so a sidebar lifts over
|
|
33
|
+
* `main` on a narrow viewport instead of taking width from it;
|
|
34
|
+
* - it renders the scrim when something is lifted, and closes on a click.
|
|
35
|
+
*
|
|
36
|
+
* Resizing is by each surface's own edge (`SurfaceArea`'s `resize` prop) rather
|
|
37
|
+
* than by a `ShellSplitter` placed beside it. The two are alternatives: a
|
|
38
|
+
* splitter is an element between two surfaces, which means a shell has to know
|
|
39
|
+
* the arrangement well enough to place one, and it has nothing to sit against
|
|
40
|
+
* once a surface floats. Self-edge resize travels with the surface and stands
|
|
41
|
+
* down on its own when the presentation is not `docked`. `ShellSplitter` is
|
|
42
|
+
* still exported for shells that want the explicit version.
|
|
43
|
+
*
|
|
44
|
+
* An app that wants different chrome composes `SurfaceArea` itself -- see the
|
|
45
|
+
* playground's CustomShell.
|
|
46
|
+
*/
|
|
47
|
+
export declare function DefaultShell({ presentation, dismissOnScrim }?: DefaultShellProps): import("react").JSX.Element;
|
|
@@ -1,14 +1,48 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isOverlaid, resolveSurfacePresentation } from '../core/graph/surface-presentation.js';
|
|
3
|
+
import { useScena } from './ScenaProvider.js';
|
|
2
4
|
import { useLayout } from './hooks/useLayout.js';
|
|
5
|
+
import { useStore } from './hooks/useStore.js';
|
|
3
6
|
import { SurfaceArea } from './SurfaceArea.js';
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
// Surfaces that can end up lifted over `main`, in the order the scrim closes
|
|
8
|
+
// them. `main`, the bars and the rail are never overlaid by this shell -- a
|
|
9
|
+
// `bar` presentation keeps occupying its edge, so nothing covers anything.
|
|
10
|
+
const OVERLAYABLE = ['sidebar:left', 'sidebar:right', 'panel:bottom'];
|
|
11
|
+
/**
|
|
12
|
+
* Minimal flex shell.
|
|
13
|
+
*
|
|
14
|
+
* Each surface renders through `SurfaceArea`, which delegates to the layout
|
|
15
|
+
* registered for it (tab / split / stack / rail / inline / floating), and is
|
|
16
|
+
* stamped with the edge it closes on and the kind of region it is so that CSS
|
|
17
|
+
* can style it without matching its name.
|
|
18
|
+
*
|
|
19
|
+
* Two things it deliberately does itself rather than leaving to the app,
|
|
20
|
+
* because every app was otherwise writing them:
|
|
21
|
+
*
|
|
22
|
+
* - it resolves the presentation policy per surface, so a sidebar lifts over
|
|
23
|
+
* `main` on a narrow viewport instead of taking width from it;
|
|
24
|
+
* - it renders the scrim when something is lifted, and closes on a click.
|
|
25
|
+
*
|
|
26
|
+
* Resizing is by each surface's own edge (`SurfaceArea`'s `resize` prop) rather
|
|
27
|
+
* than by a `ShellSplitter` placed beside it. The two are alternatives: a
|
|
28
|
+
* splitter is an element between two surfaces, which means a shell has to know
|
|
29
|
+
* the arrangement well enough to place one, and it has nothing to sit against
|
|
30
|
+
* once a surface floats. Self-edge resize travels with the surface and stands
|
|
31
|
+
* down on its own when the presentation is not `docked`. `ShellSplitter` is
|
|
32
|
+
* still exported for shells that want the explicit version.
|
|
33
|
+
*
|
|
34
|
+
* An app that wants different chrome composes `SurfaceArea` itself -- see the
|
|
35
|
+
* playground's CustomShell.
|
|
36
|
+
*/
|
|
37
|
+
export function DefaultShell({ presentation, dismissOnScrim = true } = {}) {
|
|
38
|
+
const scena = useScena();
|
|
10
39
|
const layout = useLayout();
|
|
11
40
|
const surfaces = layout.surfaces;
|
|
41
|
+
// `$/modus/class` is published by the modus backend. Without it registered
|
|
42
|
+
// there is no size class to resolve against, and `large` keeps everything
|
|
43
|
+
// docked -- the same as having no policy.
|
|
44
|
+
const modus = useStore('$/modus/class') ?? 'large';
|
|
45
|
+
const presentationOf = (surface) => resolveSurfacePresentation(surface, modus, presentation);
|
|
12
46
|
const sidebarLeftWidth = surfaces['sidebar:left']?.size ?? 240;
|
|
13
47
|
const sidebarRightWidth = surfaces['sidebar:right']?.size ?? 280;
|
|
14
48
|
const panelBottomHeight = surfaces['panel:bottom']?.size ?? 200;
|
|
@@ -18,17 +52,52 @@ export function DefaultShell() {
|
|
|
18
52
|
const activitybarVisible = surfaces['activitybar']?.visible ?? true;
|
|
19
53
|
const statusbarVisible = surfaces['statusbar']?.visible ?? true;
|
|
20
54
|
const titlebarVisible = surfaces['titlebar']?.visible ?? true;
|
|
55
|
+
const leftPresentation = presentationOf('sidebar:left');
|
|
56
|
+
const rightPresentation = presentationOf('sidebar:right');
|
|
57
|
+
const bottomPresentation = presentationOf('panel:bottom');
|
|
58
|
+
const visibleOf = {
|
|
59
|
+
'sidebar:left': sidebarLeftVisible,
|
|
60
|
+
'sidebar:right': sidebarRightVisible,
|
|
61
|
+
'panel:bottom': panelBottomVisible,
|
|
62
|
+
};
|
|
63
|
+
// Something is over `main` right now. `bar` is excluded by `isOverlaid`,
|
|
64
|
+
// which is the point of asking it rather than comparing the size class:
|
|
65
|
+
// a rail rotated to the bottom edge still occupies that edge.
|
|
66
|
+
const lifted = OVERLAYABLE.filter((surface) => visibleOf[surface] && isOverlaid(presentationOf(surface)));
|
|
67
|
+
// An overlaid surface takes no width from `main`, so the flex sizing that
|
|
68
|
+
// would reserve it has to stand down as well -- otherwise the drawer floats
|
|
69
|
+
// over a `main` that is still short by the drawer's width.
|
|
70
|
+
const dockedStyle = (docked, style) => (docked ? style : undefined);
|
|
71
|
+
function closeLifted() {
|
|
72
|
+
for (const surface of lifted) {
|
|
73
|
+
scena.layout.setSurface(surface, { ...surfaces[surface], visible: false });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
21
76
|
return (_jsxs("div", { className: "oo-shell", style: {
|
|
22
77
|
display: 'flex',
|
|
23
78
|
flexDirection: 'column',
|
|
24
79
|
height: '100vh',
|
|
25
80
|
width: '100vw',
|
|
26
81
|
overflow: 'hidden',
|
|
27
|
-
}, children: [titlebarVisible ? _jsx(SurfaceArea, { surface: "titlebar", layout: "bar"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
82
|
+
}, children: [titlebarVisible ? (_jsx(SurfaceArea, { surface: "titlebar", layout: "bar", role: "bar", edge: "block-end" })) : null, _jsxs("div", { style: {
|
|
83
|
+
display: 'flex',
|
|
84
|
+
flex: 1,
|
|
85
|
+
minHeight: 0,
|
|
86
|
+
overflow: 'hidden',
|
|
87
|
+
position: 'relative',
|
|
88
|
+
}, children: [activitybarVisible ? (_jsx(SurfaceArea, { surface: "activitybar", layout: "rail", role: "rail", edge: "inline-end", presentation: presentationOf('activitybar') })) : null, sidebarLeftVisible ? (_jsx(SurfaceArea, { surface: "sidebar:left", layout: "stack", role: "panel", edge: "inline-end", presentation: leftPresentation, resize: { edge: 'right', min: 120, max: 600 }, style: dockedStyle(!isOverlaid(leftPresentation), {
|
|
89
|
+
width: sidebarLeftWidth,
|
|
90
|
+
flex: '0 0 auto',
|
|
91
|
+
overflow: 'hidden',
|
|
92
|
+
}) })) : null, _jsxs("div", { style: { flex: 1, minWidth: 0, display: 'flex', flexDirection: 'column' }, children: [_jsx(SurfaceArea, { surface: "main", layout: "tab", role: "main", style: { flex: 1, minHeight: 0, overflow: 'hidden' } }), panelBottomVisible ? (_jsx(SurfaceArea, { surface: "panel:bottom", layout: "tab", role: "panel", edge: "block-start", presentation: bottomPresentation, resize: { edge: 'top', min: 80, max: 500 }, style: dockedStyle(!isOverlaid(bottomPresentation), {
|
|
93
|
+
height: panelBottomHeight,
|
|
94
|
+
flex: '0 0 auto',
|
|
95
|
+
overflow: 'hidden',
|
|
96
|
+
}) })) : null] }), sidebarRightVisible ? (_jsx(SurfaceArea, { surface: "sidebar:right", layout: "stack", role: "panel", edge: "inline-start", presentation: rightPresentation, resize: { edge: 'left', min: 160, max: 600 }, style: dockedStyle(!isOverlaid(rightPresentation), {
|
|
97
|
+
width: sidebarRightWidth,
|
|
98
|
+
flex: '0 0 auto',
|
|
99
|
+
overflow: 'hidden',
|
|
100
|
+
}) })) : null, lifted.length > 0 ? (dismissOnScrim ? (_jsx("button", { type: "button", className: "oo-surface-scrim", "aria-label": "Close", onClick: closeLifted })) : (_jsx("div", { className: "oo-surface-scrim", "aria-hidden": "true" }))) : null] }), statusbarVisible ? (_jsx(SurfaceArea, { surface: "statusbar", layout: "bar", role: "bar", edge: "block-start" })) : null, _jsx(SurfaceArea, { surface: "overlay", layout: "floating", role: "overlay", style: {
|
|
32
101
|
position: 'fixed',
|
|
33
102
|
inset: 0,
|
|
34
103
|
pointerEvents: 'none',
|
package/dist/react/Scena.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type { Scena as ScenaInstance } from '../
|
|
3
|
-
import type { CreateScenaOptions } from '../
|
|
2
|
+
import type { Scena as ScenaInstance } from '../sdk/scena.js';
|
|
3
|
+
import type { CreateScenaOptions } from '../sdk/scena.js';
|
|
4
4
|
export interface ScenaComponentProps {
|
|
5
5
|
options?: CreateScenaOptions;
|
|
6
6
|
onRender?: (scena: ScenaInstance) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CSSProperties } from 'react';
|
|
2
|
-
import type { SurfaceName } from '../
|
|
2
|
+
import type { SurfaceName } from '../sdk/mount-surface.js';
|
|
3
3
|
export interface ShellSplitterProps {
|
|
4
4
|
surface: SurfaceName;
|
|
5
5
|
orientation: 'vertical' | 'horizontal';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CSSProperties } from 'react';
|
|
2
|
-
import type { SurfacePresentation } from '../
|
|
3
|
-
import type { SurfaceName } from '../
|
|
2
|
+
import type { SurfaceEdge, SurfacePresentation, SurfaceRole } from '../sdk/layout.js';
|
|
3
|
+
import type { SurfaceName } from '../sdk/mount-surface.js';
|
|
4
4
|
import { type SurfaceResizeSpec } from './useSurfaceResize.js';
|
|
5
5
|
export interface SurfaceAreaProps {
|
|
6
6
|
surface: SurfaceName;
|
|
@@ -9,5 +9,7 @@ export interface SurfaceAreaProps {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
presentation?: SurfacePresentation;
|
|
11
11
|
resize?: SurfaceResizeSpec;
|
|
12
|
+
edge?: SurfaceEdge;
|
|
13
|
+
role?: SurfaceRole;
|
|
12
14
|
}
|
|
13
|
-
export declare function SurfaceArea({ surface, layout, style, className, presentation, resize, }: SurfaceAreaProps): import("react").JSX.Element;
|
|
15
|
+
export declare function SurfaceArea({ surface, layout, style, className, presentation, resize, edge, role, }: SurfaceAreaProps): import("react").JSX.Element;
|
|
@@ -11,7 +11,7 @@ function renderOneMount(mount) {
|
|
|
11
11
|
function FallbackLayout({ mounts }) {
|
|
12
12
|
return (_jsx(_Fragment, { children: mounts.map((m) => (_jsx("div", { style: { display: 'contents' }, children: renderOneMount(m) }, m.key))) }));
|
|
13
13
|
}
|
|
14
|
-
export function SurfaceArea({ surface, layout, style, className, presentation = 'docked', resize, }) {
|
|
14
|
+
export function SurfaceArea({ surface, layout, style, className, presentation = 'docked', resize, edge, role, }) {
|
|
15
15
|
const scena = useScena();
|
|
16
16
|
const layoutState = useLayout();
|
|
17
17
|
const mounts = useMounts(surface);
|
|
@@ -60,7 +60,7 @@ export function SurfaceArea({ surface, layout, style, className, presentation =
|
|
|
60
60
|
});
|
|
61
61
|
},
|
|
62
62
|
};
|
|
63
|
-
return (_jsx("div", { "data-surface": surface, "data-presentation": presentation, className: [
|
|
63
|
+
return (_jsx("div", { "data-surface": surface, "data-presentation": presentation, "data-surface-edge": edge, "data-surface-role": role, className: [
|
|
64
64
|
'oo-surface',
|
|
65
65
|
`oo-surface--${surface.replace(':', '-')}`,
|
|
66
66
|
className,
|
package/dist/react/ViewMount.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useReducer, useRef, useState, } from 'react';
|
|
3
|
-
import { isAction, isComponentNode, isDataBinding, isDynamicChildList, isFunctionCall, } from '../
|
|
3
|
+
import { isAction, isComponentNode, isDataBinding, isDynamicChildList, isFunctionCall, } from '../sdk/component-graph.js';
|
|
4
4
|
import { useScena } from './ScenaProvider.js';
|
|
5
5
|
import { DataContextContext, MountContext, WriteContext, useCurrentMountKey, useDataContext, } from './mount-context.js';
|
|
6
|
-
import { joinAbsolute, readPath } from '../core/path-resolver.js';
|
|
7
|
-
import { resolveAction, resolveDynamicValue, writeDynamic, } from '../core/dynamic-resolver.js';
|
|
8
|
-
import { rewriteLocal } from '../core/reactive-store.js';
|
|
6
|
+
import { joinAbsolute, readPath } from '../core/resolve/path-resolver.js';
|
|
7
|
+
import { resolveAction, resolveDynamicValue, writeDynamic, } from '../core/resolve/dynamic-resolver.js';
|
|
8
|
+
import { rewriteLocal } from '../core/store/reactive-store.js';
|
|
9
9
|
const RESERVED_KEYS = new Set(['id', 'component', '$meta']);
|
|
10
10
|
const reactComponentCache = new WeakMap();
|
|
11
11
|
const reactLoadingPromises = new WeakMap();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type LocaleInfo, type TranslateOptions } from '../../i18n/registry.js';
|
|
1
|
+
import { type LocaleInfo, type TranslateOptions } from '../../core/i18n/registry.js';
|
|
2
2
|
export interface UseI18nResult {
|
|
3
3
|
t: (key: string, fallbackOrOptions?: string | TranslateOptions) => string;
|
|
4
4
|
locale: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useSyncExternalStore } from 'react';
|
|
2
|
-
import { subscribeI18n, getLocale, getLocaleInfo, listLocaleInfo, translate, setLocale, } from '../../i18n/registry.js';
|
|
2
|
+
import { subscribeI18n, getLocale, getLocaleInfo, listLocaleInfo, translate, setLocale, } from '../../core/i18n/registry.js';
|
|
3
3
|
// Reactive translation for hand-written React. Subscribes to the i18n registry,
|
|
4
4
|
// so the component re-renders on locale switch / message registration. Optional
|
|
5
5
|
// `namespace` is prefixed to every key. For declarative ComponentNodes, bind
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Label } from '../../
|
|
1
|
+
import type { Label } from '../../sdk/label.js';
|
|
2
2
|
export declare function useLabel(label?: Label): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useStore } from './useStore.js';
|
|
2
2
|
import { useI18n } from './useI18n.js';
|
|
3
|
-
import { translate } from '../../i18n/registry.js';
|
|
3
|
+
import { translate } from '../../core/i18n/registry.js';
|
|
4
4
|
// Resolve a Label (string | { path } | { t }) reactively: `{ path }` follows the
|
|
5
5
|
// store, `{ t }` follows the locale, a string is returned as-is.
|
|
6
6
|
export function useLabel(label) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ScenaLayout } from '../../
|
|
1
|
+
import type { ScenaLayout } from '../../sdk/layout.js';
|
|
2
2
|
export declare function useLayout(): ScenaLayout;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ResolvedMount, SurfaceName } from '../../
|
|
1
|
+
import type { ResolvedMount, SurfaceName } from '../../sdk/mount-surface.js';
|
|
2
2
|
export declare function useMounts(surface: SurfaceName): ResolvedMount[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { BindingPath } from '../../
|
|
1
|
+
import type { BindingPath } from '../../sdk/component-graph.js';
|
|
2
2
|
export declare function useStore<T = unknown>(path: BindingPath | undefined, dataContextOverride?: BindingPath): T | undefined;
|
|
3
3
|
export declare function useStoreSetter(): (path: BindingPath, value: unknown) => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useMemo, useSyncExternalStore } from 'react';
|
|
2
2
|
import { useScena } from '../ScenaProvider.js';
|
|
3
3
|
import { useCurrentMountKey, useDataContext } from '../mount-context.js';
|
|
4
|
-
import { rewriteLocal } from '../../core/reactive-store.js';
|
|
5
|
-
import { joinAbsolute, readPath } from '../../core/path-resolver.js';
|
|
4
|
+
import { rewriteLocal } from '../../core/store/reactive-store.js';
|
|
5
|
+
import { joinAbsolute, readPath } from '../../core/resolve/path-resolver.js';
|
|
6
6
|
function resolveForRead(path, mountKey, dataContext) {
|
|
7
7
|
if (path.startsWith('/') && !path.startsWith('$/')) {
|
|
8
8
|
return joinAbsolute(dataContext, path);
|