@ohhwells/bridge 0.1.42-next.103 → 0.1.42-next.104

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/dist/index.cjs CHANGED
@@ -7306,18 +7306,28 @@ function buildRootNavDropSlots() {
7306
7306
  });
7307
7307
  return slots;
7308
7308
  }
7309
+ const edgeGap = (() => {
7310
+ if (items.length < 2) return 32;
7311
+ const a = items[0].getBoundingClientRect();
7312
+ const b = items[1].getBoundingClientRect();
7313
+ return Math.max(0, b.left - a.right);
7314
+ })();
7309
7315
  for (let i = 0; i <= items.length; i++) {
7310
7316
  let left;
7311
7317
  let top;
7312
7318
  let height;
7313
7319
  if (i === 0) {
7314
7320
  const first = items[0].getBoundingClientRect();
7315
- left = first.left - barThickness / 2;
7321
+ left = first.left - edgeGap / 2 - barThickness / 2;
7316
7322
  top = first.top;
7317
7323
  height = first.height;
7318
7324
  } else if (i === items.length) {
7319
7325
  const last = items[items.length - 1].getBoundingClientRect();
7320
- left = last.right - barThickness / 2;
7326
+ const lastGap = items.length >= 2 ? Math.max(
7327
+ 0,
7328
+ last.left - items[items.length - 2].getBoundingClientRect().right
7329
+ ) : edgeGap;
7330
+ left = last.right + lastGap / 2 - barThickness / 2;
7321
7331
  top = last.top;
7322
7332
  height = last.height;
7323
7333
  } else {
@@ -7344,18 +7354,28 @@ function buildChildNavDropSlots(parentHrefKey) {
7344
7354
  const slots = [];
7345
7355
  const barThickness = 3;
7346
7356
  if (children.length === 0) return slots;
7357
+ const edgeGap = (() => {
7358
+ if (children.length < 2) return 16;
7359
+ const a = children[0].getBoundingClientRect();
7360
+ const b = children[1].getBoundingClientRect();
7361
+ return Math.max(0, b.top - a.bottom);
7362
+ })();
7347
7363
  for (let i = 0; i <= children.length; i++) {
7348
7364
  let top;
7349
7365
  let width;
7350
7366
  let left;
7351
7367
  if (i === 0) {
7352
7368
  const first = children[0].getBoundingClientRect();
7353
- top = first.top - barThickness / 2;
7369
+ top = first.top - edgeGap / 2 - barThickness / 2;
7354
7370
  left = first.left;
7355
7371
  width = first.width;
7356
7372
  } else if (i === children.length) {
7357
7373
  const last = children[children.length - 1].getBoundingClientRect();
7358
- top = last.bottom - barThickness / 2;
7374
+ const lastGap = children.length >= 2 ? Math.max(
7375
+ 0,
7376
+ last.top - children[children.length - 2].getBoundingClientRect().bottom
7377
+ ) : edgeGap;
7378
+ top = last.bottom + lastGap / 2 - barThickness / 2;
7359
7379
  left = last.left;
7360
7380
  width = last.width;
7361
7381
  } else {