baiten3d 0.1.0 → 0.1.2

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.
@@ -1,4 +1,4 @@
1
- import { a as e } from "./rack-DndsEqJP.js";
1
+ import { a as e } from "./rack-C76bUYRK.js";
2
2
  // src/application/composeSite.ts
3
3
  function t(t, i = {}) {
4
4
  let a = t.map((t) => e(t.config, t.articles)), o = i.entryViewOverride ?? (a.length === 1 ? "front-page" : "stand"), s = n(a), c = r(a);
@@ -10,8 +10,18 @@ export interface SiteMetaPayload {
10
10
  readonly routes: readonly ArticleRoute[];
11
11
  readonly editionRoutes: readonly EditionRoute[];
12
12
  }
13
+ export interface CompactArticleSliceOverride {
14
+ readonly title?: string;
15
+ readonly subtitle?: string | null;
16
+ readonly heroImage?: string | null;
17
+ readonly heroCaption?: string | null;
18
+ readonly body?: string;
19
+ readonly bodyHtml?: string;
20
+ }
13
21
  export interface CompactPlacedBlock extends Omit<PlacedBlock, "article"> {
14
22
  readonly articleSlug: string;
23
+ /** `paginateBy: "h2"` 等で同一 slug の記事が複数ページへ分割された際のページ固有差分 */
24
+ readonly articleOverride?: CompactArticleSliceOverride;
15
25
  }
16
26
  export interface CompactSheet extends Omit<ComposedSheet, "blocks"> {
17
27
  readonly blocks: readonly CompactPlacedBlock[];
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./react-1yHcPcfO.js";
2
- import { t as c } from "./composeSite-CcP_4wa0.js";
3
- import { a as l, n as u, r as d, t as f } from "./rack-DndsEqJP.js";
1
+ import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./react-D1PVmQQw.js";
2
+ import { t as c } from "./composeSite-BEb4A7zA.js";
3
+ import { a as l, n as u, r as d, t as f } from "./rack-C76bUYRK.js";
4
4
  export { t as ArchiveIndexView, a as MagazineViewer, r as NewspaperViewer, s as NewsstandView, f as chunkRackRows, l as composePublication, c as composeSite, n as computeMastheadTitleSizePx, u as isSafeNavigationHref, e as normalizeOverlayTone, i as publicationStyleToCssVars, o as resolvePublicationStyle, d as resolveRackSlots };
@@ -186,7 +186,33 @@ function u(e, n, r, i, a) {
186
186
  blocks: u
187
187
  });
188
188
  else if (u.length !== 0) {
189
- if (r === "full-bleed-image" || u.length === 1 && (u[0]?.article.pages?.length ?? 0) > 0) {
189
+ if (n === "magazine" && u.length === 1 && u[0]?.article.paginateBy === "h2") {
190
+ let e = u[0], t = e.article, n = b(t), a = Math.max(i.page, v(c));
191
+ for (let o = 0; o < n.length; o += 1) {
192
+ let s = n[o];
193
+ if (!s) continue;
194
+ let l = {
195
+ ...t,
196
+ title: o === 0 ? t.title : s.title,
197
+ subtitle: o === 0 ? t.subtitle : void 0,
198
+ heroImage: o === 0 ? t.heroImage : void 0,
199
+ heroCaption: o === 0 ? t.heroCaption : void 0,
200
+ body: s.body,
201
+ bodyHtml: s.bodyHtml
202
+ };
203
+ c.push({
204
+ page: a,
205
+ template: o === 0 ? r : r === "magazine-feature" ? "magazine-editorial" : r,
206
+ sectionLabel: o === 0 ? i.sectionLabel ?? s.sectionLabel ?? t.kicker : s.sectionLabel ?? t.kicker,
207
+ columns: i.columns,
208
+ rows: i.rows,
209
+ blocks: [{
210
+ ...e,
211
+ article: l
212
+ }]
213
+ }), a += 1;
214
+ }
215
+ } else if (r === "full-bleed-image" || u.length === 1 && (u[0]?.article.pages?.length ?? 0) > 0) {
190
216
  let e = i.page;
191
217
  for (let t of u) {
192
218
  let n = t.article.pages;