@softov/scena 0.1.2
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/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/controls/command.d.ts +18 -0
- package/dist/controls/command.js +150 -0
- package/dist/controls/events.d.ts +3 -0
- package/dist/controls/events.js +43 -0
- package/dist/controls/index.d.ts +10 -0
- package/dist/controls/index.js +10 -0
- package/dist/controls/keybinding.d.ts +9 -0
- package/dist/controls/keybinding.js +94 -0
- package/dist/controls/layout.d.ts +16 -0
- package/dist/controls/layout.js +201 -0
- package/dist/controls/manifest.d.ts +21 -0
- package/dist/controls/manifest.js +219 -0
- package/dist/controls/session.d.ts +16 -0
- package/dist/controls/session.js +95 -0
- package/dist/controls/shell.d.ts +8 -0
- package/dist/controls/shell.js +48 -0
- package/dist/controls/storage/layout-local.d.ts +6 -0
- package/dist/controls/storage/layout-local.js +47 -0
- package/dist/controls/storage/session-local.d.ts +5 -0
- package/dist/controls/storage/session-local.js +38 -0
- package/dist/controls/when.d.ts +7 -0
- package/dist/controls/when.js +226 -0
- package/dist/converters/a2ui-v0.10.d.ts +23 -0
- package/dist/converters/a2ui-v0.10.js +136 -0
- package/dist/converters/index.d.ts +1 -0
- package/dist/converters/index.js +1 -0
- package/dist/core/backends/modus-backend.d.ts +13 -0
- package/dist/core/backends/modus-backend.js +115 -0
- package/dist/core/backends/storage-backend.d.ts +7 -0
- package/dist/core/backends/storage-backend.js +73 -0
- package/dist/core/backends/yjs-backend.d.ts +3 -0
- package/dist/core/backends/yjs-backend.js +44 -0
- package/dist/core/binding-resolver.d.ts +7 -0
- package/dist/core/binding-resolver.js +106 -0
- package/dist/core/component-graph.d.ts +6 -0
- package/dist/core/component-graph.js +77 -0
- package/dist/core/component-registry.d.ts +7 -0
- package/dist/core/component-registry.js +87 -0
- package/dist/core/computed-dsl.d.ts +2 -0
- package/dist/core/computed-dsl.js +267 -0
- package/dist/core/converter-registry.d.ts +2 -0
- package/dist/core/converter-registry.js +37 -0
- package/dist/core/disposable.d.ts +3 -0
- package/dist/core/disposable.js +19 -0
- package/dist/core/dynamic-resolver.d.ts +12 -0
- package/dist/core/dynamic-resolver.js +134 -0
- package/dist/core/index.d.ts +44 -0
- package/dist/core/index.js +48 -0
- package/dist/core/label.d.ts +2 -0
- package/dist/core/label.js +14 -0
- package/dist/core/mount-menu.d.ts +2 -0
- package/dist/core/mount-menu.js +23 -0
- package/dist/core/mount-surface.d.ts +15 -0
- package/dist/core/mount-surface.js +214 -0
- package/dist/core/path-resolver.d.ts +14 -0
- package/dist/core/path-resolver.js +169 -0
- package/dist/core/permissions.d.ts +2 -0
- package/dist/core/permissions.js +50 -0
- package/dist/core/reactive-store.d.ts +17 -0
- package/dist/core/reactive-store.js +496 -0
- package/dist/core/scena.d.ts +2 -0
- package/dist/core/scena.js +115 -0
- package/dist/core/surface-presentation.d.ts +6 -0
- package/dist/core/surface-presentation.js +12 -0
- package/dist/i18n/i18n-backend.d.ts +2 -0
- package/dist/i18n/i18n-backend.js +35 -0
- package/dist/i18n/registry.d.ts +32 -0
- package/dist/i18n/registry.js +200 -0
- package/dist/porta/Limen.css +50 -0
- package/dist/porta/Limen.d.ts +16 -0
- package/dist/porta/Limen.js +14 -0
- package/dist/porta/PortaContext.d.ts +10 -0
- package/dist/porta/PortaContext.js +20 -0
- package/dist/porta/PortaLock.css +14 -0
- package/dist/porta/PortaLock.d.ts +10 -0
- package/dist/porta/PortaLock.js +13 -0
- package/dist/porta/SigillumGate.d.ts +8 -0
- package/dist/porta/SigillumGate.js +7 -0
- package/dist/porta/commands.d.ts +3 -0
- package/dist/porta/commands.js +125 -0
- package/dist/porta/index.d.ts +18 -0
- package/dist/porta/index.js +22 -0
- package/dist/porta/login-form.block.d.ts +2 -0
- package/dist/porta/login-form.block.js +7 -0
- package/dist/porta/match.d.ts +2 -0
- package/dist/porta/match.js +20 -0
- package/dist/porta/provider.d.ts +59 -0
- package/dist/porta/provider.js +1 -0
- package/dist/porta/providers/examples/google-oauth.d.ts +6 -0
- package/dist/porta/providers/examples/google-oauth.js +21 -0
- package/dist/porta/providers/examples/index.d.ts +6 -0
- package/dist/porta/providers/examples/index.js +3 -0
- package/dist/porta/providers/examples/magic-link.d.ts +8 -0
- package/dist/porta/providers/examples/magic-link.js +31 -0
- package/dist/porta/providers/examples/sms-otp.d.ts +9 -0
- package/dist/porta/providers/examples/sms-otp.js +31 -0
- package/dist/porta/providers/password.d.ts +12 -0
- package/dist/porta/providers/password.js +46 -0
- package/dist/porta/register-blocks.d.ts +3 -0
- package/dist/porta/register-blocks.js +31 -0
- package/dist/porta/register.d.ts +15 -0
- package/dist/porta/register.js +31 -0
- package/dist/porta/sigillum.d.ts +19 -0
- package/dist/porta/sigillum.js +41 -0
- package/dist/react/DefaultShell.d.ts +1 -0
- package/dist/react/DefaultShell.js +37 -0
- package/dist/react/Scena.d.ts +9 -0
- package/dist/react/Scena.js +20 -0
- package/dist/react/ScenaProvider.d.ts +8 -0
- package/dist/react/ScenaProvider.js +13 -0
- package/dist/react/ShellSplitter.d.ts +13 -0
- package/dist/react/ShellSplitter.js +88 -0
- package/dist/react/SurfaceArea.d.ts +13 -0
- package/dist/react/SurfaceArea.js +75 -0
- package/dist/react/Translate.d.ts +8 -0
- package/dist/react/Translate.js +10 -0
- package/dist/react/ViewMount.d.ts +12 -0
- package/dist/react/ViewMount.js +268 -0
- package/dist/react/core.d.ts +6 -0
- package/dist/react/core.js +10 -0
- package/dist/react/hooks/useCommand.d.ts +1 -0
- package/dist/react/hooks/useCommand.js +6 -0
- package/dist/react/hooks/useI18n.d.ts +9 -0
- package/dist/react/hooks/useI18n.js +16 -0
- package/dist/react/hooks/useLabel.d.ts +2 -0
- package/dist/react/hooks/useLabel.js +19 -0
- package/dist/react/hooks/useLayout.d.ts +2 -0
- package/dist/react/hooks/useLayout.js +10 -0
- package/dist/react/hooks/useMounts.d.ts +2 -0
- package/dist/react/hooks/useMounts.js +17 -0
- package/dist/react/hooks/useStore.d.ts +3 -0
- package/dist/react/hooks/useStore.js +40 -0
- package/dist/react/hooks/useStoreLabel.d.ts +3 -0
- package/dist/react/hooks/useStoreLabel.js +25 -0
- package/dist/react/hooks/useSurfacePresentation.d.ts +4 -0
- package/dist/react/hooks/useSurfacePresentation.js +16 -0
- package/dist/react/index.d.ts +20 -0
- package/dist/react/index.js +20 -0
- package/dist/react/mount-context.d.ts +8 -0
- package/dist/react/mount-context.js +20 -0
- package/dist/react/useSurfaceResize.d.ts +39 -0
- package/dist/react/useSurfaceResize.js +135 -0
- package/dist/runtime/args-schema.d.ts +11 -0
- package/dist/runtime/args-schema.js +45 -0
- package/dist/runtime/builtins.d.ts +3 -0
- package/dist/runtime/builtins.js +193 -0
- package/dist/runtime/client-handlers.d.ts +3 -0
- package/dist/runtime/client-handlers.js +19 -0
- package/dist/runtime/in-memory-socket.d.ts +7 -0
- package/dist/runtime/in-memory-socket.js +53 -0
- package/dist/runtime/index.d.ts +10 -0
- package/dist/runtime/index.js +7 -0
- package/dist/runtime/layout-commands.d.ts +5 -0
- package/dist/runtime/layout-commands.js +548 -0
- package/dist/runtime/opener-commands.d.ts +17 -0
- package/dist/runtime/opener-commands.js +96 -0
- package/dist/runtime/surface-bridge.d.ts +15 -0
- package/dist/runtime/surface-bridge.js +116 -0
- package/dist/styles/bar.css +155 -0
- package/dist/styles/base.css +285 -0
- package/dist/styles/geometry.css +32 -0
- package/dist/styles/index.d.ts +29 -0
- package/dist/styles/index.js +109 -0
- package/dist/styles/scrollbar.css +45 -0
- package/dist/styles/surface.css +179 -0
- package/dist/styles/theme.css +3 -0
- package/dist/styles/themes/dark.css +30 -0
- package/dist/styles/themes/light.css +1 -0
- package/dist/styles/themes/tokens.css +222 -0
- package/dist/types/binding-resolver.d.ts +30 -0
- package/dist/types/binding-resolver.js +1 -0
- package/dist/types/colors.d.ts +7 -0
- package/dist/types/colors.js +59 -0
- package/dist/types/command.d.ts +62 -0
- package/dist/types/command.js +1 -0
- package/dist/types/component-graph.d.ts +72 -0
- package/dist/types/component-graph.js +40 -0
- package/dist/types/component-registry.d.ts +70 -0
- package/dist/types/component-registry.js +1 -0
- package/dist/types/converter-registry.d.ts +17 -0
- package/dist/types/converter-registry.js +1 -0
- package/dist/types/disposable.d.ts +3 -0
- package/dist/types/disposable.js +1 -0
- package/dist/types/events.d.ts +75 -0
- package/dist/types/events.js +1 -0
- package/dist/types/host.d.ts +50 -0
- package/dist/types/host.js +1 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/index.js +23 -0
- package/dist/types/keybinding.d.ts +36 -0
- package/dist/types/keybinding.js +1 -0
- package/dist/types/label.d.ts +9 -0
- package/dist/types/label.js +1 -0
- package/dist/types/layout.d.ts +117 -0
- package/dist/types/layout.js +1 -0
- package/dist/types/manifest.d.ts +152 -0
- package/dist/types/manifest.js +1 -0
- package/dist/types/mount-menu.d.ts +8 -0
- package/dist/types/mount-menu.js +1 -0
- package/dist/types/mount-surface.d.ts +87 -0
- package/dist/types/mount-surface.js +1 -0
- package/dist/types/permissions.d.ts +18 -0
- package/dist/types/permissions.js +1 -0
- package/dist/types/query.d.ts +34 -0
- package/dist/types/query.js +7 -0
- package/dist/types/reactive-store.d.ts +39 -0
- package/dist/types/reactive-store.js +1 -0
- package/dist/types/scena.d.ts +53 -0
- package/dist/types/scena.js +1 -0
- package/dist/types/scope-backend.d.ts +16 -0
- package/dist/types/scope-backend.js +1 -0
- package/dist/types/session.d.ts +39 -0
- package/dist/types/session.js +1 -0
- package/dist/types/shell.d.ts +21 -0
- package/dist/types/shell.js +1 -0
- package/dist/types/when.d.ts +10 -0
- package/dist/types/when.js +1 -0
- package/dist/ui/_utils.d.ts +8 -0
- package/dist/ui/_utils.js +53 -0
- package/dist/ui/campus/CampusMappa.d.ts +18 -0
- package/dist/ui/campus/CampusMappa.js +106 -0
- package/dist/ui/campus/CampusNodus.d.ts +25 -0
- package/dist/ui/campus/CampusNodus.js +211 -0
- package/dist/ui/campus/CampusStratum.d.ts +13 -0
- package/dist/ui/campus/CampusStratum.js +20 -0
- package/dist/ui/campus/CampusVelum.d.ts +7 -0
- package/dist/ui/campus/CampusVelum.js +12 -0
- package/dist/ui/campus/CampusView.d.ts +27 -0
- package/dist/ui/campus/CampusView.js +420 -0
- package/dist/ui/campus/context.d.ts +13 -0
- package/dist/ui/campus/context.js +12 -0
- package/dist/ui/campus/index.d.ts +14 -0
- package/dist/ui/campus/index.js +11 -0
- package/dist/ui/campus/stratum-context.d.ts +2 -0
- package/dist/ui/campus/stratum-context.js +10 -0
- package/dist/ui/campus/types.d.ts +47 -0
- package/dist/ui/campus/types.js +4 -0
- package/dist/ui/chart/BarChart.css +53 -0
- package/dist/ui/chart/BarChart.d.ts +24 -0
- package/dist/ui/chart/BarChart.js +32 -0
- package/dist/ui/chart/Donut.css +15 -0
- package/dist/ui/chart/Donut.d.ts +15 -0
- package/dist/ui/chart/Donut.js +18 -0
- package/dist/ui/chart/LineChart.css +8 -0
- package/dist/ui/chart/LineChart.d.ts +24 -0
- package/dist/ui/chart/LineChart.js +29 -0
- package/dist/ui/chart/catalog.d.ts +2 -0
- package/dist/ui/chart/catalog.js +7 -0
- package/dist/ui/chart/index.d.ts +6 -0
- package/dist/ui/chart/index.js +4 -0
- package/dist/ui/control/Button.css +7 -0
- package/dist/ui/control/Button.d.ts +17 -0
- package/dist/ui/control/Button.js +17 -0
- package/dist/ui/control/CheckBox.css +16 -0
- package/dist/ui/control/CheckBox.d.ts +15 -0
- package/dist/ui/control/CheckBox.js +23 -0
- package/dist/ui/control/Checks.css +6 -0
- package/dist/ui/control/Checks.d.ts +9 -0
- package/dist/ui/control/Checks.js +10 -0
- package/dist/ui/control/ChoicePicker.css +16 -0
- package/dist/ui/control/ChoicePicker.d.ts +25 -0
- package/dist/ui/control/ChoicePicker.js +38 -0
- package/dist/ui/control/DateTimeInput.css +1 -0
- package/dist/ui/control/DateTimeInput.d.ts +22 -0
- package/dist/ui/control/DateTimeInput.js +41 -0
- package/dist/ui/control/LocaleToggle.css +38 -0
- package/dist/ui/control/LocaleToggle.d.ts +11 -0
- package/dist/ui/control/LocaleToggle.js +23 -0
- package/dist/ui/control/ReloadButton.d.ts +6 -0
- package/dist/ui/control/ReloadButton.js +9 -0
- package/dist/ui/control/Slider.css +2 -0
- package/dist/ui/control/Slider.d.ts +21 -0
- package/dist/ui/control/Slider.js +37 -0
- package/dist/ui/control/TextField.css +0 -0
- package/dist/ui/control/TextField.d.ts +25 -0
- package/dist/ui/control/TextField.js +36 -0
- package/dist/ui/control/_field-parts.css +102 -0
- package/dist/ui/control/_field-parts.d.ts +15 -0
- package/dist/ui/control/_field-parts.js +17 -0
- package/dist/ui/control/catalog.d.ts +2 -0
- package/dist/ui/control/catalog.js +10 -0
- package/dist/ui/control/index.d.ts +13 -0
- package/dist/ui/control/index.js +11 -0
- package/dist/ui/data/DataTable.d.ts +19 -0
- package/dist/ui/data/DataTable.js +20 -0
- package/dist/ui/data/Filter.d.ts +13 -0
- package/dist/ui/data/Filter.js +56 -0
- package/dist/ui/data/List.css +16 -0
- package/dist/ui/data/List.d.ts +15 -0
- package/dist/ui/data/List.js +18 -0
- package/dist/ui/data/Listable.css +245 -0
- package/dist/ui/data/Listable.d.ts +60 -0
- package/dist/ui/data/Listable.js +209 -0
- package/dist/ui/data/Pagination.d.ts +5 -0
- package/dist/ui/data/Pagination.js +43 -0
- package/dist/ui/data/Tree.css +118 -0
- package/dist/ui/data/Tree.d.ts +45 -0
- package/dist/ui/data/Tree.js +170 -0
- package/dist/ui/data/catalog.d.ts +2 -0
- package/dist/ui/data/catalog.js +7 -0
- package/dist/ui/data/index.d.ts +11 -0
- package/dist/ui/data/index.js +7 -0
- package/dist/ui/display/AddPlaceholder.d.ts +6 -0
- package/dist/ui/display/AddPlaceholder.js +24 -0
- package/dist/ui/display/Alert.css +42 -0
- package/dist/ui/display/Alert.d.ts +14 -0
- package/dist/ui/display/Alert.js +13 -0
- package/dist/ui/display/Avatar.css +19 -0
- package/dist/ui/display/Avatar.d.ts +16 -0
- package/dist/ui/display/Avatar.js +52 -0
- package/dist/ui/display/Badge.css +26 -0
- package/dist/ui/display/Badge.d.ts +16 -0
- package/dist/ui/display/Badge.js +9 -0
- package/dist/ui/display/Card.css +15 -0
- package/dist/ui/display/Card.d.ts +11 -0
- package/dist/ui/display/Card.js +8 -0
- package/dist/ui/display/DetailContainer.d.ts +6 -0
- package/dist/ui/display/DetailContainer.js +7 -0
- package/dist/ui/display/DetailHeader.css +53 -0
- package/dist/ui/display/DetailHeader.d.ts +22 -0
- package/dist/ui/display/DetailHeader.js +8 -0
- package/dist/ui/display/DetailList.css +26 -0
- package/dist/ui/display/DetailList.d.ts +13 -0
- package/dist/ui/display/DetailList.js +5 -0
- package/dist/ui/display/DetailNotFound.d.ts +17 -0
- package/dist/ui/display/DetailNotFound.js +39 -0
- package/dist/ui/display/Divider.css +6 -0
- package/dist/ui/display/Divider.d.ts +8 -0
- package/dist/ui/display/Divider.js +16 -0
- package/dist/ui/display/Divisor.css +30 -0
- package/dist/ui/display/Divisor.d.ts +11 -0
- package/dist/ui/display/Divisor.js +43 -0
- package/dist/ui/display/Icon.css +10 -0
- package/dist/ui/display/Icon.d.ts +14 -0
- package/dist/ui/display/Icon.js +144 -0
- package/dist/ui/display/Image.css +1 -0
- package/dist/ui/display/Image.d.ts +16 -0
- package/dist/ui/display/Image.js +19 -0
- package/dist/ui/display/Markdown.css +38 -0
- package/dist/ui/display/Markdown.d.ts +8 -0
- package/dist/ui/display/Markdown.js +140 -0
- package/dist/ui/display/Progress.css +39 -0
- package/dist/ui/display/Progress.d.ts +15 -0
- package/dist/ui/display/Progress.js +17 -0
- package/dist/ui/display/SectionTitle.d.ts +6 -0
- package/dist/ui/display/SectionTitle.js +6 -0
- package/dist/ui/display/Skeleton.css +20 -0
- package/dist/ui/display/Skeleton.d.ts +11 -0
- package/dist/ui/display/Skeleton.js +11 -0
- package/dist/ui/display/Spinner.css +20 -0
- package/dist/ui/display/Spinner.d.ts +12 -0
- package/dist/ui/display/Spinner.js +12 -0
- package/dist/ui/display/Svg.d.ts +13 -0
- package/dist/ui/display/Svg.js +17 -0
- package/dist/ui/display/Text.css +20 -0
- package/dist/ui/display/Text.d.ts +13 -0
- package/dist/ui/display/Text.js +15 -0
- package/dist/ui/display/catalog.d.ts +2 -0
- package/dist/ui/display/catalog.js +12 -0
- package/dist/ui/display/index.d.ts +22 -0
- package/dist/ui/display/index.js +14 -0
- package/dist/ui/embed/HtmlEmbed.d.ts +12 -0
- package/dist/ui/embed/HtmlEmbed.js +16 -0
- package/dist/ui/embed/index.d.ts +2 -0
- package/dist/ui/embed/index.js +1 -0
- package/dist/ui/forms/DangerZone.d.ts +8 -0
- package/dist/ui/forms/DangerZone.js +31 -0
- package/dist/ui/forms/Field.css +15 -0
- package/dist/ui/forms/Field.d.ts +28 -0
- package/dist/ui/forms/Field.js +25 -0
- package/dist/ui/forms/FieldGroup.css +15 -0
- package/dist/ui/forms/FieldGroup.d.ts +7 -0
- package/dist/ui/forms/FieldGroup.js +7 -0
- package/dist/ui/forms/Form.css +14 -0
- package/dist/ui/forms/Form.d.ts +18 -0
- package/dist/ui/forms/Form.js +17 -0
- package/dist/ui/forms/FormActions.css +11 -0
- package/dist/ui/forms/FormActions.d.ts +18 -0
- package/dist/ui/forms/FormActions.js +10 -0
- package/dist/ui/forms/FormSection.css +19 -0
- package/dist/ui/forms/FormSection.d.ts +7 -0
- package/dist/ui/forms/FormSection.js +7 -0
- package/dist/ui/forms/LoginForm.css +105 -0
- package/dist/ui/forms/LoginForm.d.ts +12 -0
- package/dist/ui/forms/LoginForm.js +137 -0
- package/dist/ui/forms/SchemaForm.css +81 -0
- package/dist/ui/forms/SchemaForm.d.ts +26 -0
- package/dist/ui/forms/SchemaForm.js +186 -0
- package/dist/ui/forms/SettingsContainer.d.ts +8 -0
- package/dist/ui/forms/SettingsContainer.js +8 -0
- package/dist/ui/forms/catalog.d.ts +2 -0
- package/dist/ui/forms/catalog.js +11 -0
- package/dist/ui/forms/index.d.ts +19 -0
- package/dist/ui/forms/index.js +12 -0
- package/dist/ui/forms/schema-walk.d.ts +50 -0
- package/dist/ui/forms/schema-walk.js +116 -0
- package/dist/ui/index.d.ts +58 -0
- package/dist/ui/index.js +63 -0
- package/dist/ui/layout/BarLayout.d.ts +2 -0
- package/dist/ui/layout/BarLayout.js +18 -0
- package/dist/ui/layout/Column.css +6 -0
- package/dist/ui/layout/Column.d.ts +12 -0
- package/dist/ui/layout/Column.js +13 -0
- package/dist/ui/layout/FloatingLayout.d.ts +2 -0
- package/dist/ui/layout/FloatingLayout.js +12 -0
- package/dist/ui/layout/Grid.css +5 -0
- package/dist/ui/layout/Grid.d.ts +13 -0
- package/dist/ui/layout/Grid.js +19 -0
- package/dist/ui/layout/InlineLayout.d.ts +2 -0
- package/dist/ui/layout/InlineLayout.js +13 -0
- package/dist/ui/layout/MountTitle.d.ts +12 -0
- package/dist/ui/layout/MountTitle.js +42 -0
- package/dist/ui/layout/RailLayout.d.ts +2 -0
- package/dist/ui/layout/RailLayout.js +38 -0
- package/dist/ui/layout/Row.css +16 -0
- package/dist/ui/layout/Row.d.ts +13 -0
- package/dist/ui/layout/Row.js +21 -0
- package/dist/ui/layout/SectionHeader.d.ts +10 -0
- package/dist/ui/layout/SectionHeader.js +65 -0
- package/dist/ui/layout/SingleLayout.d.ts +2 -0
- package/dist/ui/layout/SingleLayout.js +25 -0
- package/dist/ui/layout/SpatialCard.d.ts +9 -0
- package/dist/ui/layout/SpatialCard.js +30 -0
- package/dist/ui/layout/SpatialLayout.d.ts +2 -0
- package/dist/ui/layout/SpatialLayout.js +446 -0
- package/dist/ui/layout/SplitLayout.d.ts +2 -0
- package/dist/ui/layout/SplitLayout.js +159 -0
- package/dist/ui/layout/Splitter.d.ts +12 -0
- package/dist/ui/layout/Splitter.js +64 -0
- package/dist/ui/layout/StackHeader.d.ts +9 -0
- package/dist/ui/layout/StackHeader.js +87 -0
- package/dist/ui/layout/StackLayout.d.ts +2 -0
- package/dist/ui/layout/StackLayout.js +137 -0
- package/dist/ui/layout/TabLayout.d.ts +2 -0
- package/dist/ui/layout/TabLayout.js +145 -0
- package/dist/ui/layout/TabPanelLayout.d.ts +20 -0
- package/dist/ui/layout/TabPanelLayout.js +615 -0
- package/dist/ui/layout/catalog.d.ts +2 -0
- package/dist/ui/layout/catalog.js +10 -0
- package/dist/ui/layout/index.d.ts +17 -0
- package/dist/ui/layout/index.js +17 -0
- package/dist/ui/layout/register.d.ts +3 -0
- package/dist/ui/layout/register.js +25 -0
- package/dist/ui/media/Audio.css +1 -0
- package/dist/ui/media/Audio.d.ts +12 -0
- package/dist/ui/media/Audio.js +8 -0
- package/dist/ui/media/Video.css +1 -0
- package/dist/ui/media/Video.d.ts +16 -0
- package/dist/ui/media/Video.js +9 -0
- package/dist/ui/media/catalog.d.ts +2 -0
- package/dist/ui/media/catalog.js +5 -0
- package/dist/ui/media/index.d.ts +2 -0
- package/dist/ui/media/index.js +3 -0
- package/dist/ui/menu/ActionList.css +262 -0
- package/dist/ui/menu/ActionList.d.ts +19 -0
- package/dist/ui/menu/ActionList.js +369 -0
- package/dist/ui/menu/ContainerMenu.d.ts +13 -0
- package/dist/ui/menu/ContainerMenu.js +57 -0
- package/dist/ui/menu/ContextMenu.d.ts +27 -0
- package/dist/ui/menu/ContextMenu.js +93 -0
- package/dist/ui/menu/index.d.ts +10 -0
- package/dist/ui/menu/index.js +7 -0
- package/dist/ui/menu/token.d.ts +22 -0
- package/dist/ui/menu/token.js +145 -0
- package/dist/ui/menu/useChatPicker.d.ts +24 -0
- package/dist/ui/menu/useChatPicker.js +210 -0
- package/dist/ui/navigation/Breadcrumb.css +30 -0
- package/dist/ui/navigation/Breadcrumb.d.ts +14 -0
- package/dist/ui/navigation/Breadcrumb.js +12 -0
- package/dist/ui/navigation/Link.css +13 -0
- package/dist/ui/navigation/Link.d.ts +18 -0
- package/dist/ui/navigation/Link.js +43 -0
- package/dist/ui/navigation/Tabs.css +39 -0
- package/dist/ui/navigation/Tabs.d.ts +18 -0
- package/dist/ui/navigation/Tabs.js +55 -0
- package/dist/ui/navigation/Toolbar.css +25 -0
- package/dist/ui/navigation/Toolbar.d.ts +12 -0
- package/dist/ui/navigation/Toolbar.js +21 -0
- package/dist/ui/navigation/catalog.d.ts +2 -0
- package/dist/ui/navigation/catalog.js +5 -0
- package/dist/ui/navigation/index.d.ts +8 -0
- package/dist/ui/navigation/index.js +5 -0
- package/dist/ui/overlay/Modal.css +35 -0
- package/dist/ui/overlay/Modal.d.ts +12 -0
- package/dist/ui/overlay/Modal.js +57 -0
- package/dist/ui/overlay/Popup.d.ts +12 -0
- package/dist/ui/overlay/Popup.js +74 -0
- package/dist/ui/overlay/catalog.d.ts +2 -0
- package/dist/ui/overlay/catalog.js +4 -0
- package/dist/ui/overlay/index.d.ts +1 -0
- package/dist/ui/overlay/index.js +2 -0
- package/dist/ui/register.d.ts +6 -0
- package/dist/ui/register.js +26 -0
- package/package.json +115 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useSyncExternalStore } from 'react';
|
|
3
|
+
import { useCampus } from './context.js';
|
|
4
|
+
import { resolveColorAlpha } from '../../types/colors.js';
|
|
5
|
+
const DEFAULT_W = 160;
|
|
6
|
+
const DEFAULT_H = 110;
|
|
7
|
+
const DEFAULT_PADDING = 12;
|
|
8
|
+
const DEFAULT_ANCHOR = { bottom: 12, right: 12 };
|
|
9
|
+
export function CampusMappa({ nodes, onJumpTo, width = DEFAULT_W, height = DEFAULT_H, padding = DEFAULT_PADDING, anchor = DEFAULT_ANCHOR, className, style, }) {
|
|
10
|
+
const { viewportRef, subscribeViewport, container } = useCampus();
|
|
11
|
+
// Subscribe to viewport commits so the minimap redraws as the user pans/
|
|
12
|
+
// zooms — without re-rendering the node subtree (which reads the ref).
|
|
13
|
+
const viewport = useSyncExternalStore(subscribeViewport, () => viewportRef.current);
|
|
14
|
+
if (container.w === 0 || container.h === 0)
|
|
15
|
+
return null;
|
|
16
|
+
// World bounding box of all nodes.
|
|
17
|
+
let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
|
|
18
|
+
for (const n of nodes) {
|
|
19
|
+
minX = Math.min(minX, n.bounds.x);
|
|
20
|
+
minY = Math.min(minY, n.bounds.y);
|
|
21
|
+
maxX = Math.max(maxX, n.bounds.x + n.bounds.w);
|
|
22
|
+
maxY = Math.max(maxY, n.bounds.y + n.bounds.h);
|
|
23
|
+
}
|
|
24
|
+
// Always include the viewport rect so the user can see where they are
|
|
25
|
+
// even when no nodes exist (or all are off-screen).
|
|
26
|
+
const viewLeft = -viewport.panX / viewport.scale;
|
|
27
|
+
const viewTop = -viewport.panY / viewport.scale;
|
|
28
|
+
const viewRight = viewLeft + container.w / viewport.scale;
|
|
29
|
+
const viewBottom = viewTop + container.h / viewport.scale;
|
|
30
|
+
if (!isFinite(minX)) {
|
|
31
|
+
minX = viewLeft;
|
|
32
|
+
minY = viewTop;
|
|
33
|
+
maxX = viewRight;
|
|
34
|
+
maxY = viewBottom;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
minX = Math.min(minX, viewLeft);
|
|
38
|
+
minY = Math.min(minY, viewTop);
|
|
39
|
+
maxX = Math.max(maxX, viewRight);
|
|
40
|
+
maxY = Math.max(maxY, viewBottom);
|
|
41
|
+
}
|
|
42
|
+
const worldW = Math.max(1, maxX - minX);
|
|
43
|
+
const worldH = Math.max(1, maxY - minY);
|
|
44
|
+
const innerW = width - padding * 2;
|
|
45
|
+
const innerH = height - padding * 2;
|
|
46
|
+
const scale = Math.min(innerW / worldW, innerH / worldH);
|
|
47
|
+
function worldToMini(x, y) {
|
|
48
|
+
return [padding + (x - minX) * scale, padding + (y - minY) * scale];
|
|
49
|
+
}
|
|
50
|
+
function onMiniClick(e) {
|
|
51
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
52
|
+
const miniX = e.clientX - rect.left;
|
|
53
|
+
const miniY = e.clientY - rect.top;
|
|
54
|
+
const wx = (miniX - padding) / scale + minX;
|
|
55
|
+
const wy = (miniY - padding) / scale + minY;
|
|
56
|
+
onJumpTo(wx, wy);
|
|
57
|
+
}
|
|
58
|
+
const [vx, vy] = worldToMini(viewLeft, viewTop);
|
|
59
|
+
const vw = (viewRight - viewLeft) * scale;
|
|
60
|
+
const vh = (viewBottom - viewTop) * scale;
|
|
61
|
+
return (_jsxs("div", { className: ['oo-campus-mappa', className].filter(Boolean).join(' '), onClick: onMiniClick, onPointerDown: (e) => e.stopPropagation(), style: {
|
|
62
|
+
position: 'absolute',
|
|
63
|
+
...anchor,
|
|
64
|
+
width,
|
|
65
|
+
height,
|
|
66
|
+
// Opt back into pointer events: the CampusVelum overlay that hosts
|
|
67
|
+
// the minimap is pointer-transparent so it doesn't block the canvas.
|
|
68
|
+
pointerEvents: 'auto',
|
|
69
|
+
background: 'rgba(20, 20, 24, 0.75)',
|
|
70
|
+
backdropFilter: 'blur(6px)',
|
|
71
|
+
WebkitBackdropFilter: 'blur(6px)',
|
|
72
|
+
borderRadius: 'var(--oo-radius-sm, 4px)',
|
|
73
|
+
boxShadow: '0 6px 20px rgba(0, 0, 0, 0.32)',
|
|
74
|
+
cursor: 'crosshair',
|
|
75
|
+
zIndex: 40,
|
|
76
|
+
overflow: 'hidden',
|
|
77
|
+
...style,
|
|
78
|
+
}, children: [nodes.map((n) => {
|
|
79
|
+
const [mx, my] = worldToMini(n.bounds.x, n.bounds.y);
|
|
80
|
+
const mw = Math.max(2, n.bounds.w * scale);
|
|
81
|
+
const mh = Math.max(2, n.bounds.h * scale);
|
|
82
|
+
return (_jsx("div", { title: n.id, style: {
|
|
83
|
+
position: 'absolute',
|
|
84
|
+
left: mx,
|
|
85
|
+
top: my,
|
|
86
|
+
width: mw,
|
|
87
|
+
height: mh,
|
|
88
|
+
background: resolveColorAlpha(n.color, 0.85),
|
|
89
|
+
border: n.selected
|
|
90
|
+
? '1px solid rgba(255, 255, 255, 0.9)'
|
|
91
|
+
: '1px solid rgba(255, 255, 255, 0.18)',
|
|
92
|
+
borderRadius: 2,
|
|
93
|
+
boxSizing: 'border-box',
|
|
94
|
+
} }, n.id));
|
|
95
|
+
}), _jsx("div", { style: {
|
|
96
|
+
position: 'absolute',
|
|
97
|
+
left: vx,
|
|
98
|
+
top: vy,
|
|
99
|
+
width: vw,
|
|
100
|
+
height: vh,
|
|
101
|
+
border: '1px solid rgba(255, 255, 255, 0.9)',
|
|
102
|
+
background: 'rgba(255, 255, 255, 0.06)',
|
|
103
|
+
pointerEvents: 'none',
|
|
104
|
+
boxSizing: 'border-box',
|
|
105
|
+
} })] }));
|
|
106
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type CSSProperties, type MouseEvent as ReactMouseEvent, type PointerEvent as ReactPointerEvent, type ReactNode } from 'react';
|
|
2
|
+
import type { CampusBounds } from './types.js';
|
|
3
|
+
export type ResizeMode = 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw';
|
|
4
|
+
export type DragMode = 'move' | ResizeMode;
|
|
5
|
+
export interface CampusNodusProps {
|
|
6
|
+
bounds: CampusBounds;
|
|
7
|
+
onCommit(next: CampusBounds): void;
|
|
8
|
+
minSize?: {
|
|
9
|
+
w: number;
|
|
10
|
+
h: number;
|
|
11
|
+
};
|
|
12
|
+
resizable?: boolean;
|
|
13
|
+
movable?: boolean;
|
|
14
|
+
dragHandle?: string;
|
|
15
|
+
selected?: boolean;
|
|
16
|
+
zIndex?: number;
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
onPointerDownCapture?(e: ReactPointerEvent<HTMLDivElement>): void;
|
|
19
|
+
onClick?(e: ReactMouseEvent<HTMLDivElement>): void;
|
|
20
|
+
onContextMenu?(e: ReactMouseEvent<HTMLDivElement>): void;
|
|
21
|
+
className?: string;
|
|
22
|
+
style?: CSSProperties;
|
|
23
|
+
bodyStyle?: CSSProperties;
|
|
24
|
+
}
|
|
25
|
+
export declare function CampusNodus({ bounds, onCommit, minSize, resizable, movable, dragHandle, selected, zIndex, children, onPointerDownCapture, onClick, onContextMenu, className, style, bodyStyle, }: CampusNodusProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState, } from 'react';
|
|
3
|
+
import { useCampus } from './context.js';
|
|
4
|
+
import { useStratumZoom } from './stratum-context.js';
|
|
5
|
+
const RESIZE_CURSORS = {
|
|
6
|
+
n: 'ns-resize',
|
|
7
|
+
s: 'ns-resize',
|
|
8
|
+
e: 'ew-resize',
|
|
9
|
+
w: 'ew-resize',
|
|
10
|
+
ne: 'nesw-resize',
|
|
11
|
+
sw: 'nesw-resize',
|
|
12
|
+
nw: 'nwse-resize',
|
|
13
|
+
se: 'nwse-resize',
|
|
14
|
+
};
|
|
15
|
+
const DEFAULT_MIN_SIZE = { w: 80, h: 60 };
|
|
16
|
+
function applyResize(mode, start, dx, dy, min, maxDepth) {
|
|
17
|
+
let x = start.x;
|
|
18
|
+
let y = start.y;
|
|
19
|
+
let w = start.w;
|
|
20
|
+
let h = start.h;
|
|
21
|
+
if (mode.includes('w')) {
|
|
22
|
+
x = start.x + dx;
|
|
23
|
+
w = start.w - dx;
|
|
24
|
+
}
|
|
25
|
+
if (mode.includes('e')) {
|
|
26
|
+
w = start.w + dx;
|
|
27
|
+
}
|
|
28
|
+
if (mode.includes('n')) {
|
|
29
|
+
y = start.y + dy;
|
|
30
|
+
h = start.h - dy;
|
|
31
|
+
}
|
|
32
|
+
if (mode.includes('s')) {
|
|
33
|
+
h = start.h + dy;
|
|
34
|
+
}
|
|
35
|
+
// Min-size clamp preserves the anchored edge.
|
|
36
|
+
if (w < min.w) {
|
|
37
|
+
if (mode.includes('w'))
|
|
38
|
+
x = start.x + (start.w - min.w);
|
|
39
|
+
w = min.w;
|
|
40
|
+
}
|
|
41
|
+
if (h < min.h) {
|
|
42
|
+
if (mode.includes('n'))
|
|
43
|
+
y = start.y + (start.h - min.h);
|
|
44
|
+
h = min.h;
|
|
45
|
+
}
|
|
46
|
+
// World-bounds clamp. Origin can be negative; only enforced when
|
|
47
|
+
// maxDepth is finite. The west/north edges clamp to -maxDepth; the
|
|
48
|
+
// east/south edges clamp to +maxDepth, with width/height adjusted to
|
|
49
|
+
// keep the anchored edge stable.
|
|
50
|
+
if (isFinite(maxDepth)) {
|
|
51
|
+
if (x < -maxDepth) {
|
|
52
|
+
if (mode.includes('w'))
|
|
53
|
+
w = start.x + start.w - (-maxDepth);
|
|
54
|
+
x = -maxDepth;
|
|
55
|
+
}
|
|
56
|
+
if (y < -maxDepth) {
|
|
57
|
+
if (mode.includes('n'))
|
|
58
|
+
h = start.y + start.h - (-maxDepth);
|
|
59
|
+
y = -maxDepth;
|
|
60
|
+
}
|
|
61
|
+
if (x + w > maxDepth)
|
|
62
|
+
w = maxDepth - x;
|
|
63
|
+
if (y + h > maxDepth)
|
|
64
|
+
h = maxDepth - y;
|
|
65
|
+
}
|
|
66
|
+
return { x, y, w, h };
|
|
67
|
+
}
|
|
68
|
+
function clampMove(start, dx, dy, maxDepth) {
|
|
69
|
+
let x = start.x + dx;
|
|
70
|
+
let y = start.y + dy;
|
|
71
|
+
if (isFinite(maxDepth)) {
|
|
72
|
+
x = Math.max(-maxDepth, Math.min(maxDepth - start.w, x));
|
|
73
|
+
y = Math.max(-maxDepth, Math.min(maxDepth - start.h, y));
|
|
74
|
+
}
|
|
75
|
+
return { ...start, x, y };
|
|
76
|
+
}
|
|
77
|
+
export function CampusNodus({ bounds, onCommit, minSize = DEFAULT_MIN_SIZE, resizable = true, movable = true, dragHandle = '[data-campus-drag]', selected = false, zIndex, children, onPointerDownCapture, onClick, onContextMenu, className, style, bodyStyle, }) {
|
|
78
|
+
const { viewportRef, maxDepth } = useCampus();
|
|
79
|
+
const stratumZoom = useStratumZoom();
|
|
80
|
+
// Live local bounds during drag (so React state updates ~1×/frame instead
|
|
81
|
+
// of every pointermove). `null` means "no drag in progress; render the
|
|
82
|
+
// controlled `bounds` prop directly".
|
|
83
|
+
const [live, setLive] = useState(null);
|
|
84
|
+
const dragRef = useRef(null);
|
|
85
|
+
const rafRef = useRef(null);
|
|
86
|
+
const pendingRef = useRef(null);
|
|
87
|
+
// Reset live state whenever controlled bounds change from outside (e.g.,
|
|
88
|
+
// parent committed our previous drag, or layout snapshotted everything).
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
setLive(null);
|
|
91
|
+
}, [bounds.x, bounds.y, bounds.w, bounds.h]);
|
|
92
|
+
// Drag math reads the live EFFECTIVE scale (viewport × this stratum's
|
|
93
|
+
// static zoom) straight from the campus viewport ref inside pointer
|
|
94
|
+
// handlers — so a wheel-zoom mid-drag stays 1:1, dragging stays 1:1 inside
|
|
95
|
+
// a scaled layer, AND this node never re-renders on pan/zoom.
|
|
96
|
+
function flush() {
|
|
97
|
+
if (pendingRef.current) {
|
|
98
|
+
setLive(pendingRef.current);
|
|
99
|
+
pendingRef.current = null;
|
|
100
|
+
}
|
|
101
|
+
rafRef.current = null;
|
|
102
|
+
}
|
|
103
|
+
function startDrag(mode, e) {
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
e.stopPropagation();
|
|
106
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
107
|
+
dragRef.current = {
|
|
108
|
+
mode,
|
|
109
|
+
startX: e.clientX,
|
|
110
|
+
startY: e.clientY,
|
|
111
|
+
start: live ?? bounds,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
// Move drag starts from the root, but only when the pointerdown lands
|
|
115
|
+
// inside the `dragHandle` region of the node content. Resize handles
|
|
116
|
+
// stopPropagation in their own pointerdown, so they never reach here.
|
|
117
|
+
function onRootPointerDown(e) {
|
|
118
|
+
if (!movable)
|
|
119
|
+
return;
|
|
120
|
+
const target = e.target;
|
|
121
|
+
if (!target || !target.closest(dragHandle))
|
|
122
|
+
return;
|
|
123
|
+
startDrag('move', e);
|
|
124
|
+
}
|
|
125
|
+
function onPointerMove(e) {
|
|
126
|
+
const d = dragRef.current;
|
|
127
|
+
if (!d)
|
|
128
|
+
return;
|
|
129
|
+
const s = (viewportRef.current.scale * stratumZoom) || 1;
|
|
130
|
+
const dx = (e.clientX - d.startX) / s;
|
|
131
|
+
const dy = (e.clientY - d.startY) / s;
|
|
132
|
+
const next = d.mode === 'move'
|
|
133
|
+
? clampMove(d.start, dx, dy, maxDepth)
|
|
134
|
+
: applyResize(d.mode, d.start, dx, dy, minSize, maxDepth);
|
|
135
|
+
pendingRef.current = next;
|
|
136
|
+
if (rafRef.current === null)
|
|
137
|
+
rafRef.current = requestAnimationFrame(flush);
|
|
138
|
+
}
|
|
139
|
+
function endDrag(e) {
|
|
140
|
+
if (!dragRef.current)
|
|
141
|
+
return;
|
|
142
|
+
if (rafRef.current !== null) {
|
|
143
|
+
cancelAnimationFrame(rafRef.current);
|
|
144
|
+
flush();
|
|
145
|
+
}
|
|
146
|
+
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
147
|
+
const final = pendingRef.current ?? live ?? bounds;
|
|
148
|
+
pendingRef.current = null;
|
|
149
|
+
dragRef.current = null;
|
|
150
|
+
onCommit(final);
|
|
151
|
+
}
|
|
152
|
+
const visible = live ?? bounds;
|
|
153
|
+
const rootStyle = {
|
|
154
|
+
position: 'absolute',
|
|
155
|
+
left: visible.x,
|
|
156
|
+
top: visible.y,
|
|
157
|
+
width: visible.w,
|
|
158
|
+
height: visible.h,
|
|
159
|
+
display: 'flex',
|
|
160
|
+
flexDirection: 'column',
|
|
161
|
+
overflow: 'hidden',
|
|
162
|
+
zIndex: zIndex ?? (selected ? 10 : 1),
|
|
163
|
+
background: 'var(--oo-color-canvas)',
|
|
164
|
+
border: `1px solid ${selected ? 'var(--oo-color-accent)' : 'var(--oo-color-border)'}`,
|
|
165
|
+
borderRadius: 'var(--oo-radius-sm)',
|
|
166
|
+
boxShadow: selected ? 'var(--oo-shadow-lg)' : 'var(--oo-shadow-md)',
|
|
167
|
+
...style,
|
|
168
|
+
};
|
|
169
|
+
return (_jsxs("div", { className: ['oo-campus-nodus', className].filter(Boolean).join(' '), "data-selected": selected, style: rootStyle, onPointerDownCapture: onPointerDownCapture, onPointerDown: onRootPointerDown, onPointerMove: onPointerMove, onPointerUp: endDrag, onClick: onClick, onContextMenu: onContextMenu, children: [_jsx("div", { style: { flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column', overflow: 'hidden', ...bodyStyle }, children: children }), resizable ? (_jsxs(_Fragment, { children: [_jsx(ResizeHandle, { mode: "n", startDrag: startDrag, onPointerMove: onPointerMove, endDrag: endDrag }), _jsx(ResizeHandle, { mode: "s", startDrag: startDrag, onPointerMove: onPointerMove, endDrag: endDrag }), _jsx(ResizeHandle, { mode: "e", startDrag: startDrag, onPointerMove: onPointerMove, endDrag: endDrag }), _jsx(ResizeHandle, { mode: "w", startDrag: startDrag, onPointerMove: onPointerMove, endDrag: endDrag }), _jsx(ResizeHandle, { mode: "nw", startDrag: startDrag, onPointerMove: onPointerMove, endDrag: endDrag }), _jsx(ResizeHandle, { mode: "ne", startDrag: startDrag, onPointerMove: onPointerMove, endDrag: endDrag }), _jsx(ResizeHandle, { mode: "sw", startDrag: startDrag, onPointerMove: onPointerMove, endDrag: endDrag }), _jsx(ResizeHandle, { mode: "se", startDrag: startDrag, onPointerMove: onPointerMove, endDrag: endDrag })] })) : null] }));
|
|
170
|
+
}
|
|
171
|
+
function ResizeHandle({ mode, startDrag, onPointerMove, endDrag }) {
|
|
172
|
+
const HANDLE_THICKNESS = 6;
|
|
173
|
+
const CORNER_SIZE = 12;
|
|
174
|
+
const isCorner = mode.length === 2;
|
|
175
|
+
let style;
|
|
176
|
+
if (isCorner) {
|
|
177
|
+
style = {
|
|
178
|
+
position: 'absolute',
|
|
179
|
+
width: CORNER_SIZE,
|
|
180
|
+
height: CORNER_SIZE,
|
|
181
|
+
cursor: RESIZE_CURSORS[mode],
|
|
182
|
+
touchAction: 'none',
|
|
183
|
+
zIndex: 1,
|
|
184
|
+
...(mode.includes('n') ? { top: -CORNER_SIZE / 2 } : { bottom: -CORNER_SIZE / 2 }),
|
|
185
|
+
...(mode.includes('w') ? { left: -CORNER_SIZE / 2 } : { right: -CORNER_SIZE / 2 }),
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
const horizontal = mode === 'n' || mode === 's';
|
|
190
|
+
style = {
|
|
191
|
+
position: 'absolute',
|
|
192
|
+
cursor: RESIZE_CURSORS[mode],
|
|
193
|
+
touchAction: 'none',
|
|
194
|
+
zIndex: 1,
|
|
195
|
+
...(horizontal
|
|
196
|
+
? {
|
|
197
|
+
left: CORNER_SIZE,
|
|
198
|
+
right: CORNER_SIZE,
|
|
199
|
+
height: HANDLE_THICKNESS,
|
|
200
|
+
...(mode === 'n' ? { top: -HANDLE_THICKNESS / 2 } : { bottom: -HANDLE_THICKNESS / 2 }),
|
|
201
|
+
}
|
|
202
|
+
: {
|
|
203
|
+
top: CORNER_SIZE,
|
|
204
|
+
bottom: CORNER_SIZE,
|
|
205
|
+
width: HANDLE_THICKNESS,
|
|
206
|
+
...(mode === 'w' ? { left: -HANDLE_THICKNESS / 2 } : { right: -HANDLE_THICKNESS / 2 }),
|
|
207
|
+
}),
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
return (_jsx("div", { className: `oo-campus-nodus-resize oo-campus-nodus-resize--${mode}`, onPointerDown: (e) => startDrag(mode, e), onPointerMove: onPointerMove, onPointerUp: endDrag, style: style }));
|
|
211
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export interface CampusStratumProps {
|
|
3
|
+
zoom?: number;
|
|
4
|
+
pan?: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
};
|
|
8
|
+
zIndex?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function CampusStratum({ zoom, pan, zIndex, className, style, children, }: CampusStratumProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { StratumContext } from './stratum-context.js';
|
|
3
|
+
export function CampusStratum({ zoom = 1, pan, zIndex, className, style, children, }) {
|
|
4
|
+
const tx = pan?.x ?? 0;
|
|
5
|
+
const ty = pan?.y ?? 0;
|
|
6
|
+
const transform = tx !== 0 || ty !== 0 || zoom !== 1
|
|
7
|
+
? `translate(${tx}px, ${ty}px) scale(${zoom})`
|
|
8
|
+
: undefined;
|
|
9
|
+
return (_jsx(StratumContext.Provider, { value: zoom, children: _jsx("div", { className: ['oo-campus-stratum', className].filter(Boolean).join(' '), style: {
|
|
10
|
+
position: 'absolute',
|
|
11
|
+
left: 0,
|
|
12
|
+
top: 0,
|
|
13
|
+
width: 0,
|
|
14
|
+
height: 0,
|
|
15
|
+
transformOrigin: '0 0',
|
|
16
|
+
transform,
|
|
17
|
+
zIndex,
|
|
18
|
+
...style,
|
|
19
|
+
}, children: children }) }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export interface CampusVelumProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
style?: CSSProperties;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function CampusVelum({ className, style, children }: CampusVelumProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function CampusVelum({ className, style, children }) {
|
|
3
|
+
if (children == null || children === false)
|
|
4
|
+
return null;
|
|
5
|
+
return (_jsx("div", { className: ['oo-campus-velum', className].filter(Boolean).join(' '), style: {
|
|
6
|
+
position: 'absolute',
|
|
7
|
+
inset: 0,
|
|
8
|
+
pointerEvents: 'none',
|
|
9
|
+
zIndex: 30,
|
|
10
|
+
...style,
|
|
11
|
+
}, children: children }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type CSSProperties, type MouseEvent as ReactMouseEvent, type ReactNode, type Ref } from 'react';
|
|
2
|
+
import type { CampusBounds, CampusController, CampusLayerConfig, CampusNode, CampusNodeRenderProps, CampusViewport } from './types.js';
|
|
3
|
+
export type CampusNodeComponent = (props: CampusNodeRenderProps) => ReactNode;
|
|
4
|
+
export type CampusNodeTypes = Record<string, CampusNodeComponent>;
|
|
5
|
+
export interface CampusViewProps {
|
|
6
|
+
viewport: CampusViewport;
|
|
7
|
+
onViewportChange(next: CampusViewport): void;
|
|
8
|
+
maxDepth?: number;
|
|
9
|
+
minScale?: number;
|
|
10
|
+
maxScale?: number;
|
|
11
|
+
zoomStep?: number;
|
|
12
|
+
showGrid?: boolean;
|
|
13
|
+
onBackgroundClick?(): void;
|
|
14
|
+
onBackgroundContextMenu?(e: ReactMouseEvent<HTMLDivElement>): void;
|
|
15
|
+
nodes?: CampusNode[];
|
|
16
|
+
nodeTypes?: CampusNodeTypes;
|
|
17
|
+
nodeLayers?: Record<string, CampusLayerConfig>;
|
|
18
|
+
defaultLayer?: string;
|
|
19
|
+
onNodeCommit?(id: string, bounds: CampusBounds): void;
|
|
20
|
+
onNodeSelect?(id: string): void;
|
|
21
|
+
onNodeContextMenu?(id: string, e: ReactMouseEvent<HTMLDivElement>): void;
|
|
22
|
+
className?: string;
|
|
23
|
+
style?: CSSProperties;
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
ref?: Ref<CampusController>;
|
|
26
|
+
}
|
|
27
|
+
export declare function CampusView({ viewport, onViewportChange, maxDepth, minScale, maxScale, zoomStep, showGrid, onBackgroundClick, onBackgroundContextMenu, nodes, nodeTypes, nodeLayers, defaultLayer, onNodeCommit, onNodeSelect, onNodeContextMenu, className, style, children, ref, }: CampusViewProps): import("react").JSX.Element;
|