@cloudscape-design/board-components 3.0.110 → 3.0.112
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/board/styles.css.js +5 -5
- package/board/styles.scoped.css +8 -8
- package/board/styles.selectors.js +5 -5
- package/board-item/interfaces.d.ts +4 -0
- package/board-item/interfaces.js.map +1 -1
- package/board-item/internal.d.ts +1 -1
- package/board-item/internal.js +18 -2
- package/board-item/internal.js.map +1 -1
- package/board-item/styles.css.js +11 -11
- package/board-item/styles.scoped.css +13 -15
- package/board-item/styles.selectors.js +11 -11
- package/internal/api-docs/components/board-item.js +11 -1
- package/internal/drag-handle/index.d.ts +7 -2
- package/internal/drag-handle/index.js +10 -4
- package/internal/drag-handle/index.js.map +1 -1
- package/internal/drag-handle/styles.css.js +2 -2
- package/internal/drag-handle/styles.scoped.css +13 -22
- package/internal/drag-handle/styles.selectors.js +2 -2
- package/internal/{handle → drag-handle/test-classes}/styles.css.js +1 -1
- package/internal/drag-handle/test-classes/styles.scoped.css +7 -0
- package/internal/{handle → drag-handle/test-classes}/styles.selectors.js +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/generated/styles/tokens.js +222 -222
- package/internal/generated/theming/index.cjs +232 -232
- package/internal/generated/theming/index.cjs.d.ts +2 -2
- package/internal/generated/theming/index.d.ts +2 -2
- package/internal/generated/theming/index.js +232 -232
- package/internal/global-drag-state-styles/index.js +8 -3
- package/internal/global-drag-state-styles/index.js.map +1 -1
- package/internal/item-container/index.d.ts +67 -5
- package/internal/item-container/index.js +147 -118
- package/internal/item-container/index.js.map +1 -1
- package/internal/item-container/utils.d.ts +37 -0
- package/internal/item-container/utils.js +63 -0
- package/internal/item-container/utils.js.map +1 -0
- package/internal/manifest.json +1 -1
- package/internal/resize-handle/index.d.ts +6 -2
- package/internal/resize-handle/index.js +10 -4
- package/internal/resize-handle/index.js.map +1 -1
- package/internal/resize-handle/styles.css.js +2 -2
- package/internal/resize-handle/styles.scoped.css +13 -22
- package/internal/resize-handle/styles.selectors.js +2 -2
- package/internal/resize-handle/test-classes/styles.css.js +6 -0
- package/internal/resize-handle/test-classes/styles.scoped.css +7 -0
- package/internal/resize-handle/test-classes/styles.selectors.js +7 -0
- package/package.json +1 -1
- package/internal/handle/index.d.ts +0 -3
- package/internal/handle/index.js +0 -18
- package/internal/handle/index.js.map +0 -1
- package/internal/handle/styles.scoped.css +0 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal/item-container/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EACL,aAAa,EAEb,UAAU,EAMV,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAEhH,OAAO,EAKL,YAAY,EACZ,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAqBrC,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAyB,IAAI,CAAC,CAAC;AAEvE,MAAM,UAAU,cAAc;IAC5B,MAAM,GAAG,GAAG,UA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d,KAAC,WAAW,CAAC,QAAQ,IACnB,KAAK,EAAE;gBACL,QAAQ;gBACR,UAAU,EAAE;oBACV,GAAG,EAAE,aAAa;oBAClB,aAAa,EAAE,uBAAuB;oBACtC,SAAS,EAAE,mBAAmB;oBAC9B,QAAQ,EAAE,QAAQ,IAAI,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,MAAK,SAAS;iBAC1D;gBACD,YAAY,EAAE,MAAM;oBAClB,CAAC,CAAC;wBACE,aAAa,EAAE,yBAAyB;wBACxC,SAAS,EAAE,qBAAqB;wBAChC,QAAQ,EAAE,QAAQ,IAAI,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,MAAK,QAAQ;qBACzD;oBACH,CAAC,CAAC,IAAI;aACT,YAEA,WAAW,CAAC,OAAO,GACC,GACnB,CACP,CAAC;IAEF,OAAO,eAAe,CAAC,CAAC,CAAC,wBAAM,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAO,CAAC,CAAC,CAAC,OAAO,CAAC;AACvF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport {\n createContext,\n CSSProperties,\n forwardRef,\n KeyboardEvent,\n PointerEvent as ReactPointerEvent,\n ReactNode,\n Ref,\n RefObject,\n useContext,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { CSS as CSSUtil } from \"@dnd-kit/utilities\";\nimport clsx from \"clsx\";\n\nimport { getLogicalBoundingClientRect, getLogicalClientX } from \"@cloudscape-design/component-toolkit/internal\";\n\nimport {\n DragAndDropData,\n DropTargetContext,\n InteractionType,\n Operation,\n useDraggable,\n useDragSubscription,\n} from \"../dnd-controller/controller\";\nimport { BoardItemDefinitionBase, Direction, ItemId, Transform } from \"../interfaces\";\nimport { Coordinates } from \"../utils/coordinates\";\nimport { getNormalizedElementRect } from \"../utils/screen\";\nimport { throttle } from \"../utils/throttle\";\nimport { getCollisionRect } from \"./get-collision-rect\";\nimport { getNextDroppable } from \"./get-next-droppable\";\n\nimport styles from \"./styles.css.js\";\n\nexport interface ItemContainerRef {\n focusDragHandle(): void;\n}\n\ninterface ItemContextType {\n isActive: boolean;\n dragHandle: {\n ref: RefObject<HTMLButtonElement>;\n onPointerDown(event: ReactPointerEvent): void;\n onKeyDown(event: KeyboardEvent): void;\n isActive: boolean;\n };\n resizeHandle: null | {\n onPointerDown(event: ReactPointerEvent): void;\n onKeyDown(event: KeyboardEvent): void;\n isActive: boolean;\n };\n}\n\nexport const ItemContext = createContext<ItemContextType | null>(null);\n\nexport function useItemContext() {\n const ctx = useContext(ItemContext);\n if (!ctx) {\n throw new Error(\"Unable to find BoardItem context.\");\n }\n return ctx;\n}\n\ninterface Transition {\n itemId: ItemId;\n operation: Operation;\n interactionType: InteractionType;\n sizeTransform: null | { width: number; height: number };\n positionTransform: null | { x: number; y: number };\n hasDropTarget?: boolean;\n}\n\n/**\n * Defines item's parameters and its relation with the layout.\n *\n * `item` - the unique board item base object to be used in d&d context.\n * `placed` - specifies if the item already belongs to the board.\n * `acquired` - specifies if the item is essentially a copy temporarily acquired by a droppable but not submitted yet.\n * `inTransition` - specifies if the item is currently being moved.\n * `transform` - specifies if the item's position needs to be altered.\n * `getItemSize` - item size getter that takes droppable context as argument.\n * `onKeyMove` - a callback that fires when arrow keys are pressed in drag- or resize handle.\n */\nexport interface ItemContainerProps {\n item: BoardItemDefinitionBase<unknown>;\n placed: boolean;\n acquired: boolean;\n inTransition: boolean;\n transform: Transform | undefined;\n getItemSize: (context: null | DropTargetContext) => {\n width: number;\n minWidth: number;\n maxWidth: number;\n height: number;\n minHeight: number;\n maxHeight: number;\n };\n onKeyMove?(direction: Direction): void;\n children: (hasDropTarget: boolean) => ReactNode;\n isRtl: () => boolean;\n}\n\nexport const ItemContainer = forwardRef(ItemContainerComponent);\n\nfunction ItemContainerComponent(\n { item, placed, acquired, inTransition, transform, getItemSize, onKeyMove, children, isRtl }: ItemContainerProps,\n ref: Ref<ItemContainerRef>,\n) {\n const originalSizeRef = useRef({ width: 0, height: 0 });\n const pointerOffsetRef = useRef(new Coordinates({ x: 0, y: 0 }));\n const pointerBoundariesRef = useRef<null | Coordinates>(null);\n const [transition, setTransition] = useState<null | Transition>(null);\n const [isHidden, setIsHidden] = useState(false);\n const muteEventsRef = useRef(false);\n const itemRef = useRef<HTMLDivElement>(null);\n const draggableApi = useDraggable({\n draggableItem: item,\n getCollisionRect: (operation, coordinates, dropTarget) => {\n const sizeOverride = operation === \"insert\" && dropTarget ? getItemSize(dropTarget) : null;\n return getCollisionRect(operation, itemRef.current!, coordinates, sizeOverride);\n },\n });\n\n function updateTransition({\n operation,\n interactionType,\n draggableItem,\n collisionRect,\n coordinates,\n dropTarget,\n }: DragAndDropData) {\n if (item.id === draggableItem.id) {\n const [width, height] = [collisionRect.right - collisionRect.left, collisionRect.bottom - collisionRect.top];\n const pointerOffset = pointerOffsetRef.current;\n\n if (operation === \"resize\") {\n setTransition({\n operation,\n interactionType,\n itemId: draggableItem.id,\n sizeTransform: {\n width: Math.max(getItemSize(null).minWidth, Math.min(getItemSize(null).maxWidth, width - pointerOffset.x)),\n height: Math.max(getItemSize(null).minHeight, height - pointerOffset.y),\n },\n positionTransform: null,\n });\n } else if (operation === \"insert\" || operation === \"reorder\") {\n setTransition({\n operation,\n interactionType,\n itemId: draggableItem.id,\n sizeTransform: dropTarget ? getItemSize(dropTarget) : originalSizeRef.current,\n positionTransform: { x: coordinates.x - pointerOffset.x, y: coordinates.y - pointerOffset.y },\n hasDropTarget: !!dropTarget,\n });\n }\n }\n }\n\n useDragSubscription(\"start\", (detail) => updateTransition(detail));\n useDragSubscription(\"update\", (detail) => updateTransition(detail));\n useDragSubscription(\"submit\", () => {\n setTransition(null);\n setIsHidden(false);\n muteEventsRef.current = false;\n });\n useDragSubscription(\"discard\", () => {\n setTransition(null);\n setIsHidden(false);\n muteEventsRef.current = false;\n });\n\n // During the transition listen to pointer move and pointer up events to update/submit transition.\n const transitionInteractionType = transition?.interactionType ?? null;\n const transitionItemId = transition?.itemId ?? null;\n useEffect(() => {\n const onPointerMove = throttle((event: PointerEvent) => {\n const coordinates = Coordinates.fromEvent(event, { isRtl: isRtl() });\n draggableApi.updateTransition(\n new Coordinates({\n x: Math.max(coordinates.x, pointerBoundariesRef.current?.x ?? Number.NEGATIVE_INFINITY),\n y: Math.max(coordinates.y, pointerBoundariesRef.current?.y ?? Number.NEGATIVE_INFINITY),\n }),\n );\n }, 10);\n const onPointerUp = () => {\n onPointerMove.cancel();\n draggableApi.submitTransition();\n };\n\n if (transitionInteractionType === \"pointer\" && transitionItemId === item.id) {\n window.addEventListener(\"pointermove\", onPointerMove);\n window.addEventListener(\"pointerup\", onPointerUp);\n }\n return () => {\n window.removeEventListener(\"pointermove\", onPointerMove);\n window.removeEventListener(\"pointerup\", onPointerUp);\n };\n // draggableApi is not expected to change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [item.id, transitionInteractionType, transitionItemId]);\n\n useEffect(() => {\n if (transitionInteractionType === \"keyboard\" && transitionItemId === item.id) {\n const onPointerDown = () => draggableApi.submitTransition();\n window.addEventListener(\"pointerdown\", onPointerDown, true);\n return () => {\n window.removeEventListener(\"pointerdown\", onPointerDown, true);\n };\n }\n // draggableApi is not expected to change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [item.id, transitionInteractionType, transitionItemId]);\n\n function onKeyboardTransitionToggle(operation: \"drag\" | \"resize\") {\n // The acquired item is a copy and does not have the transition state.\n // However, pressing \"Space\" or \"Enter\" on the acquired item must submit the active transition.\n if (acquired) {\n return draggableApi.submitTransition();\n }\n\n // Create new transition if missing.\n if (!transition) {\n const rect = getNormalizedElementRect(itemRef.current!);\n const coordinates = new Coordinates({\n x: operation === \"drag\" ? rect.left : rect.right,\n y: operation === \"drag\" ? rect.top : rect.bottom,\n });\n\n if (operation === \"drag\" && !placed) {\n draggableApi.start(\"insert\", \"keyboard\", coordinates);\n } else if (operation === \"drag\") {\n draggableApi.start(\"reorder\", \"keyboard\", coordinates);\n } else {\n draggableApi.start(\"resize\", \"keyboard\", coordinates);\n }\n }\n // Submit a transition if existing.\n else {\n draggableApi.submitTransition();\n }\n }\n\n function handleInsert(direction: Direction) {\n // Find the closest droppable (in the direction) to the item.\n const droppables = draggableApi.getDroppables();\n const nextDroppable = getNextDroppable({\n draggableElement: itemRef.current!,\n droppables,\n direction,\n isRtl: isRtl(),\n });\n\n if (!nextDroppable) {\n // TODO: add announcement\n // Context: the keyboard insertion only works when there is some droppable area in the specified direction.\n // That means that only some arrow keys might work which is confusing for a screen-reader user.\n // Alternatively, we can consider a multi-step insertion where the user would first explicitly select the desired board.\n return;\n }\n\n // Notify the respective droppable of the intention to insert the item in it.\n draggableApi.acquire(nextDroppable, () => children(true));\n setIsHidden(true);\n muteEventsRef.current = true;\n }\n\n function onHandleKeyDown(operation: \"drag\" | \"resize\", event: KeyboardEvent) {\n const canInsert = transition && operation === \"drag\" && !placed;\n const canNavigate = transition || operation === \"drag\";\n\n // The insert is handled by the item and the navigation is delegated to the containing layout.\n const move = (direction: Direction) => {\n if (canInsert) {\n handleInsert(direction);\n } else if (canNavigate) {\n onKeyMove?.(direction);\n }\n };\n\n const discard = () => {\n if (transition || acquired) {\n draggableApi.discardTransition();\n }\n };\n\n switch (event.key) {\n case \"ArrowUp\":\n return move(\"up\");\n case \"ArrowDown\":\n return move(\"down\");\n case \"ArrowLeft\":\n return move(\"left\");\n case \"ArrowRight\":\n return move(\"right\");\n case \" \":\n case \"Enter\":\n return onKeyboardTransitionToggle(operation);\n case \"Escape\":\n return discard();\n }\n }\n\n function onBlur() {\n // When drag- or resize handle on palette or board item loses focus the transition must be submitted with two exceptions:\n // 1. If the last interaction is not \"keyboard\" (the user clicked on another handle issuing a new transition);\n // 2. If the item is acquired by the board (in that case the focus moves to the board item which is expected, palette item is hidden and all events handlers must be muted).\n if (transition && transition.interactionType === \"keyboard\" && !muteEventsRef.current) {\n draggableApi.submitTransition();\n }\n }\n\n function onDragHandlePointerDown(event: ReactPointerEvent) {\n // Calculate the offset between item's top-left corner and the pointer landing position.\n const rect = getLogicalBoundingClientRect(itemRef.current!);\n const clientX = getLogicalClientX(event, isRtl());\n const clientY = event.clientY;\n pointerOffsetRef.current = new Coordinates({\n x: clientX - rect.insetInlineStart,\n y: clientY - rect.insetBlockStart,\n });\n originalSizeRef.current = { width: rect.inlineSize, height: rect.blockSize };\n pointerBoundariesRef.current = null;\n\n draggableApi.start(!placed ? \"insert\" : \"reorder\", \"pointer\", Coordinates.fromEvent(event, { isRtl: isRtl() }));\n }\n\n function onDragHandleKeyDown(event: KeyboardEvent) {\n onHandleKeyDown(\"drag\", event);\n }\n\n function onResizeHandlePointerDown(event: ReactPointerEvent) {\n // Calculate the offset between item's bottom-right corner and the pointer landing position.\n const rect = getLogicalBoundingClientRect(itemRef.current!);\n const clientX = getLogicalClientX(event, isRtl());\n const clientY = event.clientY;\n pointerOffsetRef.current = new Coordinates({ x: clientX - rect.insetInlineEnd, y: clientY - rect.insetBlockEnd });\n originalSizeRef.current = { width: rect.inlineSize, height: rect.blockSize };\n\n // Calculate boundaries below which the cursor cannot move.\n const minWidth = getItemSize(null).minWidth;\n const minHeight = getItemSize(null).minHeight;\n pointerBoundariesRef.current = new Coordinates({\n x: clientX - rect.inlineSize + minWidth,\n y: clientY - rect.blockSize + minHeight,\n });\n\n draggableApi.start(\"resize\", \"pointer\", Coordinates.fromEvent(event, { isRtl: isRtl() }));\n }\n\n function onResizeHandleKeyDown(event: KeyboardEvent) {\n onHandleKeyDown(\"resize\", event);\n }\n\n const itemTransitionStyle: CSSProperties = {};\n const itemTransitionClassNames: string[] = [];\n\n if (inTransition) {\n itemTransitionClassNames.push(styles.inTransition);\n }\n\n if (transition && transition.interactionType === \"pointer\") {\n // Adjust the dragged/resized item to the pointer's location.\n itemTransitionClassNames.push(transition.operation === \"resize\" ? styles.resized : styles.dragged);\n itemTransitionStyle.insetInlineStart = transition.positionTransform?.x;\n itemTransitionStyle.insetBlockStart = transition.positionTransform?.y;\n itemTransitionStyle.inlineSize = transition.sizeTransform?.width;\n itemTransitionStyle.blockSize = transition.sizeTransform?.height;\n itemTransitionStyle.pointerEvents = \"none\";\n }\n\n if (isHidden) {\n itemTransitionClassNames.push(styles.hidden);\n }\n\n if (transform) {\n // The moved items positions are altered with CSS transform.\n if (transform.type === \"move\") {\n itemTransitionClassNames.push(styles.transformed);\n itemTransitionStyle.transform = CSSUtil.Transform.toString({\n x: transform.x,\n y: transform.y,\n scaleX: 1,\n scaleY: 1,\n });\n itemTransitionStyle.width = transform.width + \"px\";\n itemTransitionStyle.height = transform.height + \"px\";\n }\n // The item is removed from the DOM after animations play.\n // During the animations the removed item is hidden with styles.\n if (transform.type === \"remove\") {\n itemTransitionClassNames.push(styles.removed);\n }\n }\n\n const dragHandleRef = useRef<HTMLButtonElement>(null);\n useImperativeHandle(ref, () => ({\n focusDragHandle: () => dragHandleRef.current?.focus(),\n }));\n\n const isActive = (!!transition && !isHidden) || !!acquired;\n const shouldUsePortal = transition?.operation === \"insert\" && transition?.interactionType === \"pointer\";\n const childrenRef = useRef<ReactNode>(null);\n if (!inTransition || isActive) {\n childrenRef.current = children(!!transition?.hasDropTarget);\n }\n\n const content = (\n <div\n ref={itemRef}\n className={clsx(styles.root, ...itemTransitionClassNames)}\n style={itemTransitionStyle}\n data-item-id={item.id}\n onBlur={onBlur}\n >\n <ItemContext.Provider\n value={{\n isActive,\n dragHandle: {\n ref: dragHandleRef,\n onPointerDown: onDragHandlePointerDown,\n onKeyDown: onDragHandleKeyDown,\n isActive: isActive && transition?.operation === \"reorder\",\n },\n resizeHandle: placed\n ? {\n onPointerDown: onResizeHandlePointerDown,\n onKeyDown: onResizeHandleKeyDown,\n isActive: isActive && transition?.operation === \"resize\",\n }\n : null,\n }}\n >\n {childrenRef.current}\n </ItemContext.Provider>\n </div>\n );\n\n return shouldUsePortal ? <div>{createPortal(content, document.body)}</div> : content;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal/item-container/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EACL,aAAa,EAEb,UAAU,EAMV,UAAU,EACV,mBAAmB,EACnB,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAC7F,OAAO,EACL,qCAAqC,GAEtC,MAAM,+DAA+D,CAAC;AAEvE,OAAO,EAKL,YAAY,EACZ,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,mBAAmB,EACnB,8BAA8B,GAC/B,MAAM,SAAS,CAAC;AAEjB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AA+ErC,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAyB,IAAI,CAAC,CAAC;AAEvE,MAAM,UAAU,cAAc;IAC5B,MAAM,GAAG,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IACpC,IAAI,CAAC,GAAG,EAAE;QACR,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;KACtD;IACD,OAAO,GA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S,EAAE,CAAC,KAAoB,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC;oBACnE,WAAW,EAAE,0BAA0B,CAAC;wBACtC,cAAc,EAAE,QAAQ;wBACxB,iBAAiB,EAAE,UAAU;wBAC7B,oBAAoB,EAAE,mBAAmB,CAAC,WAAW,CAAC,KAAK;wBAC3D,eAAe,EAAE,SAAS;qBAC3B,CAAC;oBACF,gBAAgB,EAAE,yBAAyB;oBAC3C,kBAAkB,EAChB,mBAAmB,CAAC,WAAW,CAAC,KAAK,KAAK,kBAAkB,IAAI,CAAC,YAAY,IAAI,QAAQ,CAAC;iBAC7F;gBACD,YAAY,EAAE,MAAM;oBAClB,CAAC,CAAC;wBACE,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,uBAAuB,CAAC,CAAC,EAAE,QAAQ,CAAC;wBAC1D,SAAS,EAAE,CAAC,KAAoB,EAAE,EAAE,CAAC,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC;wBACrE,WAAW,EAAE,0BAA0B,CAAC;4BACtC,cAAc,EAAE,QAAQ;4BACxB,iBAAiB,EAAE,UAAU;4BAC7B,oBAAoB,EAAE,qBAAqB,CAAC,WAAW,CAAC,KAAK;4BAC7D,eAAe,EAAE,QAAQ;yBAC1B,CAAC;wBACF,gBAAgB,EAAE,yBAAyB;qBAC5C;oBACH,CAAC,CAAC,IAAI;aACT,YAEA,WAAW,CAAC,OAAO,GACC,GACnB,CACP,CAAC;IAEF,OAAO,eAAe,CAAC,CAAC,CAAC,wBAAM,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAO,CAAC,CAAC,CAAC,OAAO,CAAC;AACvF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport {\n createContext,\n CSSProperties,\n forwardRef,\n KeyboardEvent,\n PointerEvent as ReactPointerEvent,\n ReactNode,\n Ref,\n RefObject,\n useContext,\n useImperativeHandle,\n useRef,\n useState,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { CSS as CSSUtil } from \"@dnd-kit/utilities\";\nimport clsx from \"clsx\";\n\nimport { getLogicalBoundingClientRect } from \"@cloudscape-design/component-toolkit/internal\";\nimport {\n useInternalDragHandleInteractionState,\n UseInternalDragHandleInteractionStateProps,\n} from \"@cloudscape-design/components/internal/do-not-use/drag-handle\";\n\nimport {\n DragAndDropData,\n DropTargetContext,\n InteractionType,\n Operation,\n useDraggable,\n useDragSubscription,\n} from \"../dnd-controller/controller\";\nimport { BoardItemDefinitionBase, Direction, ItemId, Transform } from \"../interfaces\";\nimport { Coordinates } from \"../utils/coordinates\";\nimport { getNormalizedElementRect } from \"../utils/screen\";\nimport { throttle } from \"../utils/throttle\";\nimport { getCollisionRect } from \"./get-collision-rect\";\nimport { getNextDroppable } from \"./get-next-droppable\";\nimport {\n calculateInitialPointerData,\n determineHandleActiveState,\n getDndOperationType,\n hasPointerMovedBeyondThreshold,\n} from \"./utils\";\n\nimport styles from \"./styles.css.js\";\n\nexport interface ItemContainerRef {\n focusDragHandle(): void;\n}\n\nexport type HandleActiveState = null | \"pointer\" | \"uap\";\n\ninterface ItemContextType {\n /**\n * Flag indicating if a drag or resize interaction is currently active.\n */\n isActive: boolean;\n /**\n * Flag indicating if the item is currently hidden.\n * (When a board item is moved from the palette to the board and the transition is not submitted)\n */\n isHidden: boolean;\n dragHandle: {\n /**\n * Ref to the drag button. Used to focus the drag handle when moving an item\n * from the palette to the board via keyboard or UAP actions.\n */\n ref: RefObject<HTMLDivElement>;\n /**\n * Listen to pointerDown events on the drag handle.\n * Used to start a transition and attach global event handlers.\n */\n onPointerDown(event: ReactPointerEvent): void;\n /**\n * Listen to keyDown events on the drag handle.\n */\n onKeyDown(event: KeyboardEvent): void;\n /**\n * Indicating if drag handle is active.\n */\n activeState: HandleActiveState;\n /**\n * Listen to UAP direction button clicks.\n */\n onDirectionClick(direction: KeyboardEvent[\"key\"], operation: HandleOperation): void;\n /**\n * Flag indicating if the UAP buttons should be shown. E.g. when a item is moved from\n * the palette via keyboard or UAP to the board.\n */\n initialShowButtons?: boolean;\n };\n resizeHandle: null | {\n /**\n * Listen to pointerDown events on the drag handle.\n * Used to start a transition and attach global event handlers.\n */\n onPointerDown(event: ReactPointerEvent): void;\n /**\n * Listen to keyDown events on the drag handle.\n */\n onKeyDown(event: KeyboardEvent): void;\n /**\n * Indicating if resize handle is active.\n */\n activeState: HandleActiveState;\n /**\n * Listen to UAP direction button clicks.\n */\n onDirectionClick(direction: KeyboardEvent[\"key\"], operation: HandleOperation): void;\n };\n}\n\nexport interface Transition {\n itemId: ItemId;\n operation: Operation;\n interactionType: InteractionType;\n sizeTransform: null | { width: number; height: number };\n positionTransform: null | { x: number; y: number };\n hasDropTarget?: boolean;\n}\n\nexport type HandleOperation = \"drag\" | \"resize\";\n\nexport const ItemContext = createContext<ItemContextType | null>(null);\n\nexport function useItemContext() {\n const ctx = useContext(ItemContext);\n if (!ctx) {\n throw new Error(\"Unable to find BoardItem context.\");\n }\n return ctx;\n}\n\n/**\n * Defines item's parameters and its relation with the layout.\n *\n * `item` - the unique board item base object to be used in d&d context.\n * `placed` - specifies if the item already belongs to the board.\n * `acquired` - specifies if the item is essentially a copy temporarily acquired by a droppable but not submitted yet.\n * `inTransition` - specifies if the item is currently being moved.\n * `transform` - specifies if the item's position needs to be altered.\n * `getItemSize` - item size getter that takes droppable context as argument.\n * `onKeyMove` - a callback that fires when arrow keys are pressed in drag- or resize handle.\n */\nexport interface ItemContainerProps {\n item: BoardItemDefinitionBase<unknown>;\n placed: boolean;\n acquired: boolean;\n inTransition: boolean;\n transform: Transform | undefined;\n getItemSize: (context: null | DropTargetContext) => {\n width: number;\n minWidth: number;\n maxWidth: number;\n height: number;\n minHeight: number;\n maxHeight: number;\n };\n\n onKeyMove?(direction: Direction): void;\n\n children: (hasDropTarget: boolean) => ReactNode;\n isRtl: () => boolean;\n}\n\nexport const ItemContainer = forwardRef(ItemContainerComponent);\n\n// The amount of distance after pointer down that the cursor is allowed to\n// jitter for a subsequent mouseup to still register as a \"press\" instead of\n// a drag. A little allowance is needed for usability reasons, but this number\n// isn't set in stone.\nexport const CLICK_DRAG_THRESHOLD = 3;\n\nfunction ItemContainerComponent(\n { item, placed, acquired, inTransition, transform, getItemSize, onKeyMove, children, isRtl }: ItemContainerProps,\n ref: Ref<ItemContainerRef>,\n) {\n const originalSizeRef = useRef({ width: 0, height: 0 });\n const pointerOffsetRef = useRef(new Coordinates({ x: 0, y: 0 }));\n const pointerBoundariesRef = useRef<null | Coordinates>(null);\n const [transition, setTransition] = useState<null | Transition>(null);\n const [isHidden, setIsHidden] = useState(false);\n const muteEventsRef = useRef(false);\n const itemRef = useRef<HTMLDivElement>(null);\n const initialPointerDownPosition = useRef<{ x: number; y: number } | undefined>();\n const draggableApi = useDraggable({\n draggableItem: item,\n getCollisionRect: (operation, coordinates, dropTarget) => {\n const sizeOverride = operation === \"insert\" && dropTarget ? getItemSize(dropTarget) : null;\n return getCollisionRect(operation, itemRef.current!, coordinates, sizeOverride);\n },\n });\n\n function updateTransition({\n operation,\n interactionType,\n draggableItem,\n collisionRect,\n coordinates,\n dropTarget,\n }: DragAndDropData) {\n if (item.id === draggableItem.id) {\n const [width, height] = [collisionRect.right - collisionRect.left, collisionRect.bottom - collisionRect.top];\n const pointerOffset = pointerOffsetRef.current;\n\n if (operation === \"resize\") {\n setTransition({\n operation,\n interactionType,\n itemId: draggableItem.id,\n sizeTransform: {\n width: Math.max(getItemSize(null).minWidth, Math.min(getItemSize(null).maxWidth, width - pointerOffset.x)),\n height: Math.max(getItemSize(null).minHeight, height - pointerOffset.y),\n },\n positionTransform: null,\n });\n } else if (operation === \"insert\" || operation === \"reorder\") {\n setTransition({\n operation,\n interactionType,\n itemId: draggableItem.id,\n sizeTransform: dropTarget ? getItemSize(dropTarget) : originalSizeRef.current,\n positionTransform: { x: coordinates.x - pointerOffset.x, y: coordinates.y - pointerOffset.y },\n hasDropTarget: !!dropTarget,\n });\n }\n }\n }\n\n useDragSubscription(\"start\", (detail) => updateTransition(detail));\n useDragSubscription(\"update\", (detail) => updateTransition(detail));\n useDragSubscription(\"submit\", () => {\n setTransition(null);\n setIsHidden(false);\n muteEventsRef.current = false;\n });\n useDragSubscription(\"discard\", () => {\n setTransition(null);\n setIsHidden(false);\n muteEventsRef.current = false;\n });\n\n // Handles incremental transition logic shared between different keyboard and UAP interactions.\n function handleIncrementalTransition(operation: HandleOperation, submitExisting = false) {\n // The acquired item is a copy and does not have the transition state.\n // However, pressing \"Space\" or \"Enter\" on the acquired item must submit the active transition.\n if (acquired) {\n return draggableApi.submitTransition();\n }\n\n // Submit existing transition if requested and one exists\n if (submitExisting && transition) {\n return draggableApi.submitTransition();\n }\n\n const rect = getNormalizedElementRect(itemRef.current!);\n const coordinates = new Coordinates({\n x: operation === \"drag\" ? rect.left : rect.right,\n y: operation === \"drag\" ? rect.top : rect.bottom,\n });\n\n if (operation === \"drag\" && !placed) {\n draggableApi.start(\"insert\", \"keyboard\", coordinates);\n } else if (operation === \"drag\") {\n draggableApi.start(\"reorder\", \"keyboard\", coordinates);\n } else {\n draggableApi.start(\"resize\", \"keyboard\", coordinates);\n }\n }\n\n function handleInsert(direction: Direction) {\n // Find the closest droppable (in the direction) to the item.\n const droppables = draggableApi.getDroppables();\n const nextDroppable = getNextDroppable({\n draggableElement: itemRef.current!,\n droppables,\n direction,\n isRtl: isRtl(),\n });\n\n if (!nextDroppable) {\n // TODO: add announcement\n // Context: the keyboard insertion only works when there is some droppable area in the specified direction.\n // That means that only some arrow keys might work which is confusing for a screen-reader user.\n // Alternatively, we can consider a multi-step insertion where the user would first explicitly select the desired board.\n return;\n }\n\n // Notify the respective droppable of the intention to insert the item in it.\n draggableApi.acquire(nextDroppable, () => children(true));\n setIsHidden(true);\n muteEventsRef.current = true;\n }\n\n function handleDirectionalMovement(direction: Direction, operation: HandleOperation) {\n const canInsert = transition && operation === \"drag\" && !placed;\n const canNavigate = transition || operation === \"drag\";\n if (canInsert) {\n handleInsert(direction);\n } else if (canNavigate) {\n onKeyMove?.(direction);\n }\n }\n\n function onHandleKeyDown(operation: HandleOperation, event: KeyboardEvent) {\n const discard = () => {\n if (transition || acquired) {\n draggableApi.discardTransition();\n }\n };\n\n switch (event.key) {\n case \"ArrowUp\":\n return handleDirectionalMovement(\"up\", operation);\n case \"ArrowDown\":\n return handleDirectionalMovement(\"down\", operation);\n case \"ArrowLeft\":\n return handleDirectionalMovement(\"left\", operation);\n case \"ArrowRight\":\n return handleDirectionalMovement(\"right\", operation);\n case \" \":\n case \"Enter\":\n return handleIncrementalTransition(operation, true);\n case \"Escape\":\n return discard();\n }\n }\n\n function onBlur() {\n // When drag- or resize handle on palette or board item loses focus the transition must be submitted with two exceptions:\n // 1. If the last interaction is not \"keyboard\" (the user clicked on another handle issuing a new transition);\n // 2. If the item is acquired by the board (in that case the focus moves to the board item which is expected, palette item is hidden and all events handlers must be muted).\n selectedHook.current.processBlur();\n initialPointerDownPosition.current = undefined;\n if (acquired || (transition && transition.interactionType === \"keyboard\" && !muteEventsRef.current)) {\n draggableApi.submitTransition();\n }\n }\n\n function handleGlobalPointerMove(event: PointerEvent) {\n if (hasPointerMovedBeyondThreshold(event, initialPointerDownPosition.current)) {\n selectedHook.current.processPointerMove(event);\n }\n }\n\n function handleGlobalPointerUp(event: PointerEvent) {\n selectedHook.current.processPointerUp(event);\n initialPointerDownPosition.current = undefined;\n // Clean up global listeners after interaction ends\n window.removeEventListener(\"pointermove\", handleGlobalPointerMove);\n window.removeEventListener(\"pointerup\", handleGlobalPointerUp);\n }\n\n function onDragHandlePointerDown(event: ReactPointerEvent, operation: HandleOperation) {\n // Prevent UI issues when right-clicking: in such a case the OS context menu will be shown and\n // the board while the board-item is active. Because of the context menu under the pointer,\n // onPointerUp is not called anymore. In such a case the board item would stuck in onPointerUp.\n if (event.button !== 0) {\n return;\n }\n initialPointerDownPosition.current = { x: event.clientX, y: event.clientY };\n\n if (operation === \"drag\") {\n selectedHook.current = dragInteractionHook;\n } else {\n selectedHook.current = resizeInteractionHook;\n }\n selectedHook.current.processPointerDown(event.nativeEvent);\n\n // If pointerdown is on our button, start listening for global move and up\n window.addEventListener(\"pointermove\", handleGlobalPointerMove);\n window.addEventListener(\"pointerup\", handleGlobalPointerUp);\n }\n\n function handlePointerInteractionStart(event: PointerEvent, operation: \"drag\" | \"resize\") {\n const currentItemElement = itemRef.current;\n if (!currentItemElement) {\n console.warn(\"ItemContainer: itemRef.current is not available on interaction start.\");\n return;\n }\n\n const rect = getLogicalBoundingClientRect(currentItemElement);\n originalSizeRef.current = { width: rect.inlineSize, height: rect.blockSize };\n\n const { pointerOffset, pointerBoundaries } = calculateInitialPointerData({\n event,\n operation,\n rect,\n getMinSize: () => getItemSize(null),\n isRtl: isRtl(),\n });\n pointerOffsetRef.current = pointerOffset;\n pointerBoundariesRef.current = pointerBoundaries;\n\n const dndOperation = getDndOperationType(operation, placed);\n const startCoordinates = Coordinates.fromEvent(event, { isRtl: isRtl() });\n draggableApi.start(dndOperation, \"pointer\", startCoordinates);\n }\n\n const onHandleDndTransitionActive = throttle((event: PointerEvent) => {\n const coordinates = Coordinates.fromEvent(event, { isRtl: isRtl() });\n draggableApi.updateTransition(\n new Coordinates({\n x: Math.max(coordinates.x, pointerBoundariesRef.current?.x ?? Number.NEGATIVE_INFINITY),\n y: Math.max(coordinates.y, pointerBoundariesRef.current?.y ?? Number.NEGATIVE_INFINITY),\n }),\n );\n }, 10) as (event: PointerEvent) => void;\n\n const itemTransitionStyle: CSSProperties = {};\n const itemTransitionClassNames: string[] = [];\n\n if (inTransition) {\n itemTransitionClassNames.push(styles.inTransition);\n }\n\n if (transition && transition.interactionType === \"pointer\") {\n // Adjust the dragged/resized item to the pointer's location.\n itemTransitionClassNames.push(transition.operation === \"resize\" ? styles.resized : styles.dragged);\n itemTransitionStyle.insetInlineStart = transition.positionTransform?.x;\n itemTransitionStyle.insetBlockStart = transition.positionTransform?.y;\n itemTransitionStyle.inlineSize = transition.sizeTransform?.width;\n itemTransitionStyle.blockSize = transition.sizeTransform?.height;\n itemTransitionStyle.pointerEvents = \"none\";\n }\n\n if (isHidden) {\n itemTransitionClassNames.push(styles.hidden);\n }\n\n if (transform) {\n // The moved items positions are altered with CSS transform.\n if (transform.type === \"move\") {\n itemTransitionClassNames.push(styles.transformed);\n itemTransitionStyle.transform = CSSUtil.Transform.toString({\n x: transform.x,\n y: transform.y,\n scaleX: 1,\n scaleY: 1,\n });\n itemTransitionStyle.width = transform.width + \"px\";\n itemTransitionStyle.height = transform.height + \"px\";\n }\n // The item is removed from the DOM after animations play.\n // During the animations the removed item is hidden with styles.\n if (transform.type === \"remove\") {\n itemTransitionClassNames.push(styles.removed);\n }\n }\n\n const dragHandleRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => ({\n focusDragHandle: () => {\n return dragHandleRef.current?.focus();\n },\n }));\n\n const dragHookProps: UseInternalDragHandleInteractionStateProps = {\n onDndStartAction: (event) => handlePointerInteractionStart(event, \"drag\"),\n onDndActiveAction: onHandleDndTransitionActive,\n onDndEndAction: () => transition && draggableApi.submitTransition(),\n onUapActionStartAction: () => handleIncrementalTransition(\"drag\"),\n };\n const resizeHookProps: UseInternalDragHandleInteractionStateProps = {\n onDndStartAction: (event) => handlePointerInteractionStart(event, \"resize\"),\n onDndActiveAction: onHandleDndTransitionActive,\n onDndEndAction: () => transition && draggableApi.submitTransition(),\n onUapActionStartAction: () => handleIncrementalTransition(\"resize\"),\n };\n const dragInteractionHook = useInternalDragHandleInteractionState(dragHookProps);\n const resizeInteractionHook = useInternalDragHandleInteractionState(resizeHookProps);\n // We use a ref to the hook for the handle which is currently active. Distinguishment is managed in the handle button's onPointerDown callback.\n const selectedHook = useRef(dragInteractionHook);\n\n const isActive = (!!transition && !isHidden) || !!acquired;\n const shouldUsePortal =\n transition?.operation === \"insert\" &&\n transition?.interactionType === \"pointer\" &&\n selectedHook.current.interaction.value === \"dnd-active\";\n const childrenRef = useRef<ReactNode>(null);\n if (!inTransition || isActive) {\n childrenRef.current = children(!!transition?.hasDropTarget);\n }\n\n const content = (\n <div\n ref={itemRef}\n className={clsx(styles.root, ...itemTransitionClassNames)}\n style={itemTransitionStyle}\n data-item-id={item.id}\n onBlur={onBlur}\n >\n <ItemContext.Provider\n value={{\n isActive,\n isHidden,\n dragHandle: {\n ref: dragHandleRef,\n onPointerDown: (e) => onDragHandlePointerDown(e, \"drag\"),\n onKeyDown: (event: KeyboardEvent) => onHandleKeyDown(\"drag\", event),\n activeState: determineHandleActiveState({\n isHandleActive: isActive,\n currentTransition: transition,\n interactionHookValue: dragInteractionHook.interaction.value,\n targetOperation: \"reorder\",\n }),\n onDirectionClick: handleDirectionalMovement,\n initialShowButtons:\n dragInteractionHook.interaction.value === \"uap-action-start\" || (inTransition && acquired),\n },\n resizeHandle: placed\n ? {\n onPointerDown: (e) => onDragHandlePointerDown(e, \"resize\"),\n onKeyDown: (event: KeyboardEvent) => onHandleKeyDown(\"resize\", event),\n activeState: determineHandleActiveState({\n isHandleActive: isActive,\n currentTransition: transition,\n interactionHookValue: resizeInteractionHook.interaction.value,\n targetOperation: \"resize\",\n }),\n onDirectionClick: handleDirectionalMovement,\n }\n : null,\n }}\n >\n {childrenRef.current}\n </ItemContext.Provider>\n </div>\n );\n\n return shouldUsePortal ? <div>{createPortal(content, document.body)}</div> : content;\n}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { getLogicalBoundingClientRect } from "@cloudscape-design/component-toolkit/internal";
|
|
2
|
+
import { InteractionState } from "@cloudscape-design/components/internal/components/drag-handle/hooks/interfaces";
|
|
3
|
+
import { Operation } from "../dnd-controller/controller";
|
|
4
|
+
import { Coordinates } from "../utils/coordinates";
|
|
5
|
+
import { Transition } from ".";
|
|
6
|
+
export type HandleActiveState = null | "pointer" | "uap";
|
|
7
|
+
export interface DetermineHandleActiveStateArgs {
|
|
8
|
+
isHandleActive: boolean;
|
|
9
|
+
currentTransition: Transition | null;
|
|
10
|
+
interactionHookValue: InteractionState;
|
|
11
|
+
targetOperation: Operation;
|
|
12
|
+
}
|
|
13
|
+
export declare function getDndOperationType(uiOperation: "drag" | "resize", isItemPlaced: boolean): Operation;
|
|
14
|
+
interface CalculateInitialPointerDataArgs {
|
|
15
|
+
event: PointerEvent;
|
|
16
|
+
operation: "drag" | "resize";
|
|
17
|
+
rect: ReturnType<typeof getLogicalBoundingClientRect>;
|
|
18
|
+
getMinSize: () => {
|
|
19
|
+
minWidth: number;
|
|
20
|
+
minHeight: number;
|
|
21
|
+
};
|
|
22
|
+
isRtl: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Calculates the initial pointer offset and boundaries for a drag or resize interaction
|
|
26
|
+
* to help determine how the item's movement or resizing behaves relative to the pointer.
|
|
27
|
+
*/
|
|
28
|
+
export declare function calculateInitialPointerData({ event, operation, rect, getMinSize, isRtl, }: CalculateInitialPointerDataArgs): {
|
|
29
|
+
pointerOffset: Coordinates;
|
|
30
|
+
pointerBoundaries: Coordinates | null;
|
|
31
|
+
};
|
|
32
|
+
export declare function hasPointerMovedBeyondThreshold(event: PointerEvent, initialPosition: {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
} | undefined, threshold?: number): boolean;
|
|
36
|
+
export declare function determineHandleActiveState({ isHandleActive, currentTransition, interactionHookValue, targetOperation, }: DetermineHandleActiveStateArgs): HandleActiveState;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { getLogicalClientX } from "@cloudscape-design/component-toolkit/internal";
|
|
4
|
+
import { Coordinates } from "../utils/coordinates"; // Adjust this path based on your project structure
|
|
5
|
+
import { CLICK_DRAG_THRESHOLD } from ".";
|
|
6
|
+
export function getDndOperationType(uiOperation, isItemPlaced) {
|
|
7
|
+
if (uiOperation === "resize") {
|
|
8
|
+
return "resize";
|
|
9
|
+
}
|
|
10
|
+
return isItemPlaced ? "reorder" : "insert";
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Calculates the initial pointer offset and boundaries for a drag or resize interaction
|
|
14
|
+
* to help determine how the item's movement or resizing behaves relative to the pointer.
|
|
15
|
+
*/
|
|
16
|
+
export function calculateInitialPointerData({ event, operation, rect, getMinSize, isRtl, }) {
|
|
17
|
+
const clientX = getLogicalClientX(event, isRtl);
|
|
18
|
+
const clientY = event.clientY;
|
|
19
|
+
let pointerOffset;
|
|
20
|
+
let pointerBoundaries = null;
|
|
21
|
+
if (operation === "resize") {
|
|
22
|
+
// For resize, offset is calculated from the bottom-right corner.
|
|
23
|
+
pointerOffset = new Coordinates({
|
|
24
|
+
x: clientX - rect.insetInlineEnd,
|
|
25
|
+
y: clientY - rect.insetBlockEnd,
|
|
26
|
+
});
|
|
27
|
+
// Boundaries to ensure resize doesn't go below minimum dimensions.
|
|
28
|
+
const { minWidth, minHeight } = getMinSize();
|
|
29
|
+
pointerBoundaries = new Coordinates({
|
|
30
|
+
x: clientX - rect.inlineSize + minWidth,
|
|
31
|
+
y: clientY - rect.blockSize + minHeight,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
// For drag, offset is calculated from the top-left corner.
|
|
36
|
+
pointerOffset = new Coordinates({
|
|
37
|
+
x: clientX - rect.insetInlineStart,
|
|
38
|
+
y: clientY - rect.insetBlockStart,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return { pointerOffset, pointerBoundaries };
|
|
42
|
+
}
|
|
43
|
+
export function hasPointerMovedBeyondThreshold(event, initialPosition, threshold = CLICK_DRAG_THRESHOLD) {
|
|
44
|
+
if (!initialPosition) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return (event.clientX > initialPosition.x + threshold ||
|
|
48
|
+
event.clientX < initialPosition.x - threshold ||
|
|
49
|
+
event.clientY > initialPosition.y + threshold ||
|
|
50
|
+
event.clientY < initialPosition.y - threshold);
|
|
51
|
+
}
|
|
52
|
+
export function determineHandleActiveState({ isHandleActive, currentTransition, interactionHookValue, targetOperation, }) {
|
|
53
|
+
if (isHandleActive && (currentTransition === null || currentTransition === void 0 ? void 0 : currentTransition.operation) === targetOperation && interactionHookValue === "dnd-start") {
|
|
54
|
+
return "pointer";
|
|
55
|
+
}
|
|
56
|
+
else if (isHandleActive &&
|
|
57
|
+
(currentTransition === null || currentTransition === void 0 ? void 0 : currentTransition.operation) === targetOperation &&
|
|
58
|
+
interactionHookValue === "uap-action-start") {
|
|
59
|
+
return "uap";
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/internal/item-container/utils.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAgC,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAIhH,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC,CAAC,mDAAmD;AACvG,OAAO,EAAE,oBAAoB,EAAc,MAAM,GAAG,CAAC;AAWrD,MAAM,UAAU,mBAAmB,CAAC,WAA8B,EAAE,YAAqB;IACvF,IAAI,WAAW,KAAK,QAAQ,EAAE;QAC5B,OAAO,QAAQ,CAAC;KACjB;IACD,OAAO,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC7C,CAAC;AAUD;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,EAC1C,KAAK,EACL,SAAS,EACT,IAAI,EACJ,UAAU,EACV,KAAK,GAC2B;IAIhC,MAAM,OAAO,GAAG,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,KAAK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0BAA0B,CAAC,EACzC,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,GACgB;IAC/B,IAAI,cAAc,IAAI,CAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,SAAS,MAAK,eAAe,IAAI,oBAAoB,KAAK,WAAW,EAAE;QAC9G,OAAO,SAAS,CAAC;KAClB;SAAM,IACL,cAAc;QACd,CAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,SAAS,MAAK,eAAe;QAChD,oBAAoB,KAAK,kBAAkB,EAC3C;QACA,OAAO,KAAK,CAAC;KACd;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getLogicalBoundingClientRect, getLogicalClientX } from \"@cloudscape-design/component-toolkit/internal\";\nimport { InteractionState } from \"@cloudscape-design/components/internal/components/drag-handle/hooks/interfaces\";\n\nimport { Operation } from \"../dnd-controller/controller\"; // Adjust this path\nimport { Coordinates } from \"../utils/coordinates\"; // Adjust this path based on your project structure\nimport { CLICK_DRAG_THRESHOLD, Transition } from \".\";\n\nexport type HandleActiveState = null | \"pointer\" | \"uap\";\n\nexport interface DetermineHandleActiveStateArgs {\n isHandleActive: boolean;\n currentTransition: Transition | null;\n interactionHookValue: InteractionState;\n targetOperation: Operation;\n}\n\nexport function getDndOperationType(uiOperation: \"drag\" | \"resize\", isItemPlaced: boolean): Operation {\n if (uiOperation === \"resize\") {\n return \"resize\";\n }\n return isItemPlaced ? \"reorder\" : \"insert\";\n}\n\ninterface CalculateInitialPointerDataArgs {\n event: PointerEvent;\n operation: \"drag\" | \"resize\";\n rect: ReturnType<typeof getLogicalBoundingClientRect>;\n getMinSize: () => { minWidth: number; minHeight: number };\n isRtl: boolean;\n}\n\n/**\n * Calculates the initial pointer offset and boundaries for a drag or resize interaction\n * to help determine how the item's movement or resizing behaves relative to the pointer.\n */\nexport function calculateInitialPointerData({\n event,\n operation,\n rect,\n getMinSize,\n isRtl,\n}: CalculateInitialPointerDataArgs): {\n pointerOffset: Coordinates;\n pointerBoundaries: Coordinates | null;\n} {\n const clientX = getLogicalClientX(event, isRtl);\n const clientY = event.clientY;\n\n let pointerOffset: Coordinates;\n let pointerBoundaries: Coordinates | null = null;\n\n if (operation === \"resize\") {\n // For resize, offset is calculated from the bottom-right corner.\n pointerOffset = new Coordinates({\n x: clientX - rect.insetInlineEnd,\n y: clientY - rect.insetBlockEnd,\n });\n\n // Boundaries to ensure resize doesn't go below minimum dimensions.\n const { minWidth, minHeight } = getMinSize();\n pointerBoundaries = new Coordinates({\n x: clientX - rect.inlineSize + minWidth,\n y: clientY - rect.blockSize + minHeight,\n });\n } else {\n // For drag, offset is calculated from the top-left corner.\n pointerOffset = new Coordinates({\n x: clientX - rect.insetInlineStart,\n y: clientY - rect.insetBlockStart,\n });\n }\n\n return { pointerOffset, pointerBoundaries };\n}\n\nexport function hasPointerMovedBeyondThreshold(\n event: PointerEvent,\n initialPosition: { x: number; y: number } | undefined,\n threshold: number = CLICK_DRAG_THRESHOLD,\n): boolean {\n if (!initialPosition) {\n return false;\n }\n return (\n event.clientX > initialPosition.x + threshold ||\n event.clientX < initialPosition.x - threshold ||\n event.clientY > initialPosition.y + threshold ||\n event.clientY < initialPosition.y - threshold\n );\n}\n\nexport function determineHandleActiveState({\n isHandleActive,\n currentTransition,\n interactionHookValue,\n targetOperation,\n}: DetermineHandleActiveStateArgs): HandleActiveState {\n if (isHandleActive && currentTransition?.operation === targetOperation && interactionHookValue === \"dnd-start\") {\n return \"pointer\";\n } else if (\n isHandleActive &&\n currentTransition?.operation === targetOperation &&\n interactionHookValue === \"uap-action-start\"\n ) {\n return \"uap\";\n }\n return null;\n}\n"]}
|
package/internal/manifest.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { KeyboardEvent, PointerEvent } from "react";
|
|
2
|
+
import { InternalDragHandleProps } from "@cloudscape-design/components/internal/do-not-use/drag-handle";
|
|
3
|
+
import { HandleActiveState } from "../item-container";
|
|
2
4
|
export interface ResizeHandleProps {
|
|
3
5
|
ariaLabelledBy: string;
|
|
4
6
|
ariaDescribedBy: string;
|
|
5
7
|
onPointerDown: (event: PointerEvent) => void;
|
|
6
8
|
onKeyDown: (event: KeyboardEvent) => void;
|
|
7
|
-
|
|
9
|
+
activeState: HandleActiveState;
|
|
10
|
+
onDirectionClick: InternalDragHandleProps["onDirectionClick"];
|
|
11
|
+
resizeHandleTooltipText?: string;
|
|
8
12
|
}
|
|
9
|
-
export default function ResizeHandle({ ariaLabelledBy, ariaDescribedBy, onPointerDown, onKeyDown,
|
|
13
|
+
export default function ResizeHandle({ ariaLabelledBy, ariaDescribedBy, onPointerDown, onKeyDown, activeState, onDirectionClick, resizeHandleTooltipText, }: ResizeHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { InternalDragHandle, } from "@cloudscape-design/components/internal/do-not-use/drag-handle";
|
|
4
|
+
import { CLICK_DRAG_THRESHOLD } from "../item-container";
|
|
5
5
|
import styles from "./styles.css.js";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import testUtilsStyles from "./test-classes/styles.css.js";
|
|
7
|
+
export default function ResizeHandle({ ariaLabelledBy, ariaDescribedBy, onPointerDown, onKeyDown, activeState, onDirectionClick, resizeHandleTooltipText, }) {
|
|
8
|
+
return (_jsx(InternalDragHandle, { className: clsx(styles.handle, activeState === "pointer" && styles.active, activeState === "uap" && testUtilsStyles["active-uap"]), ariaLabelledBy: ariaLabelledBy, ariaDescribedby: ariaDescribedBy, variant: "resize-area", tooltipText: resizeHandleTooltipText, onKeyDown: onKeyDown, onPointerDown: onPointerDown, directions: {
|
|
9
|
+
"block-start": "active",
|
|
10
|
+
"block-end": "active",
|
|
11
|
+
"inline-start": "active",
|
|
12
|
+
"inline-end": "active",
|
|
13
|
+
}, triggerMode: "keyboard-activate", onDirectionClick: onDirectionClick, hideButtonsOnDrag: true, clickDragThreshold: CLICK_DRAG_THRESHOLD }));
|
|
8
14
|
}
|
|
9
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal/resize-handle/index.tsx"],"names":[],"mappings":";AAGA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal/resize-handle/index.tsx"],"names":[],"mappings":";AAGA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EACL,kBAAkB,GAEnB,MAAM,+DAA+D,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAqB,MAAM,mBAAmB,CAAC;AAE5E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAY3D,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,cAAc,EACd,eAAe,EACf,aAAa,EACb,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,uBAAuB,GACL;IAClB,OAAO,CACL,KAAC,kBAAkB,IACjB,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,MAAM,EACb,WAAW,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,EAC1C,WAAW,KAAK,KAAK,IAAI,eAAe,CAAC,YAAY,CAAC,CACvD,EACD,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,OAAO,EAAC,aAAa,EACrB,WAAW,EAAE,uBAAuB,EACpC,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE;YACV,aAAa,EAAE,QAAQ;YACvB,WAAW,EAAE,QAAQ;YACrB,cAAc,EAAE,QAAQ;YACxB,YAAY,EAAE,QAAQ;SACvB,EACD,WAAW,EAAC,mBAAmB,EAC/B,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,IAAI,EACvB,kBAAkB,EAAE,oBAAoB,GACxC,CACH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { KeyboardEvent, PointerEvent } from \"react\";\nimport clsx from \"clsx\";\n\nimport {\n InternalDragHandle,\n InternalDragHandleProps,\n} from \"@cloudscape-design/components/internal/do-not-use/drag-handle\";\n\nimport { CLICK_DRAG_THRESHOLD, HandleActiveState } from \"../item-container\";\n\nimport styles from \"./styles.css.js\";\nimport testUtilsStyles from \"./test-classes/styles.css.js\";\n\nexport interface ResizeHandleProps {\n ariaLabelledBy: string;\n ariaDescribedBy: string;\n onPointerDown: (event: PointerEvent) => void;\n onKeyDown: (event: KeyboardEvent) => void;\n activeState: HandleActiveState;\n onDirectionClick: InternalDragHandleProps[\"onDirectionClick\"];\n resizeHandleTooltipText?: string;\n}\n\nexport default function ResizeHandle({\n ariaLabelledBy,\n ariaDescribedBy,\n onPointerDown,\n onKeyDown,\n activeState,\n onDirectionClick,\n resizeHandleTooltipText,\n}: ResizeHandleProps) {\n return (\n <InternalDragHandle\n className={clsx(\n styles.handle,\n activeState === \"pointer\" && styles.active,\n activeState === \"uap\" && testUtilsStyles[\"active-uap\"],\n )}\n ariaLabelledBy={ariaLabelledBy}\n ariaDescribedby={ariaDescribedBy}\n variant=\"resize-area\"\n tooltipText={resizeHandleTooltipText}\n onKeyDown={onKeyDown}\n onPointerDown={onPointerDown}\n directions={{\n \"block-start\": \"active\",\n \"block-end\": \"active\",\n \"inline-start\": \"active\",\n \"inline-end\": \"active\",\n }}\n triggerMode=\"keyboard-activate\"\n onDirectionClick={onDirectionClick}\n hideButtonsOnDrag={true}\n clickDragThreshold={CLICK_DRAG_THRESHOLD}\n />\n );\n}\n"]}
|
|
@@ -6,32 +6,23 @@
|
|
|
6
6
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
7
|
SPDX-License-Identifier: Apache-2.0
|
|
8
8
|
*/
|
|
9
|
-
.
|
|
9
|
+
.awsui_handle_19hnz_1atim_9:not(#\9) {
|
|
10
10
|
cursor: nwse-resize;
|
|
11
|
+
appearance: none;
|
|
12
|
+
background: transparent;
|
|
13
|
+
border: none;
|
|
14
|
+
padding-block: var(--space-scaled-xxs-pfm1nx, 4px);
|
|
15
|
+
padding-inline: var(--space-scaled-xxs-pfm1nx, 4px);
|
|
16
|
+
block-size: auto;
|
|
17
|
+
color: var(--color-text-interactive-default-ugh9wp, #424650);
|
|
11
18
|
}
|
|
12
|
-
.
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.awsui_handle_19hnz_3wk8b_9:not(#\9):not(.awsui_active_19hnz_3wk8b_16):focus-visible {
|
|
17
|
-
position: relative;
|
|
18
|
-
box-sizing: border-box;
|
|
19
|
-
outline: 2px dotted transparent;
|
|
20
|
-
outline-offset: 3px;
|
|
19
|
+
.awsui_handle_19hnz_1atim_9:not(#\9):hover {
|
|
20
|
+
color: var(--color-text-interactive-hover-6naf7i, #0f141a);
|
|
21
21
|
}
|
|
22
|
-
.
|
|
23
|
-
|
|
24
|
-
display: block;
|
|
25
|
-
position: absolute;
|
|
26
|
-
box-sizing: border-box;
|
|
27
|
-
inset-inline-start: calc(-1 * 4px);
|
|
28
|
-
inset-block-start: calc(-1 * 4px);
|
|
29
|
-
inline-size: calc(100% + 2 * 4px);
|
|
30
|
-
block-size: calc(100% + 2 * 4px);
|
|
31
|
-
border-radius: var(--border-radius-control-default-focus-ring-1uabki, 4px);
|
|
32
|
-
border: 2px solid var(--color-border-item-focused-8bi903, #006ce0);
|
|
22
|
+
.awsui_handle_19hnz_1atim_9:not(#\9):dir(rtl) {
|
|
23
|
+
cursor: nesw-resize;
|
|
33
24
|
}
|
|
34
25
|
|
|
35
|
-
.
|
|
26
|
+
.awsui_active_19hnz_1atim_26:not(#\9) {
|
|
36
27
|
outline: none;
|
|
37
28
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"handle": "
|
|
6
|
-
"active": "
|
|
5
|
+
"handle": "awsui_handle_19hnz_1atim_9",
|
|
6
|
+
"active": "awsui_active_19hnz_1atim_26"
|
|
7
7
|
};
|
|
8
8
|
|
package/package.json
CHANGED
package/internal/handle/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
import { forwardRef } from "react";
|
|
5
|
-
import clsx from "clsx";
|
|
6
|
-
import styles from "./styles.css.js";
|
|
7
|
-
function Handle(props, ref) {
|
|
8
|
-
function handlePointerDown(event) {
|
|
9
|
-
var _a;
|
|
10
|
-
if (event.button !== 0) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
(_a = props.onPointerDown) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
14
|
-
}
|
|
15
|
-
return (_jsx("button", { ...props, onPointerDown: handlePointerDown, className: clsx(styles.handle, props.className), ref: ref }));
|
|
16
|
-
}
|
|
17
|
-
export default forwardRef(Handle);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal/handle/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAsC,UAAU,EAAgB,MAAM,OAAO,CAAC;AACrF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,SAAS,MAAM,CAAC,KAA8C,EAAE,GAAoC;IAClG,SAAS,iBAAiB,CAAC,KAAsC;;QAC/D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO;SACR;QACD,MAAA,KAAK,CAAC,aAAa,sDAAG,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,CACL,oBAAY,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,GAAI,CACnH,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC,MAAM,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ButtonHTMLAttributes, ForwardedRef, forwardRef, PointerEvent } from \"react\";\nimport clsx from \"clsx\";\n\nimport styles from \"./styles.css.js\";\n\nfunction Handle(props: ButtonHTMLAttributes<HTMLButtonElement>, ref: ForwardedRef<HTMLButtonElement>) {\n function handlePointerDown(event: PointerEvent<HTMLButtonElement>) {\n if (event.button !== 0) {\n return;\n }\n props.onPointerDown?.(event);\n }\n\n return (\n <button {...props} onPointerDown={handlePointerDown} className={clsx(styles.handle, props.className)} ref={ref} />\n );\n}\n\nexport default forwardRef(Handle);\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
-
SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
.awsui_handle_cc1pu_kbnrd_5:not(#\9) {
|
|
6
|
-
appearance: none;
|
|
7
|
-
background: transparent;
|
|
8
|
-
border: none;
|
|
9
|
-
padding-block: var(--space-scaled-xxs-pfm1nx, 4px);
|
|
10
|
-
padding-inline: var(--space-scaled-xxs-pfm1nx, 4px);
|
|
11
|
-
color: var(--color-text-interactive-default-1o1pl2, #424650);
|
|
12
|
-
}
|
|
13
|
-
.awsui_handle_cc1pu_kbnrd_5:not(#\9):hover {
|
|
14
|
-
color: var(--color-text-interactive-hover-j5y3wx, #0f141a);
|
|
15
|
-
}
|