@cloudscape-design/board-components 3.0.170 → 3.0.171
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/transition.js +1 -1
- package/board/transition.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/generated/styles/tokens.d.ts +1 -0
- package/internal/generated/styles/tokens.js +1 -0
- package/internal/generated/theming/index.cjs +31 -0
- package/internal/generated/theming/index.js +31 -0
- package/internal/manifest.json +1 -1
- package/package.json +14 -10
package/board/transition.js
CHANGED
|
@@ -199,7 +199,7 @@ function updateTransitionWithKeyboardEvent(state, { direction }, { isRtl }) {
|
|
|
199
199
|
announcement: createOperationAnnouncement(nextTransition, direction),
|
|
200
200
|
};
|
|
201
201
|
}
|
|
202
|
-
catch
|
|
202
|
+
catch {
|
|
203
203
|
// Can't create next layout because the next path is out of bounds.
|
|
204
204
|
return state;
|
|
205
205
|
}
|
package/board/transition.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transition.js","sourceRoot":"","sources":["../../../src/board/transition.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAuB,UAAU,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAI7F,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACpH,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,qB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AAkB,CAAC,CAAC;IAEzE,qGAAqG;IACrG,MAAM,YAAY,GAAG,EAAE,GAAG,UAAU,CAAC,aAAa,EAAE,YAAY,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IAEjG,MAAM,cAAc,GAAkB;QACpC,GAAG,UAAU;QACb,YAAY,EAAE,IAAI,GAAG,EAAE;QACvB,WAAW;QACX,IAAI;QACJ,YAAY;QACZ,mBAAmB;KACpB,CAAC;IACF,OAAO;QACL,UAAU,EAAE,cAAc;QAC1B,gBAAgB,EAAE,IAAI;QACtB,YAAY,EAAE,2BAA2B,CAAC,cAAc,EAAE,IAAI,CAAC;KAChE,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Dispatch, ReactNode, useReducer } from \"react\";\n\nimport { getLogicalBoundingClientRect } from \"@cloudscape-design/component-toolkit/internal\";\n\nimport { InteractionType, Operation } from \"../internal/dnd-controller/controller\";\nimport { BoardItemDefinitionBase, Direction, GridLayout, ItemId, Rect } from \"../internal/interfaces\";\nimport { LayoutEngine } from \"../internal/layout-engine/engine\";\nimport { Coordinates } from \"../internal/utils/coordinates\";\nimport { getDefaultColumnSpan, getDefaultRowSpan, getMinColumnSpan, getMinRowSpan } from \"../internal/utils/layout\";\nimport { Position } from \"../internal/utils/position\";\nimport { BoardProps, RemoveTransition, Transition, TransitionAnnouncement } from \"./interfaces\";\nimport { createOperationAnnouncement } from \"./utils/announcements\";\nimport { getHoveredRect } from \"./utils/get-hovered-rect\";\nimport { getInsertionDirection, getLayoutPlaceholders, getLayoutRows, getLayoutShift } from \"./utils/layout\";\nimport { appendMovePath, appendResizePath } from \"./utils/path\";\n\nexport interface TransitionState<D> {\n transition: null | Transition<D>;\n removeTransition: null | RemoveTransition<D>;\n announcement: null | TransitionAnnouncement;\n}\n\nexport type Action<D> =\n | InitAction<D>\n | InitRemoveAction<D>\n | SubmitAction\n | DiscardAction\n | UpdateWithPointerAction\n | UpdateWithKeyboardAction\n | AcquireItemAction;\n\ninterface InitAction<D> {\n type: \"init\";\n operation: Operation;\n interactionType: InteractionType;\n itemsLayout: GridLayout;\n draggableItem: BoardItemDefinitionBase<D>;\n draggableRect: Rect;\n collisionIds: readonly ItemId[];\n}\ninterface InitRemoveAction<D> {\n type: \"init-remove\";\n items: readonly BoardProps.Item<D>[];\n removedItem: BoardItemDefinitionBase<D>;\n itemsLayout: GridLayout;\n}\ninterface SubmitAction {\n type: \"submit\";\n}\ninterface DiscardAction {\n type: \"discard\";\n}\ninterface UpdateWithPointerAction {\n type: \"update-with-pointer\";\n collisionIds: readonly ItemId[];\n positionOffset: Coordinates;\n draggableRect: Rect;\n}\ninterface UpdateWithKeyboardAction {\n type: \"update-with-keyboard\";\n direction: Direction;\n}\ninterface AcquireItemAction {\n type: \"acquire-item\";\n position: Position;\n layoutElement: HTMLElement;\n acquiredItemElement?: ReactNode;\n}\n\nexport function useTransition<D>({ isRtl }: { isRtl: () => boolean }): [TransitionState<D>, Dispatch<Action<D>>] {\n return useReducer(createTransitionReducer<D>({ isRtl }), {\n transition: null,\n removeTransition: null,\n announcement: null,\n });\n}\n\nexport function selectTransitionRows<D>(state: TransitionState<D>) {\n return state.transition ? getLayoutRows(state.transition) : 0;\n}\n\nfunction createTransitionReducer<D>({ isRtl }: { isRtl: () => boolean }) {\n return function transitionReducer(state: TransitionState<D>, action: Action<D>): TransitionState<D> {\n switch (action.type) {\n case \"init\":\n return initTransition(action);\n case \"init-remove\":\n return initRemoveTransition(action);\n case \"submit\":\n return submitTransition(state);\n case \"discard\":\n return discardTransition(state);\n case \"update-with-pointer\":\n return updateTransitionWithPointerEvent(state, action);\n case \"update-with-keyboard\":\n return updateTransitionWithKeyboardEvent(state, action, { isRtl });\n case \"acquire-item\":\n return acquireTransitionItem(state, action);\n }\n };\n}\n\nfunction initTransition<D>({\n operation,\n interactionType,\n itemsLayout,\n draggableItem,\n draggableRect,\n collisionIds,\n}: InitAction<D>): TransitionState<D> {\n const transition: Transition<D> = {\n operation,\n interactionType,\n itemsLayout,\n layoutEngine: new LayoutEngine(itemsLayout),\n insertionDirection: null,\n draggableItem,\n draggableRect,\n acquiredItem: null,\n collisionIds: new Set(),\n layoutShift: null,\n path: [],\n };\n\n const placeholdersLayout = getLayoutPlaceholders(transition);\n\n const layoutItem = itemsLayout.items.find((it) => it.id === draggableItem.id);\n\n let path: Position[] = [];\n if (interactionType === \"pointer\" || operation === \"insert\") {\n const collisionRect = getHoveredRect(collisionIds, placeholdersLayout.items);\n const appendPath = operation === \"resize\" ? appendResizePath : appendMovePath;\n path = layoutItem ? appendPath([], collisionRect) : [];\n } else if (layoutItem) {\n path =\n operation === \"resize\"\n ? [new Position({ x: layoutItem.x + layoutItem.width, y: layoutItem.y + layoutItem.height })]\n : [new Position({ x: layoutItem.x, y: layoutItem.y })];\n }\n\n return {\n transition: { ...transition, path },\n removeTransition: null,\n announcement: layoutItem ? { type: \"dnd-started\", item: draggableItem, operation } : null,\n };\n}\n\nfunction initRemoveTransition<D>({ items, removedItem, itemsLayout }: InitRemoveAction<D>): TransitionState<D> {\n const layoutShift = new LayoutEngine(itemsLayout).remove(removedItem.id);\n const removeTransition: RemoveTransition<D> = { items, removedItem, layoutShift };\n return { transition: null, removeTransition, announcement: null };\n}\n\nfunction submitTransition<D>(state: TransitionState<D>): TransitionState<D> {\n const { transition, removeTransition } = state;\n\n if (removeTransition) {\n const disturbed = new Set(removeTransition.layoutShift.moves.map((move) => move.itemId));\n disturbed.delete(removeTransition.removedItem.id);\n return {\n transition: null,\n removeTransition: null,\n announcement: { type: \"item-removed\", item: removeTransition.removedItem, disturbed },\n };\n }\n\n if (!transition) {\n return { transition: null, removeTransition: null, announcement: null };\n }\n\n const { operation, itemsLayout, draggableItem: item, acquiredItem } = transition;\n const itemBelongsToBoard = item.id === acquiredItem?.id || itemsLayout.items.some((it) => it.id === item.id);\n return transition.layoutShift?.conflicts.length === 0\n ? {\n transition: null,\n removeTransition: null,\n announcement: itemBelongsToBoard ? { type: \"dnd-committed\", item, operation } : null,\n }\n : {\n transition: null,\n removeTransition: null,\n announcement: itemBelongsToBoard ? { type: \"dnd-discarded\", item, operation } : null,\n };\n}\n\nfunction discardTransition<D>(state: TransitionState<D>): TransitionState<D> {\n const { transition, removeTransition } = state;\n\n if (removeTransition) {\n throw new Error(\"Invariant violation: can't discard remove transition.\");\n }\n\n if (!transition) {\n return { transition: null, removeTransition: null, announcement: null };\n }\n\n const { operation, itemsLayout, draggableItem: item, acquiredItem } = transition;\n const itemBelongsToBoard = item.id === acquiredItem?.id || itemsLayout.items.some((it) => it.id === item.id);\n return {\n transition: null,\n removeTransition: null,\n announcement: itemBelongsToBoard ? { type: \"dnd-discarded\", item, operation } : null,\n };\n}\n\nfunction updateTransitionWithPointerEvent<D>(\n state: TransitionState<D>,\n { collisionIds, positionOffset, draggableRect }: UpdateWithPointerAction,\n): TransitionState<D> {\n const { transition } = state;\n\n if (!transition) {\n return { transition: null, removeTransition: null, announcement: null };\n }\n\n const layout = transition.layoutShift?.next ?? transition.itemsLayout;\n const layoutItem = layout.items.find((it) => it.id === transition.draggableItem.id);\n const itemWidth = layoutItem ? layoutItem.width : getDefaultColumnSpan(transition.draggableItem, layout.columns);\n const itemHeight = layoutItem ? layoutItem.height : getDefaultRowSpan(transition.draggableItem);\n const itemSize = itemWidth * itemHeight;\n\n const isOutOfBoundaries =\n transition.operation !== \"resize\" ? collisionIds.length < itemSize : collisionIds.length === 0;\n\n if (isOutOfBoundaries) {\n return {\n transition: {\n ...transition,\n draggableRect,\n collisionIds: new Set(),\n layoutShift: null,\n insertionDirection: null,\n },\n removeTransition: null,\n announcement: null,\n };\n }\n\n const placeholdersLayout = getLayoutPlaceholders(transition);\n const collisionRect = getHoveredRect(collisionIds, placeholdersLayout.items);\n const appendPath = transition.operation === \"resize\" ? appendResizePath : appendMovePath;\n const path = appendPath(transition.path, collisionRect);\n\n const insertionDirection = transition.insertionDirection ?? getInsertionDirection(positionOffset);\n const layoutShift = getLayoutShift(transition, path, insertionDirection);\n\n return {\n transition: {\n ...transition,\n draggableRect,\n collisionIds: new Set(collisionIds),\n layoutShift,\n path,\n insertionDirection,\n },\n removeTransition: null,\n announcement: null,\n };\n}\n\nfunction updateTransitionWithKeyboardEvent<D>(\n state: TransitionState<D>,\n { direction }: UpdateWithKeyboardAction,\n { isRtl }: { isRtl: () => boolean },\n): TransitionState<D> {\n const { transition } = state;\n\n if (!transition) {\n return { transition: null, removeTransition: null, announcement: null };\n }\n\n const updateManualItemTransition = (transition: Transition<D>, direction: Direction): TransitionState<D> => {\n const xDelta = direction === \"left\" ? -1 : direction === \"right\" ? 1 : 0;\n const yDelta = direction === \"up\" ? -1 : direction === \"down\" ? 1 : 0;\n const lastPosition = transition.path[transition.path.length - 1];\n const nextPosition = new Position({ x: lastPosition.x + xDelta, y: lastPosition.y + yDelta });\n const nextPath = [...transition.path, nextPosition];\n\n // Check resizing below min size.\n const layout = transition.layoutShift?.next ?? transition.itemsLayout;\n const layoutItem = layout.items.find((it) => it.id === transition.draggableItem.id);\n const minWidth = getMinColumnSpan(transition.draggableItem, transition.itemsLayout.columns);\n const minHeight = getMinRowSpan(transition.draggableItem);\n if (\n transition.operation === \"resize\" &&\n layoutItem &&\n (layoutItem.width + xDelta < minWidth || layoutItem.height + yDelta < minHeight)\n ) {\n return state;\n }\n\n try {\n const layoutShift = getLayoutShift(transition, nextPath);\n const nextTransition = { ...transition, layoutShift, path: nextPath };\n return {\n transition: nextTransition,\n removeTransition: null,\n announcement: createOperationAnnouncement(nextTransition, direction),\n };\n } catch (e) {\n // Can't create next layout because the next path is out of bounds.\n return state;\n }\n };\n\n switch (direction) {\n case \"left\":\n return updateManualItemTransition(transition, !isRtl() ? \"left\" : \"right\");\n case \"right\":\n return updateManualItemTransition(transition, !isRtl() ? \"right\" : \"left\");\n case \"up\":\n return updateManualItemTransition(transition, \"up\");\n case \"down\":\n return updateManualItemTransition(transition, \"down\");\n }\n}\n\nfunction acquireTransitionItem<D>(\n state: TransitionState<D>,\n { position, layoutElement, acquiredItemElement }: AcquireItemAction,\n): TransitionState<D> {\n const { transition } = state;\n\n if (!transition) {\n return { transition: null, removeTransition: null, announcement: null };\n }\n\n const { columns } = transition.itemsLayout;\n\n const layoutRect = getLogicalBoundingClientRect(layoutElement);\n const itemRect = transition.draggableRect;\n const coordinatesX = itemRect.left - layoutRect.insetInlineStart;\n const offset = new Coordinates({ x: coordinatesX, y: itemRect.top - layoutRect.insetBlockStart });\n const insertionDirection = getInsertionDirection(offset);\n\n // Update original insertion position if the item can't fit into the layout by width.\n const width = getDefaultColumnSpan(transition.draggableItem, columns);\n position = new Position({ x: Math.min(columns - width, position.x), y: position.y });\n\n const path = [...transition.path, position];\n\n const layoutShift = getLayoutShift(transition, path, insertionDirection);\n\n // The columnOffset, columnSpan and rowSpan are of no use as of being overridden by the layout shift.\n const acquiredItem = { ...transition.draggableItem, columnOffset: 0, columnSpan: 1, rowSpan: 1 };\n\n const nextTransition: Transition<D> = {\n ...transition,\n collisionIds: new Set(),\n layoutShift,\n path,\n acquiredItem,\n acquiredItemElement,\n };\n return {\n transition: nextTransition,\n removeTransition: null,\n announcement: createOperationAnnouncement(nextTransition, null),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"transition.js","sourceRoot":"","sources":["../../../src/board/transition.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAuB,UAAU,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAI7F,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACpH,OAAO,EAA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AC,EAAE,CAAC,CAAC;IAErF,MAAM,IAAI,GAAG,CAAC,GAAG,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAE5C,MAAM,WAAW,GAAG,cAAc,CAAC,UAAU,EAAE,IAAI,EAAE,kBAAkB,CAAC,CAAC;IAEzE,qGAAqG;IACrG,MAAM,YAAY,GAAG,EAAE,GAAG,UAAU,CAAC,aAAa,EAAE,YAAY,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IAEjG,MAAM,cAAc,GAAkB;QACpC,GAAG,UAAU;QACb,YAAY,EAAE,IAAI,GAAG,EAAE;QACvB,WAAW;QACX,IAAI;QACJ,YAAY;QACZ,mBAAmB;KACpB,CAAC;IACF,OAAO;QACL,UAAU,EAAE,cAAc;QAC1B,gBAAgB,EAAE,IAAI;QACtB,YAAY,EAAE,2BAA2B,CAAC,cAAc,EAAE,IAAI,CAAC;KAChE,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Dispatch, ReactNode, useReducer } from \"react\";\n\nimport { getLogicalBoundingClientRect } from \"@cloudscape-design/component-toolkit/internal\";\n\nimport { InteractionType, Operation } from \"../internal/dnd-controller/controller\";\nimport { BoardItemDefinitionBase, Direction, GridLayout, ItemId, Rect } from \"../internal/interfaces\";\nimport { LayoutEngine } from \"../internal/layout-engine/engine\";\nimport { Coordinates } from \"../internal/utils/coordinates\";\nimport { getDefaultColumnSpan, getDefaultRowSpan, getMinColumnSpan, getMinRowSpan } from \"../internal/utils/layout\";\nimport { Position } from \"../internal/utils/position\";\nimport { BoardProps, RemoveTransition, Transition, TransitionAnnouncement } from \"./interfaces\";\nimport { createOperationAnnouncement } from \"./utils/announcements\";\nimport { getHoveredRect } from \"./utils/get-hovered-rect\";\nimport { getInsertionDirection, getLayoutPlaceholders, getLayoutRows, getLayoutShift } from \"./utils/layout\";\nimport { appendMovePath, appendResizePath } from \"./utils/path\";\n\nexport interface TransitionState<D> {\n transition: null | Transition<D>;\n removeTransition: null | RemoveTransition<D>;\n announcement: null | TransitionAnnouncement;\n}\n\nexport type Action<D> =\n | InitAction<D>\n | InitRemoveAction<D>\n | SubmitAction\n | DiscardAction\n | UpdateWithPointerAction\n | UpdateWithKeyboardAction\n | AcquireItemAction;\n\ninterface InitAction<D> {\n type: \"init\";\n operation: Operation;\n interactionType: InteractionType;\n itemsLayout: GridLayout;\n draggableItem: BoardItemDefinitionBase<D>;\n draggableRect: Rect;\n collisionIds: readonly ItemId[];\n}\ninterface InitRemoveAction<D> {\n type: \"init-remove\";\n items: readonly BoardProps.Item<D>[];\n removedItem: BoardItemDefinitionBase<D>;\n itemsLayout: GridLayout;\n}\ninterface SubmitAction {\n type: \"submit\";\n}\ninterface DiscardAction {\n type: \"discard\";\n}\ninterface UpdateWithPointerAction {\n type: \"update-with-pointer\";\n collisionIds: readonly ItemId[];\n positionOffset: Coordinates;\n draggableRect: Rect;\n}\ninterface UpdateWithKeyboardAction {\n type: \"update-with-keyboard\";\n direction: Direction;\n}\ninterface AcquireItemAction {\n type: \"acquire-item\";\n position: Position;\n layoutElement: HTMLElement;\n acquiredItemElement?: ReactNode;\n}\n\nexport function useTransition<D>({ isRtl }: { isRtl: () => boolean }): [TransitionState<D>, Dispatch<Action<D>>] {\n return useReducer(createTransitionReducer<D>({ isRtl }), {\n transition: null,\n removeTransition: null,\n announcement: null,\n });\n}\n\nexport function selectTransitionRows<D>(state: TransitionState<D>) {\n return state.transition ? getLayoutRows(state.transition) : 0;\n}\n\nfunction createTransitionReducer<D>({ isRtl }: { isRtl: () => boolean }) {\n return function transitionReducer(state: TransitionState<D>, action: Action<D>): TransitionState<D> {\n switch (action.type) {\n case \"init\":\n return initTransition(action);\n case \"init-remove\":\n return initRemoveTransition(action);\n case \"submit\":\n return submitTransition(state);\n case \"discard\":\n return discardTransition(state);\n case \"update-with-pointer\":\n return updateTransitionWithPointerEvent(state, action);\n case \"update-with-keyboard\":\n return updateTransitionWithKeyboardEvent(state, action, { isRtl });\n case \"acquire-item\":\n return acquireTransitionItem(state, action);\n }\n };\n}\n\nfunction initTransition<D>({\n operation,\n interactionType,\n itemsLayout,\n draggableItem,\n draggableRect,\n collisionIds,\n}: InitAction<D>): TransitionState<D> {\n const transition: Transition<D> = {\n operation,\n interactionType,\n itemsLayout,\n layoutEngine: new LayoutEngine(itemsLayout),\n insertionDirection: null,\n draggableItem,\n draggableRect,\n acquiredItem: null,\n collisionIds: new Set(),\n layoutShift: null,\n path: [],\n };\n\n const placeholdersLayout = getLayoutPlaceholders(transition);\n\n const layoutItem = itemsLayout.items.find((it) => it.id === draggableItem.id);\n\n let path: Position[] = [];\n if (interactionType === \"pointer\" || operation === \"insert\") {\n const collisionRect = getHoveredRect(collisionIds, placeholdersLayout.items);\n const appendPath = operation === \"resize\" ? appendResizePath : appendMovePath;\n path = layoutItem ? appendPath([], collisionRect) : [];\n } else if (layoutItem) {\n path =\n operation === \"resize\"\n ? [new Position({ x: layoutItem.x + layoutItem.width, y: layoutItem.y + layoutItem.height })]\n : [new Position({ x: layoutItem.x, y: layoutItem.y })];\n }\n\n return {\n transition: { ...transition, path },\n removeTransition: null,\n announcement: layoutItem ? { type: \"dnd-started\", item: draggableItem, operation } : null,\n };\n}\n\nfunction initRemoveTransition<D>({ items, removedItem, itemsLayout }: InitRemoveAction<D>): TransitionState<D> {\n const layoutShift = new LayoutEngine(itemsLayout).remove(removedItem.id);\n const removeTransition: RemoveTransition<D> = { items, removedItem, layoutShift };\n return { transition: null, removeTransition, announcement: null };\n}\n\nfunction submitTransition<D>(state: TransitionState<D>): TransitionState<D> {\n const { transition, removeTransition } = state;\n\n if (removeTransition) {\n const disturbed = new Set(removeTransition.layoutShift.moves.map((move) => move.itemId));\n disturbed.delete(removeTransition.removedItem.id);\n return {\n transition: null,\n removeTransition: null,\n announcement: { type: \"item-removed\", item: removeTransition.removedItem, disturbed },\n };\n }\n\n if (!transition) {\n return { transition: null, removeTransition: null, announcement: null };\n }\n\n const { operation, itemsLayout, draggableItem: item, acquiredItem } = transition;\n const itemBelongsToBoard = item.id === acquiredItem?.id || itemsLayout.items.some((it) => it.id === item.id);\n return transition.layoutShift?.conflicts.length === 0\n ? {\n transition: null,\n removeTransition: null,\n announcement: itemBelongsToBoard ? { type: \"dnd-committed\", item, operation } : null,\n }\n : {\n transition: null,\n removeTransition: null,\n announcement: itemBelongsToBoard ? { type: \"dnd-discarded\", item, operation } : null,\n };\n}\n\nfunction discardTransition<D>(state: TransitionState<D>): TransitionState<D> {\n const { transition, removeTransition } = state;\n\n if (removeTransition) {\n throw new Error(\"Invariant violation: can't discard remove transition.\");\n }\n\n if (!transition) {\n return { transition: null, removeTransition: null, announcement: null };\n }\n\n const { operation, itemsLayout, draggableItem: item, acquiredItem } = transition;\n const itemBelongsToBoard = item.id === acquiredItem?.id || itemsLayout.items.some((it) => it.id === item.id);\n return {\n transition: null,\n removeTransition: null,\n announcement: itemBelongsToBoard ? { type: \"dnd-discarded\", item, operation } : null,\n };\n}\n\nfunction updateTransitionWithPointerEvent<D>(\n state: TransitionState<D>,\n { collisionIds, positionOffset, draggableRect }: UpdateWithPointerAction,\n): TransitionState<D> {\n const { transition } = state;\n\n if (!transition) {\n return { transition: null, removeTransition: null, announcement: null };\n }\n\n const layout = transition.layoutShift?.next ?? transition.itemsLayout;\n const layoutItem = layout.items.find((it) => it.id === transition.draggableItem.id);\n const itemWidth = layoutItem ? layoutItem.width : getDefaultColumnSpan(transition.draggableItem, layout.columns);\n const itemHeight = layoutItem ? layoutItem.height : getDefaultRowSpan(transition.draggableItem);\n const itemSize = itemWidth * itemHeight;\n\n const isOutOfBoundaries =\n transition.operation !== \"resize\" ? collisionIds.length < itemSize : collisionIds.length === 0;\n\n if (isOutOfBoundaries) {\n return {\n transition: {\n ...transition,\n draggableRect,\n collisionIds: new Set(),\n layoutShift: null,\n insertionDirection: null,\n },\n removeTransition: null,\n announcement: null,\n };\n }\n\n const placeholdersLayout = getLayoutPlaceholders(transition);\n const collisionRect = getHoveredRect(collisionIds, placeholdersLayout.items);\n const appendPath = transition.operation === \"resize\" ? appendResizePath : appendMovePath;\n const path = appendPath(transition.path, collisionRect);\n\n const insertionDirection = transition.insertionDirection ?? getInsertionDirection(positionOffset);\n const layoutShift = getLayoutShift(transition, path, insertionDirection);\n\n return {\n transition: {\n ...transition,\n draggableRect,\n collisionIds: new Set(collisionIds),\n layoutShift,\n path,\n insertionDirection,\n },\n removeTransition: null,\n announcement: null,\n };\n}\n\nfunction updateTransitionWithKeyboardEvent<D>(\n state: TransitionState<D>,\n { direction }: UpdateWithKeyboardAction,\n { isRtl }: { isRtl: () => boolean },\n): TransitionState<D> {\n const { transition } = state;\n\n if (!transition) {\n return { transition: null, removeTransition: null, announcement: null };\n }\n\n const updateManualItemTransition = (transition: Transition<D>, direction: Direction): TransitionState<D> => {\n const xDelta = direction === \"left\" ? -1 : direction === \"right\" ? 1 : 0;\n const yDelta = direction === \"up\" ? -1 : direction === \"down\" ? 1 : 0;\n const lastPosition = transition.path[transition.path.length - 1];\n const nextPosition = new Position({ x: lastPosition.x + xDelta, y: lastPosition.y + yDelta });\n const nextPath = [...transition.path, nextPosition];\n\n // Check resizing below min size.\n const layout = transition.layoutShift?.next ?? transition.itemsLayout;\n const layoutItem = layout.items.find((it) => it.id === transition.draggableItem.id);\n const minWidth = getMinColumnSpan(transition.draggableItem, transition.itemsLayout.columns);\n const minHeight = getMinRowSpan(transition.draggableItem);\n if (\n transition.operation === \"resize\" &&\n layoutItem &&\n (layoutItem.width + xDelta < minWidth || layoutItem.height + yDelta < minHeight)\n ) {\n return state;\n }\n\n try {\n const layoutShift = getLayoutShift(transition, nextPath);\n const nextTransition = { ...transition, layoutShift, path: nextPath };\n return {\n transition: nextTransition,\n removeTransition: null,\n announcement: createOperationAnnouncement(nextTransition, direction),\n };\n } catch {\n // Can't create next layout because the next path is out of bounds.\n return state;\n }\n };\n\n switch (direction) {\n case \"left\":\n return updateManualItemTransition(transition, !isRtl() ? \"left\" : \"right\");\n case \"right\":\n return updateManualItemTransition(transition, !isRtl() ? \"right\" : \"left\");\n case \"up\":\n return updateManualItemTransition(transition, \"up\");\n case \"down\":\n return updateManualItemTransition(transition, \"down\");\n }\n}\n\nfunction acquireTransitionItem<D>(\n state: TransitionState<D>,\n { position, layoutElement, acquiredItemElement }: AcquireItemAction,\n): TransitionState<D> {\n const { transition } = state;\n\n if (!transition) {\n return { transition: null, removeTransition: null, announcement: null };\n }\n\n const { columns } = transition.itemsLayout;\n\n const layoutRect = getLogicalBoundingClientRect(layoutElement);\n const itemRect = transition.draggableRect;\n const coordinatesX = itemRect.left - layoutRect.insetInlineStart;\n const offset = new Coordinates({ x: coordinatesX, y: itemRect.top - layoutRect.insetBlockStart });\n const insertionDirection = getInsertionDirection(offset);\n\n // Update original insertion position if the item can't fit into the layout by width.\n const width = getDefaultColumnSpan(transition.draggableItem, columns);\n position = new Position({ x: Math.min(columns - width, position.x), y: position.y });\n\n const path = [...transition.path, position];\n\n const layoutShift = getLayoutShift(transition, path, insertionDirection);\n\n // The columnOffset, columnSpan and rowSpan are of no use as of being overridden by the layout shift.\n const acquiredItem = { ...transition.draggableItem, columnOffset: 0, columnSpan: 1, rowSpan: 1 };\n\n const nextTransition: Transition<D> = {\n ...transition,\n collisionIds: new Set(),\n layoutShift,\n path,\n acquiredItem,\n acquiredItemElement,\n };\n return {\n transition: nextTransition,\n removeTransition: null,\n announcement: createOperationAnnouncement(nextTransition, null),\n };\n}\n"]}
|
package/internal/environment.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "board-components";
|
|
2
|
-
export var PACKAGE_VERSION = "3.0.0 (
|
|
2
|
+
export var PACKAGE_VERSION = "3.0.0 (80bebb14)";
|
|
3
3
|
export var THEME = "open-source-visual-refresh";
|
|
4
4
|
export var ALWAYS_VISUAL_REFRESH = true;
|
|
5
5
|
export var SYSTEM = "core";
|
|
@@ -325,6 +325,7 @@ export const colorBackgroundInputDefault: string;
|
|
|
325
325
|
export const colorBackgroundInputDisabled: string;
|
|
326
326
|
export const colorBackgroundItemSelected: string;
|
|
327
327
|
export const colorBackgroundLayoutMain: string;
|
|
328
|
+
export const colorBackgroundDrawer: string;
|
|
328
329
|
export const colorBackgroundLayoutMobilePanel: string;
|
|
329
330
|
export const colorBackgroundLayoutPanelContent: string;
|
|
330
331
|
export const colorBackgroundLayoutPanelHover: string;
|
|
@@ -325,6 +325,7 @@ export var colorBackgroundInputDefault = "var(--color-background-input-default-i
|
|
|
325
325
|
export var colorBackgroundInputDisabled = "var(--color-background-input-disabled-dihaja, #ebebf0)";
|
|
326
326
|
export var colorBackgroundItemSelected = "var(--color-background-item-selected-9gppru, #f0fbff)";
|
|
327
327
|
export var colorBackgroundLayoutMain = "var(--color-background-layout-main-5ilwcb, #ffffff)";
|
|
328
|
+
export var colorBackgroundDrawer = "var(--color-background-drawer-5hs0eh, #ffffff)";
|
|
328
329
|
export var colorBackgroundLayoutMobilePanel = "var(--color-background-layout-mobile-panel-ed0ava, #0f141a)";
|
|
329
330
|
export var colorBackgroundLayoutPanelContent = "var(--color-background-layout-panel-content-xto15e, #ffffff)";
|
|
330
331
|
export var colorBackgroundLayoutPanelHover = "var(--color-background-layout-panel-hover-tguulw, #ebebf0)";
|
|
@@ -1347,6 +1347,10 @@ module.exports.preset = {
|
|
|
1347
1347
|
"light": "{colorWhite}",
|
|
1348
1348
|
"dark": "{colorNeutral850}"
|
|
1349
1349
|
},
|
|
1350
|
+
"colorBackgroundDrawer": {
|
|
1351
|
+
"light": "{colorBackgroundLayoutPanelContent}",
|
|
1352
|
+
"dark": "{colorBackgroundLayoutPanelContent}"
|
|
1353
|
+
},
|
|
1350
1354
|
"colorBackgroundLayoutMobilePanel": {
|
|
1351
1355
|
"light": "{colorNeutral950}",
|
|
1352
1356
|
"dark": "{colorNeutral950}"
|
|
@@ -3921,6 +3925,10 @@ module.exports.preset = {
|
|
|
3921
3925
|
"light": "{colorNeutral850}",
|
|
3922
3926
|
"dark": "{colorNeutral850}"
|
|
3923
3927
|
},
|
|
3928
|
+
"colorBackgroundDrawer": {
|
|
3929
|
+
"light": "{colorBackgroundLayoutPanelContent}",
|
|
3930
|
+
"dark": "{colorBackgroundLayoutPanelContent}"
|
|
3931
|
+
},
|
|
3924
3932
|
"colorBackgroundLayoutMobilePanel": {
|
|
3925
3933
|
"light": "{colorNeutral950}",
|
|
3926
3934
|
"dark": "{colorNeutral950}"
|
|
@@ -5366,6 +5374,10 @@ module.exports.preset = {
|
|
|
5366
5374
|
"light": "{colorNeutral950}",
|
|
5367
5375
|
"dark": "{colorNeutral950}"
|
|
5368
5376
|
},
|
|
5377
|
+
"colorBackgroundDrawer": {
|
|
5378
|
+
"light": "{colorBackgroundLayoutPanelContent}",
|
|
5379
|
+
"dark": "{colorBackgroundLayoutPanelContent}"
|
|
5380
|
+
},
|
|
5369
5381
|
"colorBackgroundLayoutMobilePanel": {
|
|
5370
5382
|
"light": "{colorNeutral950}",
|
|
5371
5383
|
"dark": "{colorNeutral950}"
|
|
@@ -6739,6 +6751,10 @@ module.exports.preset = {
|
|
|
6739
6751
|
"light": "{colorWhite}",
|
|
6740
6752
|
"dark": "{colorNeutral850}"
|
|
6741
6753
|
},
|
|
6754
|
+
"colorBackgroundDrawer": {
|
|
6755
|
+
"light": "{colorBackgroundLayoutPanelContent}",
|
|
6756
|
+
"dark": "{colorBackgroundLayoutPanelContent}"
|
|
6757
|
+
},
|
|
6742
6758
|
"colorBackgroundLayoutMobilePanel": {
|
|
6743
6759
|
"light": "{colorNeutral950}",
|
|
6744
6760
|
"dark": "{colorNeutral950}"
|
|
@@ -7997,6 +8013,10 @@ module.exports.preset = {
|
|
|
7997
8013
|
"light": "{colorWhite}",
|
|
7998
8014
|
"dark": "{colorNeutral850}"
|
|
7999
8015
|
},
|
|
8016
|
+
"colorBackgroundDrawer": {
|
|
8017
|
+
"light": "{colorBackgroundLayoutPanelContent}",
|
|
8018
|
+
"dark": "{colorBackgroundLayoutPanelContent}"
|
|
8019
|
+
},
|
|
8000
8020
|
"colorBackgroundLayoutMobilePanel": {
|
|
8001
8021
|
"light": "{colorNeutral950}",
|
|
8002
8022
|
"dark": "{colorNeutral950}"
|
|
@@ -9255,6 +9275,10 @@ module.exports.preset = {
|
|
|
9255
9275
|
"light": "{colorWhite}",
|
|
9256
9276
|
"dark": "{colorNeutral850}"
|
|
9257
9277
|
},
|
|
9278
|
+
"colorBackgroundDrawer": {
|
|
9279
|
+
"light": "{colorBackgroundLayoutPanelContent}",
|
|
9280
|
+
"dark": "{colorBackgroundLayoutPanelContent}"
|
|
9281
|
+
},
|
|
9258
9282
|
"colorBackgroundLayoutMobilePanel": {
|
|
9259
9283
|
"light": "{colorNeutral950}",
|
|
9260
9284
|
"dark": "{colorNeutral950}"
|
|
@@ -10515,6 +10539,10 @@ module.exports.preset = {
|
|
|
10515
10539
|
"light": "{colorNeutral850}",
|
|
10516
10540
|
"dark": "{colorNeutral850}"
|
|
10517
10541
|
},
|
|
10542
|
+
"colorBackgroundDrawer": {
|
|
10543
|
+
"light": "{colorBackgroundLayoutPanelContent}",
|
|
10544
|
+
"dark": "{colorBackgroundLayoutPanelContent}"
|
|
10545
|
+
},
|
|
10518
10546
|
"colorBackgroundLayoutMobilePanel": {
|
|
10519
10547
|
"light": "{colorNeutral950}",
|
|
10520
10548
|
"dark": "{colorNeutral950}"
|
|
@@ -11884,6 +11912,7 @@ module.exports.preset = {
|
|
|
11884
11912
|
"colorBackgroundInputDisabled": "color",
|
|
11885
11913
|
"colorBackgroundItemSelected": "color",
|
|
11886
11914
|
"colorBackgroundLayoutMain": "color",
|
|
11915
|
+
"colorBackgroundDrawer": "color",
|
|
11887
11916
|
"colorBackgroundLayoutMobilePanel": "color",
|
|
11888
11917
|
"colorBackgroundLayoutPanelContent": "color",
|
|
11889
11918
|
"colorBackgroundLayoutPanelHover": "color",
|
|
@@ -13664,6 +13693,7 @@ module.exports.preset = {
|
|
|
13664
13693
|
"colorBackgroundInputDisabled": "color-background-input-disabled",
|
|
13665
13694
|
"colorBackgroundItemSelected": "color-background-item-selected",
|
|
13666
13695
|
"colorBackgroundLayoutMain": "color-background-layout-main",
|
|
13696
|
+
"colorBackgroundDrawer": "color-background-drawer",
|
|
13667
13697
|
"colorBackgroundLayoutMobilePanel": "color-background-layout-mobile-panel",
|
|
13668
13698
|
"colorBackgroundLayoutPanelContent": "color-background-layout-panel-content",
|
|
13669
13699
|
"colorBackgroundLayoutPanelHover": "color-background-layout-panel-hover",
|
|
@@ -14554,6 +14584,7 @@ module.exports.preset = {
|
|
|
14554
14584
|
"colorBackgroundInputDisabled": "--color-background-input-disabled-dihaja",
|
|
14555
14585
|
"colorBackgroundItemSelected": "--color-background-item-selected-9gppru",
|
|
14556
14586
|
"colorBackgroundLayoutMain": "--color-background-layout-main-5ilwcb",
|
|
14587
|
+
"colorBackgroundDrawer": "--color-background-drawer-5hs0eh",
|
|
14557
14588
|
"colorBackgroundLayoutMobilePanel": "--color-background-layout-mobile-panel-ed0ava",
|
|
14558
14589
|
"colorBackgroundLayoutPanelContent": "--color-background-layout-panel-content-xto15e",
|
|
14559
14590
|
"colorBackgroundLayoutPanelHover": "--color-background-layout-panel-hover-tguulw",
|
|
@@ -1347,6 +1347,10 @@ export var preset = {
|
|
|
1347
1347
|
"light": "{colorWhite}",
|
|
1348
1348
|
"dark": "{colorNeutral850}"
|
|
1349
1349
|
},
|
|
1350
|
+
"colorBackgroundDrawer": {
|
|
1351
|
+
"light": "{colorBackgroundLayoutPanelContent}",
|
|
1352
|
+
"dark": "{colorBackgroundLayoutPanelContent}"
|
|
1353
|
+
},
|
|
1350
1354
|
"colorBackgroundLayoutMobilePanel": {
|
|
1351
1355
|
"light": "{colorNeutral950}",
|
|
1352
1356
|
"dark": "{colorNeutral950}"
|
|
@@ -3921,6 +3925,10 @@ export var preset = {
|
|
|
3921
3925
|
"light": "{colorNeutral850}",
|
|
3922
3926
|
"dark": "{colorNeutral850}"
|
|
3923
3927
|
},
|
|
3928
|
+
"colorBackgroundDrawer": {
|
|
3929
|
+
"light": "{colorBackgroundLayoutPanelContent}",
|
|
3930
|
+
"dark": "{colorBackgroundLayoutPanelContent}"
|
|
3931
|
+
},
|
|
3924
3932
|
"colorBackgroundLayoutMobilePanel": {
|
|
3925
3933
|
"light": "{colorNeutral950}",
|
|
3926
3934
|
"dark": "{colorNeutral950}"
|
|
@@ -5366,6 +5374,10 @@ export var preset = {
|
|
|
5366
5374
|
"light": "{colorNeutral950}",
|
|
5367
5375
|
"dark": "{colorNeutral950}"
|
|
5368
5376
|
},
|
|
5377
|
+
"colorBackgroundDrawer": {
|
|
5378
|
+
"light": "{colorBackgroundLayoutPanelContent}",
|
|
5379
|
+
"dark": "{colorBackgroundLayoutPanelContent}"
|
|
5380
|
+
},
|
|
5369
5381
|
"colorBackgroundLayoutMobilePanel": {
|
|
5370
5382
|
"light": "{colorNeutral950}",
|
|
5371
5383
|
"dark": "{colorNeutral950}"
|
|
@@ -6739,6 +6751,10 @@ export var preset = {
|
|
|
6739
6751
|
"light": "{colorWhite}",
|
|
6740
6752
|
"dark": "{colorNeutral850}"
|
|
6741
6753
|
},
|
|
6754
|
+
"colorBackgroundDrawer": {
|
|
6755
|
+
"light": "{colorBackgroundLayoutPanelContent}",
|
|
6756
|
+
"dark": "{colorBackgroundLayoutPanelContent}"
|
|
6757
|
+
},
|
|
6742
6758
|
"colorBackgroundLayoutMobilePanel": {
|
|
6743
6759
|
"light": "{colorNeutral950}",
|
|
6744
6760
|
"dark": "{colorNeutral950}"
|
|
@@ -7997,6 +8013,10 @@ export var preset = {
|
|
|
7997
8013
|
"light": "{colorWhite}",
|
|
7998
8014
|
"dark": "{colorNeutral850}"
|
|
7999
8015
|
},
|
|
8016
|
+
"colorBackgroundDrawer": {
|
|
8017
|
+
"light": "{colorBackgroundLayoutPanelContent}",
|
|
8018
|
+
"dark": "{colorBackgroundLayoutPanelContent}"
|
|
8019
|
+
},
|
|
8000
8020
|
"colorBackgroundLayoutMobilePanel": {
|
|
8001
8021
|
"light": "{colorNeutral950}",
|
|
8002
8022
|
"dark": "{colorNeutral950}"
|
|
@@ -9255,6 +9275,10 @@ export var preset = {
|
|
|
9255
9275
|
"light": "{colorWhite}",
|
|
9256
9276
|
"dark": "{colorNeutral850}"
|
|
9257
9277
|
},
|
|
9278
|
+
"colorBackgroundDrawer": {
|
|
9279
|
+
"light": "{colorBackgroundLayoutPanelContent}",
|
|
9280
|
+
"dark": "{colorBackgroundLayoutPanelContent}"
|
|
9281
|
+
},
|
|
9258
9282
|
"colorBackgroundLayoutMobilePanel": {
|
|
9259
9283
|
"light": "{colorNeutral950}",
|
|
9260
9284
|
"dark": "{colorNeutral950}"
|
|
@@ -10515,6 +10539,10 @@ export var preset = {
|
|
|
10515
10539
|
"light": "{colorNeutral850}",
|
|
10516
10540
|
"dark": "{colorNeutral850}"
|
|
10517
10541
|
},
|
|
10542
|
+
"colorBackgroundDrawer": {
|
|
10543
|
+
"light": "{colorBackgroundLayoutPanelContent}",
|
|
10544
|
+
"dark": "{colorBackgroundLayoutPanelContent}"
|
|
10545
|
+
},
|
|
10518
10546
|
"colorBackgroundLayoutMobilePanel": {
|
|
10519
10547
|
"light": "{colorNeutral950}",
|
|
10520
10548
|
"dark": "{colorNeutral950}"
|
|
@@ -11884,6 +11912,7 @@ export var preset = {
|
|
|
11884
11912
|
"colorBackgroundInputDisabled": "color",
|
|
11885
11913
|
"colorBackgroundItemSelected": "color",
|
|
11886
11914
|
"colorBackgroundLayoutMain": "color",
|
|
11915
|
+
"colorBackgroundDrawer": "color",
|
|
11887
11916
|
"colorBackgroundLayoutMobilePanel": "color",
|
|
11888
11917
|
"colorBackgroundLayoutPanelContent": "color",
|
|
11889
11918
|
"colorBackgroundLayoutPanelHover": "color",
|
|
@@ -13664,6 +13693,7 @@ export var preset = {
|
|
|
13664
13693
|
"colorBackgroundInputDisabled": "color-background-input-disabled",
|
|
13665
13694
|
"colorBackgroundItemSelected": "color-background-item-selected",
|
|
13666
13695
|
"colorBackgroundLayoutMain": "color-background-layout-main",
|
|
13696
|
+
"colorBackgroundDrawer": "color-background-drawer",
|
|
13667
13697
|
"colorBackgroundLayoutMobilePanel": "color-background-layout-mobile-panel",
|
|
13668
13698
|
"colorBackgroundLayoutPanelContent": "color-background-layout-panel-content",
|
|
13669
13699
|
"colorBackgroundLayoutPanelHover": "color-background-layout-panel-hover",
|
|
@@ -14554,6 +14584,7 @@ export var preset = {
|
|
|
14554
14584
|
"colorBackgroundInputDisabled": "--color-background-input-disabled-dihaja",
|
|
14555
14585
|
"colorBackgroundItemSelected": "--color-background-item-selected-9gppru",
|
|
14556
14586
|
"colorBackgroundLayoutMain": "--color-background-layout-main-5ilwcb",
|
|
14587
|
+
"colorBackgroundDrawer": "--color-background-drawer-5hs0eh",
|
|
14557
14588
|
"colorBackgroundLayoutMobilePanel": "--color-background-layout-mobile-panel-ed0ava",
|
|
14558
14589
|
"colorBackgroundLayoutPanelContent": "--color-background-layout-panel-content-xto15e",
|
|
14559
14590
|
"colorBackgroundLayoutPanelHover": "--color-background-layout-panel-hover-tguulw",
|
package/internal/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudscape-design/board-components",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.171",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/cloudscape-design/board-components.git"
|
|
@@ -34,31 +34,34 @@
|
|
|
34
34
|
"@cloudscape-design/global-styles": "^1.0.1",
|
|
35
35
|
"@cloudscape-design/test-utils-converter": "^1.0.0",
|
|
36
36
|
"@cloudscape-design/theming-build": "^1",
|
|
37
|
+
"@eslint/compat": "^1.4.1",
|
|
38
|
+
"@eslint/js": "^9.39.4",
|
|
37
39
|
"@juggle/resize-observer": "^3.4.0",
|
|
38
40
|
"@testing-library/jest-dom": "^5.16.5",
|
|
39
41
|
"@testing-library/react": "^13.4.0",
|
|
40
|
-
"@tony.ganchev/eslint-plugin-header": "^3.3
|
|
42
|
+
"@tony.ganchev/eslint-plugin-header": "^3.4.3",
|
|
41
43
|
"@types/jest-image-snapshot": "^6.1.0",
|
|
42
44
|
"@types/lodash": "^4.14.191",
|
|
43
45
|
"@types/node": "^18.19.4",
|
|
44
46
|
"@types/react": "^18.0.26",
|
|
45
47
|
"@types/react-dom": "^18.0.10",
|
|
46
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
47
|
-
"@typescript-eslint/parser": "^
|
|
48
|
+
"@typescript-eslint/eslint-plugin": "^8.58.1",
|
|
49
|
+
"@typescript-eslint/parser": "^8.58.1",
|
|
48
50
|
"@vitejs/plugin-react": "^4.7.0",
|
|
49
51
|
"@vitest/coverage-v8": "^3.2.4",
|
|
50
52
|
"chokidar-cli": "^3.0.0",
|
|
51
53
|
"deep-freeze-es6": "^1.4.1",
|
|
52
|
-
"eslint": "^
|
|
54
|
+
"eslint": "^9.39.4",
|
|
53
55
|
"eslint-config-prettier": "^9.1.0",
|
|
54
56
|
"eslint-plugin-import": "^2.26.0",
|
|
55
|
-
"eslint-plugin-no-unsanitized": "^4.
|
|
56
|
-
"eslint-plugin-prettier": "^5.
|
|
57
|
-
"eslint-plugin-react": "^7.
|
|
58
|
-
"eslint-plugin-react-hooks": "^
|
|
57
|
+
"eslint-plugin-no-unsanitized": "^4.1.5",
|
|
58
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
59
|
+
"eslint-plugin-react": "^7.37.5",
|
|
60
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
59
61
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
60
|
-
"eslint-plugin-unicorn": "^
|
|
62
|
+
"eslint-plugin-unicorn": "^60.0.0",
|
|
61
63
|
"execa": "^6.1.0",
|
|
64
|
+
"globals": "^16.5.0",
|
|
62
65
|
"globby": "^13.1.3",
|
|
63
66
|
"husky": "^8.0.3",
|
|
64
67
|
"jest-image-snapshot": "^6.1.0",
|
|
@@ -76,6 +79,7 @@
|
|
|
76
79
|
"stylelint-config-recommended-scss": "^14.1.0",
|
|
77
80
|
"stylelint-prettier": "^5.0.2",
|
|
78
81
|
"typescript": "^4.9.4",
|
|
82
|
+
"typescript-eslint": "^8.58.1",
|
|
79
83
|
"vite": "^6.4.1",
|
|
80
84
|
"vitest": "^3.2.4"
|
|
81
85
|
},
|