kuinetic 0.2.3 → 0.2.4

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.
@@ -8374,7 +8374,8 @@ var STACK_PRESETS = [
8374
8374
  name: "carousel-stack",
8375
8375
  primitive: "spatial-stack",
8376
8376
  requiresOwnSubtree: true,
8377
- phase: "idle"
8377
+ phase: "idle",
8378
+ cloak: true
8378
8379
  }
8379
8380
  ];
8380
8381
 
@@ -8600,21 +8601,24 @@ var CAROUSEL_PRESETS = [
8600
8601
  primitive: "spatial-ring",
8601
8602
  params: { tilt: "12deg" },
8602
8603
  requiresOwnSubtree: true,
8603
- phase: "idle"
8604
+ phase: "idle",
8605
+ cloak: true
8604
8606
  },
8605
8607
  {
8606
8608
  name: "carousel-3d-high",
8607
8609
  primitive: "spatial-ring",
8608
8610
  params: { tilt: "30deg", perspective: "1200px" },
8609
8611
  requiresOwnSubtree: true,
8610
- phase: "idle"
8612
+ phase: "idle",
8613
+ cloak: true
8611
8614
  },
8612
8615
  {
8613
8616
  name: "carousel-3d-low",
8614
8617
  primitive: "spatial-ring",
8615
8618
  params: { tilt: "-18deg", perspective: "1800px" },
8616
8619
  requiresOwnSubtree: true,
8617
- phase: "idle"
8620
+ phase: "idle",
8621
+ cloak: true
8618
8622
  },
8619
8623
  /*
8620
8624
  * The concave name. `arc:120deg` is the default the outside names cannot want and this one cannot
@@ -8629,7 +8633,8 @@ var CAROUSEL_PRESETS = [
8629
8633
  primitive: "spatial-ring",
8630
8634
  params: { arc: "120deg", facing: "camera", perspective: "900px" },
8631
8635
  requiresOwnSubtree: true,
8632
- phase: "idle"
8636
+ phase: "idle",
8637
+ cloak: true
8633
8638
  },
8634
8639
  /*
8635
8640
  * The flat ring: cards on a clock face around whatever sits in the middle of the host (a word, a
@@ -8650,7 +8655,8 @@ var CAROUSEL_PRESETS = [
8650
8655
  primitive: "spatial-ring",
8651
8656
  params: { plane: "screen", facing: "camera" },
8652
8657
  requiresOwnSubtree: true,
8653
- phase: "idle"
8658
+ phase: "idle",
8659
+ cloak: true
8654
8660
  }
8655
8661
  ];
8656
8662
  function registerCarousel(registry) {
@@ -9431,7 +9437,14 @@ var paramsSchema = {
9431
9437
  ease: { type: "easing", default: DEFAULT_EASE, cssProperty: "--kui-lightbox-ease" },
9432
9438
  loop: { type: "keyword", default: "true", cssProperty: "--kui-lightbox-loop", keywords: ["true", "false"] },
9433
9439
  aspect: { type: "keyword", default: "", cssProperty: "--kui-lightbox-aspect", keywords: ["wide", "tall", "square"] },
9434
- caption: { type: "keyword", default: "figcaption", cssProperty: "--kui-lightbox-caption", keywords: ["figcaption", "alt", "title", "none"] }
9440
+ caption: { type: "keyword", default: "figcaption", cssProperty: "--kui-lightbox-caption", keywords: ["figcaption", "alt", "title", "none"] },
9441
+ arrows: {
9442
+ type: "keyword",
9443
+ default: "bottom-right",
9444
+ cssProperty: "--kui-lightbox-arrows",
9445
+ keywords: ["bottom-right", "bottom-left", "bottom", "bottom-apart", "top-right", "top-left", "sides"]
9446
+ },
9447
+ "arrow-gap": { type: "length", default: "", cssProperty: "--kui-lightbox-arrow-gap" }
9435
9448
  };
9436
9449
  function defaultTargets(el, media) {
9437
9450
  if (el.matches("a[href]") || media !== "video" && el.matches("img")) return [el];
@@ -9646,6 +9659,17 @@ function vocabulary(items) {
9646
9659
  if (kinds.size > 1) return { noun: "item", label: "Media viewer" };
9647
9660
  return kinds.has("video") ? { noun: "video", label: "Video viewer" } : { noun: "image", label: "Image viewer" };
9648
9661
  }
9662
+ var SVG_NS = "http://www.w3.org/2000/svg";
9663
+ function chevron(doc, path2) {
9664
+ const svg = doc.createElementNS(SVG_NS, "svg");
9665
+ svg.setAttribute("viewBox", "0 0 24 24");
9666
+ svg.setAttribute("aria-hidden", "true");
9667
+ svg.setAttribute("focusable", "false");
9668
+ const stroke = doc.createElementNS(SVG_NS, "path");
9669
+ stroke.setAttribute("d", path2);
9670
+ svg.append(stroke);
9671
+ return svg;
9672
+ }
9649
9673
  function galleryContent(items, initial, options) {
9650
9674
  const doc = items[initial].trigger.ownerDocument;
9651
9675
  const box = doc.createElement("div");
@@ -9662,8 +9686,8 @@ function galleryContent(items, initial, options) {
9662
9686
  const previous = doc.createElement("button");
9663
9687
  const next = doc.createElement("button");
9664
9688
  previous.type = next.type = "button";
9665
- previous.textContent = "\u2039";
9666
- next.textContent = "\u203A";
9689
+ previous.append(chevron(doc, "M15 5l-7 7 7 7"));
9690
+ next.append(chevron(doc, "M9 5l7 7-7 7"));
9667
9691
  const { noun, label } = vocabulary(items);
9668
9692
  previous.setAttribute("aria-label", `Previous ${noun}`);
9669
9693
  next.setAttribute("aria-label", `Next ${noun}`);
@@ -9683,7 +9707,11 @@ function galleryContent(items, initial, options) {
9683
9707
  players: /* @__PURE__ */ new Map()
