@rizom/site-rizom-ai 0.2.0-alpha.261 → 0.2.0-alpha.262

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.js CHANGED
@@ -39045,6 +39045,35 @@ var story_default = `/* The story pages: chapters beside one drawing, under the
39045
39045
  width: min(100%, calc(100svh - var(--bar-height, 4.6rem) - 2rem));
39046
39046
  aspect-ratio: 1;
39047
39047
  }
39048
+ /* On a wide screen the opening's drawing keeps its place beside the words
39049
+ while the opening is read, an answer included, and leaves with the opening;
39050
+ it fades once the reading has moved the figure on, as on a phone. In flow
39051
+ with no height, so the words do not move; its width is the room right of
39052
+ the words, as the absolute layer's was. */
39053
+ @media not all and (max-width: 60rem) {
39054
+ :where(.chapter--opening) > .net-layer {
39055
+ position: sticky;
39056
+ order: -1;
39057
+ top: calc(
39058
+ var(--bar-height, 4.6rem) + (100svh - var(--bar-height, 4.6rem)) / 2
39059
+ );
39060
+ height: 0;
39061
+ margin-left: calc(var(--words) + var(--words-gap));
39062
+ width: calc(
39063
+ 100cqi - max(0px, (100cqi - 80rem) / 2) - clamp(1rem, 5vw, 5rem) -
39064
+ var(--words) - var(--words-gap) - clamp(1rem, 6vw, 7rem)
39065
+ );
39066
+ transition: opacity 0.6s ease;
39067
+ }
39068
+ :where(.chapter--opening) > .net-layer > * {
39069
+ translate: 0 -50%;
39070
+ }
39071
+ .story:has(.figure:not([data-stage="0"]))
39072
+ :where(.chapter--opening)
39073
+ > .net-layer {
39074
+ opacity: 0;
39075
+ }
39076
+ }
39048
39077
  .net-svg {
39049
39078
  overflow: visible;
39050
39079
  }
@@ -39419,6 +39448,14 @@ var story_default = `/* The story pages: chapters beside one drawing, under the
39419
39448
  --ask-display: var(--font-display);
39420
39449
  --ask-muted: var(--color-text-light);
39421
39450
  }
39451
+ /* The page is the one scroller beside the drawing: the conversation grows in
39452
+ the opening instead of scrolling inside a band under the lede. */
39453
+ .opening__ask:not([data-ask-sheet]) .brain-box-scroll {
39454
+ max-height: none;
39455
+ overflow: visible;
39456
+ mask-image: none;
39457
+ padding-bottom: 0;
39458
+ }
39422
39459
  .ask__topics {
39423
39460
  list-style: none;
39424
39461
  margin: 1rem 0 0;
@@ -39683,12 +39720,13 @@ var story_default = `/* The story pages: chapters beside one drawing, under the
39683
39720
  the first item of its scroll, a slot holding its place meanwhile, and a
39684
39721
  tapped dot flashes its source. */
39685
39722
  .net-leads {
39686
- position: absolute;
39723
+ /* Leads join words to the drawing across the page, so the viewport is
39724
+ their frame; the runtime draws them in viewport coordinates. */
39725
+ position: fixed;
39687
39726
  inset: 0;
39688
39727
  z-index: 2;
39689
- width: 100%;
39690
- height: 100%;
39691
- /* The chapter is the words' width; a lead runs past it to the drawing. */
39728
+ width: 100vw;
39729
+ height: 100vh;
39692
39730
  overflow: visible;
39693
39731
  pointer-events: none;
39694
39732
  }
@@ -40893,13 +40931,26 @@ var storyRuntimeScript = `(function () {
40893
40931
  });
40894
40932
  return rows.length ? rows[rows.length - 1] : null;
40895
40933
  }
40934
+ // A point is in view when no scrolling ancestor hides it and it is on screen.
40935
+ function inView(element, middle) {
40936
+ if (middle < 0 || middle > innerHeight) return false;
40937
+ var parent = element.parentElement;
40938
+ while (parent && parent !== document.body) {
40939
+ var overflow = getComputedStyle(parent).overflowY;
40940
+ if (overflow === "auto" || overflow === "scroll") {
40941
+ var area = parent.getBoundingClientRect();
40942
+ if (middle < area.top || middle > area.bottom) return false;
40943
+ }
40944
+ parent = parent.parentElement;
40945
+ }
40946
+ return true;
40947
+ }
40896
40948
  function drawLeads() {
40897
40949
  if (!leadsLayer) return;
40898
40950
  while (leadsLayer.firstChild) leadsLayer.removeChild(leadsLayer.firstChild);
40899
40951
  if (narrow.matches || !askHost) return;
40900
- // The layer's own box is the frame: coordinates are its, whatever positions it.
40901
- var frame = leadsLayer.getBoundingClientRect();
40902
- leadsLayer.setAttribute("viewBox", "0 0 " + frame.width + " " + frame.height);
40952
+ // The layer is fixed to the viewport, so viewport coordinates are its own.
40953
+ leadsLayer.setAttribute("viewBox", "0 0 " + innerWidth + " " + innerHeight);
40903
40954
  Object.keys(sourceBrain).forEach(function (key) {
40904
40955
  var mark = homeMarks.filter(function (m) { return m.getAttribute("data-brain") === sourceBrain[key]; })[0];
40905
40956
  var row = listedRow(askHost, key);
@@ -40907,11 +40958,12 @@ var storyRuntimeScript = `(function () {
40907
40958
  var from = row.getBoundingClientRect();
40908
40959
  if (!from.height) return;
40909
40960
  var to = mark.getBoundingClientRect();
40910
- var x1 = from.right + GAP - frame.left;
40911
- var y1 = from.top + from.height / 2 - frame.top;
40912
- var toward = to.left + to.width / 2 - frame.left;
40961
+ var y1 = from.top + from.height / 2;
40962
+ var y2 = to.top + to.height / 2;
40963
+ if (!inView(row, y1) || !inView(mark, y2)) return;
40964
+ var x1 = from.right + GAP;
40965
+ var toward = to.left + to.width / 2;
40913
40966
  var x2 = toward > x1 ? toward - GLYPH : toward + GLYPH;
40914
- var y2 = to.top + to.height / 2 - frame.top;
40915
40967
  var bend = Math.max(40, Math.abs(x2 - x1) / 2);
40916
40968
  var lead = document.createElementNS(SVG, "path");
40917
40969
  lead.setAttribute("data-lead", key);
@@ -57911,4 +57963,4 @@ export {
57911
57963
  workSections
57912
57964
  };
57913
57965
 
57914
- //# debugId=0F088276C2CD1A9664756E2164756E21
57966
+ //# debugId=85F90AC62007BA8264756E2164756E21