Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: components.js
});
[12000] Fix | Delete
}
[12001] Fix | Delete
[12002] Fix | Delete
return nextState;
[12003] Fix | Delete
}
[12004] Fix | Delete
[12005] Fix | Delete
case "unregisterItem":
[12006] Fix | Delete
{
[12007] Fix | Delete
var _id2 = action.id;
[12008] Fix | Delete
var nextItems = items.filter(function (item) {
[12009] Fix | Delete
return item.id !== _id2;
[12010] Fix | Delete
}); // The item isn't registered, so do nothing
[12011] Fix | Delete
[12012] Fix | Delete
if (nextItems.length === items.length) {
[12013] Fix | Delete
return state;
[12014] Fix | Delete
} // Filters out the item that is being removed from the pastIds list
[12015] Fix | Delete
[12016] Fix | Delete
[12017] Fix | Delete
var nextPastIds = pastIds.filter(function (pastId) {
[12018] Fix | Delete
return pastId !== _id2;
[12019] Fix | Delete
});
[12020] Fix | Delete
[12021] Fix | Delete
var _nextState = Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12022] Fix | Delete
pastIds: nextPastIds,
[12023] Fix | Delete
items: nextItems
[12024] Fix | Delete
}); // If the current item is the item that is being removed, focus pastId
[12025] Fix | Delete
[12026] Fix | Delete
[12027] Fix | Delete
if (currentId && currentId === _id2) {
[12028] Fix | Delete
var nextId = includesBaseElement ? null : Object(getCurrentId_5aa9849e["b" /* g */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState), {}, {
[12029] Fix | Delete
currentId: nextPastIds[0]
[12030] Fix | Delete
}));
[12031] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState), {}, {
[12032] Fix | Delete
currentId: nextId
[12033] Fix | Delete
});
[12034] Fix | Delete
}
[12035] Fix | Delete
[12036] Fix | Delete
return _nextState;
[12037] Fix | Delete
}
[12038] Fix | Delete
[12039] Fix | Delete
case "move":
[12040] Fix | Delete
{
[12041] Fix | Delete
var _id3 = action.id; // move() does nothing
[12042] Fix | Delete
[12043] Fix | Delete
if (_id3 === undefined) {
[12044] Fix | Delete
return state;
[12045] Fix | Delete
} // Removes the current item and the item that is receiving focus from the
[12046] Fix | Delete
// pastIds list
[12047] Fix | Delete
[12048] Fix | Delete
[12049] Fix | Delete
var filteredPastIds = pastIds.filter(function (pastId) {
[12050] Fix | Delete
return pastId !== currentId && pastId !== _id3;
[12051] Fix | Delete
}); // If there's a currentId, add it to the pastIds list so it can be focused
[12052] Fix | Delete
// if the new item gets removed or disabled
[12053] Fix | Delete
[12054] Fix | Delete
var _nextPastIds = currentId ? [currentId].concat(filteredPastIds) : filteredPastIds;
[12055] Fix | Delete
[12056] Fix | Delete
var _nextState2 = Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12057] Fix | Delete
pastIds: _nextPastIds
[12058] Fix | Delete
}); // move(null) will focus the composite element itself, not an item
[12059] Fix | Delete
[12060] Fix | Delete
[12061] Fix | Delete
if (_id3 === null) {
[12062] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState2), {}, {
[12063] Fix | Delete
unstable_moves: moves + 1,
[12064] Fix | Delete
currentId: Object(getCurrentId_5aa9849e["b" /* g */])(_nextState2, _id3)
[12065] Fix | Delete
});
[12066] Fix | Delete
}
[12067] Fix | Delete
[12068] Fix | Delete
var _item2 = findEnabledItemById(items, _id3);
[12069] Fix | Delete
[12070] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState2), {}, {
[12071] Fix | Delete
unstable_moves: _item2 ? moves + 1 : moves,
[12072] Fix | Delete
currentId: Object(getCurrentId_5aa9849e["b" /* g */])(_nextState2, _item2 === null || _item2 === void 0 ? void 0 : _item2.id)
[12073] Fix | Delete
});
[12074] Fix | Delete
}
[12075] Fix | Delete
[12076] Fix | Delete
case "next":
[12077] Fix | Delete
{
[12078] Fix | Delete
// If there's no item focused, we just move the first one
[12079] Fix | Delete
if (currentId == null) {
[12080] Fix | Delete
return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
[12081] Fix | Delete
type: "first"
[12082] Fix | Delete
}));
[12083] Fix | Delete
} // RTL doesn't make sense on vertical navigation
[12084] Fix | Delete
[12085] Fix | Delete
[12086] Fix | Delete
var isHorizontal = orientation !== "vertical";
[12087] Fix | Delete
var isRTL = rtl && isHorizontal;
[12088] Fix | Delete
var allItems = isRTL ? reverse(items) : items;
[12089] Fix | Delete
var currentItem = allItems.find(function (item) {
[12090] Fix | Delete
return item.id === currentId;
[12091] Fix | Delete
}); // If there's no item focused, we just move the first one
[12092] Fix | Delete
[12093] Fix | Delete
if (!currentItem) {
[12094] Fix | Delete
return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
[12095] Fix | Delete
type: "first"
[12096] Fix | Delete
}));
[12097] Fix | Delete
}
[12098] Fix | Delete
[12099] Fix | Delete
var isGrid = !!currentItem.groupId;
[12100] Fix | Delete
var currentIndex = allItems.indexOf(currentItem);
[12101] Fix | Delete
[12102] Fix | Delete
var _nextItems = allItems.slice(currentIndex + 1);
[12103] Fix | Delete
[12104] Fix | Delete
var nextItemsInGroup = getItemsInGroup(_nextItems, currentItem.groupId); // Home, End
[12105] Fix | Delete
[12106] Fix | Delete
if (action.allTheWay) {
[12107] Fix | Delete
// We reverse so we can get the last enabled item in the group. If it's
[12108] Fix | Delete
// RTL, nextItems and nextItemsInGroup are already reversed and don't
[12109] Fix | Delete
// have the items before the current one anymore. So we have to get
[12110] Fix | Delete
// items in group again with allItems.
[12111] Fix | Delete
var _nextItem2 = Object(getCurrentId_5aa9849e["a" /* f */])(isRTL ? getItemsInGroup(allItems, currentItem.groupId) : reverse(nextItemsInGroup));
[12112] Fix | Delete
[12113] Fix | Delete
return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
[12114] Fix | Delete
type: "move",
[12115] Fix | Delete
id: _nextItem2 === null || _nextItem2 === void 0 ? void 0 : _nextItem2.id
[12116] Fix | Delete
}));
[12117] Fix | Delete
}
[12118] Fix | Delete
[12119] Fix | Delete
var oppositeOrientation = getOppositeOrientation( // If it's a grid and orientation is not set, it's a next/previous
[12120] Fix | Delete
// call, which is inherently horizontal. up/down will call next with
[12121] Fix | Delete
// orientation set to vertical by default (see below on up/down cases).
[12122] Fix | Delete
isGrid ? orientation || "horizontal" : orientation);
[12123] Fix | Delete
var canLoop = loop && loop !== oppositeOrientation;
[12124] Fix | Delete
var canWrap = isGrid && wrap && wrap !== oppositeOrientation;
[12125] Fix | Delete
var hasNullItem = // `previous` and `up` will set action.hasNullItem, but when calling
[12126] Fix | Delete
// next directly, hasNullItem will only be true if it's not a grid and
[12127] Fix | Delete
// loop is set to true, which means that pressing right or down keys on
[12128] Fix | Delete
// grids will never focus the composite element. On one-dimensional
[12129] Fix | Delete
// composites that don't loop, pressing right or down keys also doesn't
[12130] Fix | Delete
// focus the composite element.
[12131] Fix | Delete
action.hasNullItem || !isGrid && canLoop && includesBaseElement;
[12132] Fix | Delete
[12133] Fix | Delete
if (canLoop) {
[12134] Fix | Delete
var loopItems = canWrap && !hasNullItem ? allItems : getItemsInGroup(allItems, currentItem.groupId); // Turns [0, 1, current, 3, 4] into [3, 4, 0, 1]
[12135] Fix | Delete
[12136] Fix | Delete
var sortedItems = placeItemsAfter(loopItems, currentId, hasNullItem);
[12137] Fix | Delete
[12138] Fix | Delete
var _nextItem3 = Object(getCurrentId_5aa9849e["a" /* f */])(sortedItems, currentId);
[12139] Fix | Delete
[12140] Fix | Delete
return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
[12141] Fix | Delete
type: "move",
[12142] Fix | Delete
id: _nextItem3 === null || _nextItem3 === void 0 ? void 0 : _nextItem3.id
[12143] Fix | Delete
}));
[12144] Fix | Delete
}
[12145] Fix | Delete
[12146] Fix | Delete
if (canWrap) {
[12147] Fix | Delete
var _nextItem4 = Object(getCurrentId_5aa9849e["a" /* f */])( // We can use nextItems, which contains all the next items, including
[12148] Fix | Delete
// items from other groups, to wrap between groups. However, if there
[12149] Fix | Delete
// is a null item (the composite element), we'll only use the next
[12150] Fix | Delete
// items in the group. So moving next from the last item will focus
[12151] Fix | Delete
// the composite element (null). On grid composites, horizontal
[12152] Fix | Delete
// navigation never focuses the composite element, only vertical.
[12153] Fix | Delete
hasNullItem ? nextItemsInGroup : _nextItems, currentId);
[12154] Fix | Delete
[12155] Fix | Delete
var _nextId = hasNullItem ? (_nextItem4 === null || _nextItem4 === void 0 ? void 0 : _nextItem4.id) || null : _nextItem4 === null || _nextItem4 === void 0 ? void 0 : _nextItem4.id;
[12156] Fix | Delete
[12157] Fix | Delete
return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
[12158] Fix | Delete
type: "move",
[12159] Fix | Delete
id: _nextId
[12160] Fix | Delete
}));
[12161] Fix | Delete
}
[12162] Fix | Delete
[12163] Fix | Delete
var _nextItem = Object(getCurrentId_5aa9849e["a" /* f */])(nextItemsInGroup, currentId);
[12164] Fix | Delete
[12165] Fix | Delete
if (!_nextItem && hasNullItem) {
[12166] Fix | Delete
return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
[12167] Fix | Delete
type: "move",
[12168] Fix | Delete
id: null
[12169] Fix | Delete
}));
[12170] Fix | Delete
}
[12171] Fix | Delete
[12172] Fix | Delete
return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
[12173] Fix | Delete
type: "move",
[12174] Fix | Delete
id: _nextItem === null || _nextItem === void 0 ? void 0 : _nextItem.id
[12175] Fix | Delete
}));
[12176] Fix | Delete
}
[12177] Fix | Delete
[12178] Fix | Delete
case "previous":
[12179] Fix | Delete
{
[12180] Fix | Delete
// If currentId is initially set to null, the composite element will be
[12181] Fix | Delete
// focusable while navigating with arrow keys. But, if it's a grid, we
[12182] Fix | Delete
// don't want to focus the composite element with horizontal navigation.
[12183] Fix | Delete
var _isGrid = !!groups.length;
[12184] Fix | Delete
[12185] Fix | Delete
var _hasNullItem = !_isGrid && includesBaseElement;
[12186] Fix | Delete
[12187] Fix | Delete
var _nextState3 = CompositeState_reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12188] Fix | Delete
items: reverse(items)
[12189] Fix | Delete
}), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
[12190] Fix | Delete
type: "next",
[12191] Fix | Delete
hasNullItem: _hasNullItem
[12192] Fix | Delete
}));
[12193] Fix | Delete
[12194] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState3), {}, {
[12195] Fix | Delete
items: items
[12196] Fix | Delete
});
[12197] Fix | Delete
}
[12198] Fix | Delete
[12199] Fix | Delete
case "down":
[12200] Fix | Delete
{
[12201] Fix | Delete
var shouldShift = shift && !action.allTheWay; // First, we make sure groups have the same number of items by filling it
[12202] Fix | Delete
// with disabled fake items. Then, we reorganize the items list so
[12203] Fix | Delete
// [1-1, 1-2, 2-1, 2-2] becomes [1-1, 2-1, 1-2, 2-2].
[12204] Fix | Delete
[12205] Fix | Delete
var verticalItems = verticalizeItems(flatten(fillGroups(groupItems(items), currentId, shouldShift)));
[12206] Fix | Delete
[12207] Fix | Delete
var _canLoop = loop && loop !== "horizontal"; // Pressing down arrow key will only focus the composite element if loop
[12208] Fix | Delete
// is true or vertical.
[12209] Fix | Delete
[12210] Fix | Delete
[12211] Fix | Delete
var _hasNullItem2 = _canLoop && includesBaseElement;
[12212] Fix | Delete
[12213] Fix | Delete
var _nextState4 = CompositeState_reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12214] Fix | Delete
orientation: "vertical",
[12215] Fix | Delete
items: verticalItems
[12216] Fix | Delete
}), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
[12217] Fix | Delete
type: "next",
[12218] Fix | Delete
hasNullItem: _hasNullItem2
[12219] Fix | Delete
}));
[12220] Fix | Delete
[12221] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState4), {}, {
[12222] Fix | Delete
orientation: orientation,
[12223] Fix | Delete
items: items
[12224] Fix | Delete
});
[12225] Fix | Delete
}
[12226] Fix | Delete
[12227] Fix | Delete
case "up":
[12228] Fix | Delete
{
[12229] Fix | Delete
var _shouldShift = shift && !action.allTheWay;
[12230] Fix | Delete
[12231] Fix | Delete
var _verticalItems = verticalizeItems(reverse(flatten(fillGroups(groupItems(items), currentId, _shouldShift)))); // If currentId is initially set to null, we'll always focus the
[12232] Fix | Delete
// composite element when the up arrow key is pressed in the first row.
[12233] Fix | Delete
[12234] Fix | Delete
[12235] Fix | Delete
var _hasNullItem3 = includesBaseElement;
[12236] Fix | Delete
[12237] Fix | Delete
var _nextState5 = CompositeState_reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12238] Fix | Delete
orientation: "vertical",
[12239] Fix | Delete
items: _verticalItems
[12240] Fix | Delete
}), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
[12241] Fix | Delete
type: "next",
[12242] Fix | Delete
hasNullItem: _hasNullItem3
[12243] Fix | Delete
}));
[12244] Fix | Delete
[12245] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState5), {}, {
[12246] Fix | Delete
orientation: orientation,
[12247] Fix | Delete
items: items
[12248] Fix | Delete
});
[12249] Fix | Delete
}
[12250] Fix | Delete
[12251] Fix | Delete
case "first":
[12252] Fix | Delete
{
[12253] Fix | Delete
var firstItem = Object(getCurrentId_5aa9849e["a" /* f */])(items);
[12254] Fix | Delete
return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
[12255] Fix | Delete
type: "move",
[12256] Fix | Delete
id: firstItem === null || firstItem === void 0 ? void 0 : firstItem.id
[12257] Fix | Delete
}));
[12258] Fix | Delete
}
[12259] Fix | Delete
[12260] Fix | Delete
case "last":
[12261] Fix | Delete
{
[12262] Fix | Delete
var _nextState6 = CompositeState_reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12263] Fix | Delete
items: reverse(items)
[12264] Fix | Delete
}), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
[12265] Fix | Delete
type: "first"
[12266] Fix | Delete
}));
[12267] Fix | Delete
[12268] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState6), {}, {
[12269] Fix | Delete
items: items
[12270] Fix | Delete
});
[12271] Fix | Delete
}
[12272] Fix | Delete
[12273] Fix | Delete
case "sort":
[12274] Fix | Delete
{
[12275] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12276] Fix | Delete
items: sortBasedOnDOMPosition(items),
[12277] Fix | Delete
groups: sortBasedOnDOMPosition(groups)
[12278] Fix | Delete
});
[12279] Fix | Delete
}
[12280] Fix | Delete
[12281] Fix | Delete
case "setVirtual":
[12282] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12283] Fix | Delete
unstable_virtual: applyState(action.virtual, virtual)
[12284] Fix | Delete
});
[12285] Fix | Delete
[12286] Fix | Delete
case "setRTL":
[12287] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12288] Fix | Delete
rtl: applyState(action.rtl, rtl)
[12289] Fix | Delete
});
[12290] Fix | Delete
[12291] Fix | Delete
case "setOrientation":
[12292] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12293] Fix | Delete
orientation: applyState(action.orientation, orientation)
[12294] Fix | Delete
});
[12295] Fix | Delete
[12296] Fix | Delete
case "setCurrentId":
[12297] Fix | Delete
{
[12298] Fix | Delete
var nextCurrentId = Object(getCurrentId_5aa9849e["b" /* g */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12299] Fix | Delete
currentId: applyState(action.currentId, currentId)
[12300] Fix | Delete
}));
[12301] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12302] Fix | Delete
currentId: nextCurrentId,
[12303] Fix | Delete
hasSetCurrentId: true
[12304] Fix | Delete
});
[12305] Fix | Delete
}
[12306] Fix | Delete
[12307] Fix | Delete
case "setLoop":
[12308] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12309] Fix | Delete
loop: applyState(action.loop, loop)
[12310] Fix | Delete
});
[12311] Fix | Delete
[12312] Fix | Delete
case "setWrap":
[12313] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12314] Fix | Delete
wrap: applyState(action.wrap, wrap)
[12315] Fix | Delete
});
[12316] Fix | Delete
[12317] Fix | Delete
case "setShift":
[12318] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12319] Fix | Delete
shift: applyState(action.shift, shift)
[12320] Fix | Delete
});
[12321] Fix | Delete
[12322] Fix | Delete
case "setIncludesBaseElement":
[12323] Fix | Delete
{
[12324] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12325] Fix | Delete
unstable_includesBaseElement: applyState(action.includesBaseElement, includesBaseElement)
[12326] Fix | Delete
});
[12327] Fix | Delete
}
[12328] Fix | Delete
[12329] Fix | Delete
case "reset":
[12330] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12331] Fix | Delete
unstable_virtual: initialVirtual,
[12332] Fix | Delete
rtl: initialRTL,
[12333] Fix | Delete
orientation: initialOrientation,
[12334] Fix | Delete
currentId: Object(getCurrentId_5aa9849e["b" /* g */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12335] Fix | Delete
currentId: initialCurrentId
[12336] Fix | Delete
})),
[12337] Fix | Delete
loop: initialLoop,
[12338] Fix | Delete
wrap: initialWrap,
[12339] Fix | Delete
shift: initialShift,
[12340] Fix | Delete
unstable_moves: 0,
[12341] Fix | Delete
pastIds: []
[12342] Fix | Delete
});
[12343] Fix | Delete
[12344] Fix | Delete
case "setItems":
[12345] Fix | Delete
{
[12346] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
[12347] Fix | Delete
items: action.items
[12348] Fix | Delete
});
[12349] Fix | Delete
}
[12350] Fix | Delete
[12351] Fix | Delete
default:
[12352] Fix | Delete
throw new Error();
[12353] Fix | Delete
}
[12354] Fix | Delete
}
[12355] Fix | Delete
[12356] Fix | Delete
function useAction(fn) {
[12357] Fix | Delete
return Object(external_React_["useCallback"])(fn, []);
[12358] Fix | Delete
}
[12359] Fix | Delete
[12360] Fix | Delete
function useIsUnmountedRef() {
[12361] Fix | Delete
var isUnmountedRef = Object(external_React_["useRef"])(false);
[12362] Fix | Delete
Object(useIsomorphicEffect["a" /* useIsomorphicEffect */])(function () {
[12363] Fix | Delete
return function () {
[12364] Fix | Delete
isUnmountedRef.current = true;
[12365] Fix | Delete
};
[12366] Fix | Delete
}, []);
[12367] Fix | Delete
return isUnmountedRef;
[12368] Fix | Delete
}
[12369] Fix | Delete
[12370] Fix | Delete
function useCompositeState(initialState) {
[12371] Fix | Delete
if (initialState === void 0) {
[12372] Fix | Delete
initialState = {};
[12373] Fix | Delete
}
[12374] Fix | Delete
[12375] Fix | Delete
var _useSealedState = useSealedState(initialState),
[12376] Fix | Delete
_useSealedState$unsta = _useSealedState.unstable_virtual,
[12377] Fix | Delete
virtual = _useSealedState$unsta === void 0 ? false : _useSealedState$unsta,
[12378] Fix | Delete
_useSealedState$rtl = _useSealedState.rtl,
[12379] Fix | Delete
rtl = _useSealedState$rtl === void 0 ? false : _useSealedState$rtl,
[12380] Fix | Delete
orientation = _useSealedState.orientation,
[12381] Fix | Delete
currentId = _useSealedState.currentId,
[12382] Fix | Delete
_useSealedState$loop = _useSealedState.loop,
[12383] Fix | Delete
loop = _useSealedState$loop === void 0 ? false : _useSealedState$loop,
[12384] Fix | Delete
_useSealedState$wrap = _useSealedState.wrap,
[12385] Fix | Delete
wrap = _useSealedState$wrap === void 0 ? false : _useSealedState$wrap,
[12386] Fix | Delete
_useSealedState$shift = _useSealedState.shift,
[12387] Fix | Delete
shift = _useSealedState$shift === void 0 ? false : _useSealedState$shift,
[12388] Fix | Delete
unstable_includesBaseElement = _useSealedState.unstable_includesBaseElement,
[12389] Fix | Delete
sealed = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_useSealedState, ["unstable_virtual", "rtl", "orientation", "currentId", "loop", "wrap", "shift", "unstable_includesBaseElement"]);
[12390] Fix | Delete
[12391] Fix | Delete
var idState = unstable_useIdState(sealed);
[12392] Fix | Delete
[12393] Fix | Delete
var _React$useReducer = Object(external_React_["useReducer"])(CompositeState_reducer, {
[12394] Fix | Delete
unstable_virtual: virtual,
[12395] Fix | Delete
rtl: rtl,
[12396] Fix | Delete
orientation: orientation,
[12397] Fix | Delete
items: [],
[12398] Fix | Delete
groups: [],
[12399] Fix | Delete
currentId: currentId,
[12400] Fix | Delete
loop: loop,
[12401] Fix | Delete
wrap: wrap,
[12402] Fix | Delete
shift: shift,
[12403] Fix | Delete
unstable_moves: 0,
[12404] Fix | Delete
pastIds: [],
[12405] Fix | Delete
unstable_includesBaseElement: unstable_includesBaseElement != null ? unstable_includesBaseElement : currentId === null,
[12406] Fix | Delete
initialVirtual: virtual,
[12407] Fix | Delete
initialRTL: rtl,
[12408] Fix | Delete
initialOrientation: orientation,
[12409] Fix | Delete
initialCurrentId: currentId,
[12410] Fix | Delete
initialLoop: loop,
[12411] Fix | Delete
initialWrap: wrap,
[12412] Fix | Delete
initialShift: shift
[12413] Fix | Delete
}),
[12414] Fix | Delete
_React$useReducer$ = _React$useReducer[0],
[12415] Fix | Delete
pastIds = _React$useReducer$.pastIds,
[12416] Fix | Delete
initialVirtual = _React$useReducer$.initialVirtual,
[12417] Fix | Delete
initialRTL = _React$useReducer$.initialRTL,
[12418] Fix | Delete
initialOrientation = _React$useReducer$.initialOrientation,
[12419] Fix | Delete
initialCurrentId = _React$useReducer$.initialCurrentId,
[12420] Fix | Delete
initialLoop = _React$useReducer$.initialLoop,
[12421] Fix | Delete
initialWrap = _React$useReducer$.initialWrap,
[12422] Fix | Delete
initialShift = _React$useReducer$.initialShift,
[12423] Fix | Delete
hasSetCurrentId = _React$useReducer$.hasSetCurrentId,
[12424] Fix | Delete
state = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_React$useReducer$, ["pastIds", "initialVirtual", "initialRTL", "initialOrientation", "initialCurrentId", "initialLoop", "initialWrap", "initialShift", "hasSetCurrentId"]),
[12425] Fix | Delete
dispatch = _React$useReducer[1];
[12426] Fix | Delete
[12427] Fix | Delete
var _React$useState = Object(external_React_["useState"])(false),
[12428] Fix | Delete
hasActiveWidget = _React$useState[0],
[12429] Fix | Delete
setHasActiveWidget = _React$useState[1]; // register/unregister may be called when this component is unmounted. We
[12430] Fix | Delete
// store the unmounted state here so we don't update the state if it's true.
[12431] Fix | Delete
// This only happens in a very specific situation.
[12432] Fix | Delete
// See https://github.com/reakit/reakit/issues/650
[12433] Fix | Delete
[12434] Fix | Delete
[12435] Fix | Delete
var isUnmountedRef = useIsUnmountedRef();
[12436] Fix | Delete
var setItems = Object(external_React_["useCallback"])(function (items) {
[12437] Fix | Delete
return dispatch({
[12438] Fix | Delete
type: "setItems",
[12439] Fix | Delete
items: items
[12440] Fix | Delete
});
[12441] Fix | Delete
}, []);
[12442] Fix | Delete
useSortBasedOnDOMPosition(state.items, setItems);
[12443] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, idState), state), {}, {
[12444] Fix | Delete
unstable_hasActiveWidget: hasActiveWidget,
[12445] Fix | Delete
unstable_setHasActiveWidget: setHasActiveWidget,
[12446] Fix | Delete
registerItem: useAction(function (item) {
[12447] Fix | Delete
if (isUnmountedRef.current) return;
[12448] Fix | Delete
dispatch({
[12449] Fix | Delete
type: "registerItem",
[12450] Fix | Delete
item: item
[12451] Fix | Delete
});
[12452] Fix | Delete
}),
[12453] Fix | Delete
unregisterItem: useAction(function (id) {
[12454] Fix | Delete
if (isUnmountedRef.current) return;
[12455] Fix | Delete
dispatch({
[12456] Fix | Delete
type: "unregisterItem",
[12457] Fix | Delete
id: id
[12458] Fix | Delete
});
[12459] Fix | Delete
}),
[12460] Fix | Delete
registerGroup: useAction(function (group) {
[12461] Fix | Delete
if (isUnmountedRef.current) return;
[12462] Fix | Delete
dispatch({
[12463] Fix | Delete
type: "registerGroup",
[12464] Fix | Delete
group: group
[12465] Fix | Delete
});
[12466] Fix | Delete
}),
[12467] Fix | Delete
unregisterGroup: useAction(function (id) {
[12468] Fix | Delete
if (isUnmountedRef.current) return;
[12469] Fix | Delete
dispatch({
[12470] Fix | Delete
type: "unregisterGroup",
[12471] Fix | Delete
id: id
[12472] Fix | Delete
});
[12473] Fix | Delete
}),
[12474] Fix | Delete
move: useAction(function (id) {
[12475] Fix | Delete
return dispatch({
[12476] Fix | Delete
type: "move",
[12477] Fix | Delete
id: id
[12478] Fix | Delete
});
[12479] Fix | Delete
}),
[12480] Fix | Delete
next: useAction(function (allTheWay) {
[12481] Fix | Delete
return dispatch({
[12482] Fix | Delete
type: "next",
[12483] Fix | Delete
allTheWay: allTheWay
[12484] Fix | Delete
});
[12485] Fix | Delete
}),
[12486] Fix | Delete
previous: useAction(function (allTheWay) {
[12487] Fix | Delete
return dispatch({
[12488] Fix | Delete
type: "previous",
[12489] Fix | Delete
allTheWay: allTheWay
[12490] Fix | Delete
});
[12491] Fix | Delete
}),
[12492] Fix | Delete
up: useAction(function (allTheWay) {
[12493] Fix | Delete
return dispatch({
[12494] Fix | Delete
type: "up",
[12495] Fix | Delete
allTheWay: allTheWay
[12496] Fix | Delete
});
[12497] Fix | Delete
}),
[12498] Fix | Delete
down: useAction(function (allTheWay) {
[12499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function