9684
9708
  };
9685
9709
  if (items.length > 1) {
9686
- box.append(previous, next, counter);
9710
+ const nav = doc.createElement("div");
9711
+ nav.className = `kui-lightbox-nav kui-lightbox-nav--${options.arrows}`;
9712
+ if (options.arrowGap) nav.style.setProperty("--kui-lightbox-arrow-gap", options.arrowGap);
9713
+ nav.append(previous, next);
9714
+ box.append(nav, counter);
9687
9715
  previous.addEventListener("click", () => clickGallery(state, -1, previous));
9688
9716
  next.addEventListener("click", () => clickGallery(state, 1, next));
9689
9717
  }
@@ -9697,8 +9725,9 @@ function galleryContent(items, initial, options) {
9697
9725
  reducedMotion,
9698
9726
  node: box,
9699
9727
  label,
9700
- // The media and the controls keep the viewer open; the empty figure around them closes it.
9701
- inside: (target) => box.contains(target) && target.closest("img, video, iframe, button") !== null,
9728
+ // The media and the controls (the arrow group included, so a click in the gap between the
9729
+ // arrows is not a close) keep the viewer open; the empty figure around them closes it.
9730
+ inside: (target) => box.contains(target) && target.closest("img, video, iframe, button, .kui-lightbox-nav") !== null,
9702
9731
  onClose: () => {
9703
9732
  unswipe?.();
9704
9733
  closeViewer(state);
@@ -9764,7 +9793,9 @@ function attachDeckLightbox(request) {
9764
9793
  ease: DEFAULT_EASE,
9765
9794
  reducedMotion,
9766
9795
  loop: true,
9767
- aspect: ""
9796
+ aspect: "",
9797
+ arrows: "bottom-right",
9798
+ arrowGap: ""
9768
9799
  };
9769
9800
  const turnedAway = (card) => card.getAttribute("data-kui-ring-face") === "back";
9770
9801
  const openAt2 = (pick, faceChecked = false) => {
@@ -9827,7 +9858,13 @@ function prepareLightbox(el, params, ctx) {
9827
9858
  };
9828
9859
  const controller = new AbortController();
9829
9860
  const shell = acquireModalShell(ctx.doc);
9830
- const options = { ...modalOptions(params, ctx), loop: params.is("loop"), aspect: params.text("aspect") };
9861
+ const options = {
9862
+ ...modalOptions(params, ctx),
9863
+ loop: params.is("loop"),
9864
+ aspect: params.text("aspect"),
9865
+ arrows: params.text("arrows", "bottom-right"),
9866
+ arrowGap: params.text("arrow-gap")
9867
+ };
9831
9868
  const restore = wireTriggers(triggers, {
9832
9869
  shell,
9833
9870
  options,
@@ -17,7 +17,7 @@ import {
17
17
  registerThreeD,
18
18
  registerTween,
19
19
  registerViewTransitions
20
- } from "../chunk-FYMZW5N2.mjs";
20
+ } from "../chunk-EHS45PIK.mjs";
21
21
  import "../chunk-FASAEQDR.mjs";
22
22
  import "../chunk-AEQGC2KM.mjs";
23
23
  export {
@@ -17,7 +17,7 @@ import {
17
17
  PRESETS,
18
18
  PRIMITIVES,
19
19
  createRegistry
20
- } from "./chunk-FYMZW5N2.mjs";
20
+ } from "./chunk-EHS45PIK.mjs";
21
21
  import {
22
22
  ATTR,
23
23
  CHANNEL,
@@ -795,6 +795,14 @@ var SHOWCASE_NOTES = {
795
795
  whenOmitted: "Tall for a YouTube Shorts link, wide for every other video."
796
796
  },
797
797
  "lightbox.caption": "Where the line under each item comes from, or none to hide it.",
798
+ "lightbox.arrows": {
799
+ why: "Where the previous and next arrows sit: a corner, top or bottom, apart, or on the sides.",
800
+ whenOmitted: "Bottom right, side by side, clear of the picture."
801
+ },
802
+ "lightbox.arrow-gap": {
803
+ why: "The space between the two arrows when they sit together.",
804
+ whenOmitted: "Half a line of space."
805
+ },
798
806
  "scroll-story.target": {
799
807
  why: "Which elements are the pictures or clips that change as you scroll.",
800
808
  whenOmitted: "Uses the children of its first child."