diff --git a/server/pkg/builtin/manifest.yml b/server/pkg/builtin/manifest.yml
index d0cd41b88a..af103762c0 100644
--- a/server/pkg/builtin/manifest.yml
+++ b/server/pkg/builtin/manifest.yml
@@ -23,11 +23,11 @@ extensions:
defaultValue: 3d
choices:
- key: 3d
- label: Scene 3D
+ label: 3D
- key: 2d
- label: Scene 2D
+ label: 2D
- key: columbus
- label: Columbus View
+ label: 2.5D (Columbus View)
- id: ion
type: string
title: Cesium Ion API access token
@@ -2323,11 +2323,10 @@ extensions:
ui: color
- id: padding
type: spacing
- title: Spacing settings
+ title: Padding
ui: padding
min: 0
max: 100
- defaultValue: { top: 0, bottom: 0, left: 0, right: 0 }
- id: cameraAnimation
title: Camera Animation
fields:
diff --git a/server/pkg/builtin/manifest_ja.yml b/server/pkg/builtin/manifest_ja.yml
index cb87fd1b13..72cf712b59 100644
--- a/server/pkg/builtin/manifest_ja.yml
+++ b/server/pkg/builtin/manifest_ja.yml
@@ -1153,6 +1153,8 @@ extensions:
title: タイトル
color:
title: 色
+ padding:
+ title: 余白
cameraAnimation:
title: カメラアニメーション
fields:
diff --git a/web/src/beta/components/Popover/hooks.ts b/web/src/beta/components/Popover/hooks.ts
index 636faa9140..32ed62bb9c 100644
--- a/web/src/beta/components/Popover/hooks.ts
+++ b/web/src/beta/components/Popover/hooks.ts
@@ -18,6 +18,7 @@ export default function usePopover({
placement = "bottom",
modal,
offset: offsetProps,
+ shift: shiftProps,
open: controlledOpen,
onOpenChange: setControlledOpen,
}: PopoverOptions = {}) {
@@ -38,7 +39,7 @@ export default function usePopover({
fallbackAxisSideDirection: "end",
padding: 4,
}),
- shift({ padding: 4 }),
+ shift(shiftProps ?? { padding: 4 }),
],
});
diff --git a/web/src/beta/components/Popover/index.tsx b/web/src/beta/components/Popover/index.tsx
index 69fb42e48d..f3b58f22fd 100644
--- a/web/src/beta/components/Popover/index.tsx
+++ b/web/src/beta/components/Popover/index.tsx
@@ -4,7 +4,15 @@ import {
FloatingFocusManager,
useTransitionStyles,
} from "@floating-ui/react";
-import * as React from "react";
+import {
+ forwardRef,
+ isValidElement,
+ cloneElement,
+ MutableRefObject,
+ type ButtonHTMLAttributes,
+ type HTMLProps,
+ type ReactNode,
+} from "react";
import { PopoverContext, usePopoverContext } from "@reearth/beta/components/Popover/context";
import { useTheme } from "@reearth/services/theme";
@@ -18,7 +26,7 @@ export function Provider({
modal = false,
...restOptions
}: {
- children: React.ReactNode;
+ children: ReactNode;
} & PopoverOptions) {
const popover = usePopover({ modal, ...restOptions });
return {children};
@@ -26,19 +34,19 @@ export function Provider({
type TriggerProps = {
className?: string;
- children: React.ReactNode;
+ children: ReactNode;
asChild?: boolean;
};
-export const Trigger = React.forwardRef & TriggerProps>(
+export const Trigger = forwardRef & TriggerProps>(
function Trigger({ children, asChild = false, className, ...props }, propRef) {
const context = usePopoverContext();
const childrenRef = (children as any).ref;
const ref = useMergeRefs([context.refs.setReference, propRef, childrenRef]);
// `asChild` allows the user to pass any element as the anchor
- if (asChild && React.isValidElement(children)) {
- return React.cloneElement(
+ if (asChild && isValidElement(children)) {
+ return cloneElement(
children,
context.getReferenceProps({
ref,
@@ -68,55 +76,53 @@ type ContentProps = {
attachToRoot?: boolean;
};
-export const Content = React.forwardRef<
- HTMLDivElement,
- React.HTMLProps & ContentProps
->(function Content({ style, className, attachToRoot = false, ...props }, propRef) {
- const { context: floatingContext, ...context } = usePopoverContext();
- const theme = useTheme();
- const ref = useMergeRefs([context.refs.setFloating, propRef]);
- const { isMounted, styles: transitionStyles } = useTransitionStyles(floatingContext, {
- duration: 50,
- });
+export const Content = forwardRef & ContentProps>(
+ function Content({ style, className, attachToRoot = false, ...props }, propRef) {
+ const { context: floatingContext, ...context } = usePopoverContext();
+ const theme = useTheme();
+ const ref = useMergeRefs([context.refs.setFloating, propRef]);
+ const { isMounted, styles: transitionStyles } = useTransitionStyles(floatingContext, {
+ duration: 50,
+ });
- if (!isMounted) return null;
+ if (!isMounted) return null;
- return (
- ) : null}>
-
-
- {props.children}
-
-
-
- );
-});
+ return (
+ ) : null}>
+
+
+ {props.children}
+
+
+
+ );
+ },
+);
-export const Close = React.forwardRef<
- HTMLButtonElement,
- React.ButtonHTMLAttributes
->(function PopoverClose(props, ref) {
- const { setOpen } = usePopoverContext();
- return (
-