@aglyn/aglyn 1.0.0-beta.193 → 1.0.0-beta.195
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/package.json +11 -11
- package/src/lib/app-utils/collection-entry-date.d.ts +42 -0
- package/src/lib/app-utils/collection-entry-date.js +40 -0
- package/src/lib/app-utils/collection-entry-date.js.map +1 -1
- package/src/lib/app-utils/docs-index.generated.js +1 -1
- package/src/lib/app-utils/docs-index.generated.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/aglyn",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.195",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
"./package.json": "./package.json"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@aglyn/shared-data-enums": "1.0.0-beta.
|
|
37
|
-
"@aglyn/shared-data-mdi": "1.0.0-beta.
|
|
38
|
-
"@aglyn/shared-data-types": "1.0.0-beta.
|
|
39
|
-
"@aglyn/shared-util-email": "1.0.0-beta.
|
|
40
|
-
"@aglyn/shared-util-first-touch": "1.0.0-beta.
|
|
41
|
-
"@aglyn/shared-util-http": "1.0.0-beta.
|
|
42
|
-
"@aglyn/shared-util-logger": "1.0.0-beta.
|
|
43
|
-
"@aglyn/shared-util-timestamp": "1.0.0-beta.
|
|
44
|
-
"@aglyn/shared-util-tools": "1.0.0-beta.
|
|
45
|
-
"@aglyn/shared-util-vendor": "1.0.0-beta.
|
|
36
|
+
"@aglyn/shared-data-enums": "1.0.0-beta.195",
|
|
37
|
+
"@aglyn/shared-data-mdi": "1.0.0-beta.195",
|
|
38
|
+
"@aglyn/shared-data-types": "1.0.0-beta.195",
|
|
39
|
+
"@aglyn/shared-util-email": "1.0.0-beta.195",
|
|
40
|
+
"@aglyn/shared-util-first-touch": "1.0.0-beta.195",
|
|
41
|
+
"@aglyn/shared-util-http": "1.0.0-beta.195",
|
|
42
|
+
"@aglyn/shared-util-logger": "1.0.0-beta.195",
|
|
43
|
+
"@aglyn/shared-util-timestamp": "1.0.0-beta.195",
|
|
44
|
+
"@aglyn/shared-util-tools": "1.0.0-beta.195",
|
|
45
|
+
"@aglyn/shared-util-vendor": "1.0.0-beta.195",
|
|
46
46
|
"@data-driven-forms/react-form-renderer": "^4.2.0",
|
|
47
47
|
"@msgpack/msgpack": "^3.1.3",
|
|
48
48
|
"@types/unist": "^3.0.3",
|
|
@@ -180,3 +180,45 @@ timeZoneName?: string): string;
|
|
|
180
180
|
export declare function collectionEntryPublishedAtIso(publishedAt: {
|
|
181
181
|
seconds: number;
|
|
182
182
|
} | null | undefined): string;
|
|
183
|
+
/**
|
|
184
|
+
* The stored field the console's entries table sorts its Published column by
|
|
185
|
+
* (AGL-3323): the instant {@link entryPublishSortStamp} names, kept on the
|
|
186
|
+
* entry beside the two fields it is derived from.
|
|
187
|
+
*
|
|
188
|
+
* It exists because Firestore cannot sort on a fallback. `orderBy` reads one
|
|
189
|
+
* field, and an entry that lacks it is not sorted last, it is left out of the
|
|
190
|
+
* ordered read entirely. A scheduled entry has no `publishedAt` until it goes
|
|
191
|
+
* live, so a table ordered on `publishedAt` could only append it after every
|
|
192
|
+
* published entry — the last page, in both directions — while the cell above
|
|
193
|
+
* it showed its `publishAt`. One stored field holding the date the cell shows
|
|
194
|
+
* is the only shape an index can walk.
|
|
195
|
+
*
|
|
196
|
+
* It is a CONSOLE key. The public site's listings go on sorting and filtering
|
|
197
|
+
* `publishedAt`, which only a live entry carries; this field must never become
|
|
198
|
+
* what decides what a visitor sees, because a scheduled entry carries it too.
|
|
199
|
+
*/
|
|
200
|
+
export declare const ENTRY_PUBLISH_SORT_FIELD = "publishSortAt";
|
|
201
|
+
/**
|
|
202
|
+
* The one instant an entry is listed under in the console (AGL-3206,
|
|
203
|
+
* AGL-3323): its scheduled `publishAt` while it waits to go out, its
|
|
204
|
+
* `publishedAt` otherwise, and `null` when it has neither.
|
|
205
|
+
*
|
|
206
|
+
* Scheduled wins over `publishedAt` because a SCHEDULED entry is not on the
|
|
207
|
+
* site: scheduling a published entry takes it off the live set until the date
|
|
208
|
+
* arrives, and it keeps the old `publishedAt` only until the runtime flips it
|
|
209
|
+
* back and overwrites that with `publishAt`. The date it will go out on is
|
|
210
|
+
* the true one for it.
|
|
211
|
+
*
|
|
212
|
+
* The `status` guard is load-bearing in the other direction too. A draft that
|
|
213
|
+
* still holds a `publishAt` from a cancelled schedule is undated here rather
|
|
214
|
+
* than sorting among the dated rows on a date it never displays.
|
|
215
|
+
*
|
|
216
|
+
* Every writer of `status`, `publishedAt` or `publishAt` stores this value
|
|
217
|
+
* under {@link ENTRY_PUBLISH_SORT_FIELD} — and removes the field on `null` —
|
|
218
|
+
* so the stored key and the rendered cell answer from the same rule.
|
|
219
|
+
*/
|
|
220
|
+
export declare function entryPublishSortStamp<T>(entry: {
|
|
221
|
+
status?: unknown;
|
|
222
|
+
publishedAt?: T | null;
|
|
223
|
+
publishAt?: T | null;
|
|
224
|
+
} | null | undefined): T | null;
|
|
@@ -283,5 +283,45 @@ export function formatCollectionEntryDate(publishedAt, format, locale = COLLECTI
|
|
|
283
283
|
const date = new Date(seconds * 1000);
|
|
284
284
|
return Number.isNaN(date.getTime()) ? '' : date.toISOString();
|
|
285
285
|
}
|
|
286
|
+
/**
|
|
287
|
+
* The stored field the console's entries table sorts its Published column by
|
|
288
|
+
* (AGL-3323): the instant {@link entryPublishSortStamp} names, kept on the
|
|
289
|
+
* entry beside the two fields it is derived from.
|
|
290
|
+
*
|
|
291
|
+
* It exists because Firestore cannot sort on a fallback. `orderBy` reads one
|
|
292
|
+
* field, and an entry that lacks it is not sorted last, it is left out of the
|
|
293
|
+
* ordered read entirely. A scheduled entry has no `publishedAt` until it goes
|
|
294
|
+
* live, so a table ordered on `publishedAt` could only append it after every
|
|
295
|
+
* published entry — the last page, in both directions — while the cell above
|
|
296
|
+
* it showed its `publishAt`. One stored field holding the date the cell shows
|
|
297
|
+
* is the only shape an index can walk.
|
|
298
|
+
*
|
|
299
|
+
* It is a CONSOLE key. The public site's listings go on sorting and filtering
|
|
300
|
+
* `publishedAt`, which only a live entry carries; this field must never become
|
|
301
|
+
* what decides what a visitor sees, because a scheduled entry carries it too.
|
|
302
|
+
*/ export const ENTRY_PUBLISH_SORT_FIELD = 'publishSortAt';
|
|
303
|
+
/**
|
|
304
|
+
* The one instant an entry is listed under in the console (AGL-3206,
|
|
305
|
+
* AGL-3323): its scheduled `publishAt` while it waits to go out, its
|
|
306
|
+
* `publishedAt` otherwise, and `null` when it has neither.
|
|
307
|
+
*
|
|
308
|
+
* Scheduled wins over `publishedAt` because a SCHEDULED entry is not on the
|
|
309
|
+
* site: scheduling a published entry takes it off the live set until the date
|
|
310
|
+
* arrives, and it keeps the old `publishedAt` only until the runtime flips it
|
|
311
|
+
* back and overwrites that with `publishAt`. The date it will go out on is
|
|
312
|
+
* the true one for it.
|
|
313
|
+
*
|
|
314
|
+
* The `status` guard is load-bearing in the other direction too. A draft that
|
|
315
|
+
* still holds a `publishAt` from a cancelled schedule is undated here rather
|
|
316
|
+
* than sorting among the dated rows on a date it never displays.
|
|
317
|
+
*
|
|
318
|
+
* Every writer of `status`, `publishedAt` or `publishAt` stores this value
|
|
319
|
+
* under {@link ENTRY_PUBLISH_SORT_FIELD} — and removes the field on `null` —
|
|
320
|
+
* so the stored key and the rendered cell answer from the same rule.
|
|
321
|
+
*/ export function entryPublishSortStamp(entry) {
|
|
322
|
+
var _ref;
|
|
323
|
+
if ((entry == null ? void 0 : entry.status) === 'scheduled' && entry.publishAt) return entry.publishAt;
|
|
324
|
+
return (_ref = entry == null ? void 0 : entry.publishedAt) != null ? _ref : null;
|
|
325
|
+
}
|
|
286
326
|
|
|
287
327
|
//# sourceMappingURL=collection-entry-date.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/collection-entry-date.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * How an entry's published date is spelled, and the one function that spells\n * it.\n *\n * Its own module because a published page's client bundle reads\n * `formatCollectionEntryDate` and nothing else here: `collection-entries.ts`\n * carries the whole collection runtime — routing, pagination, category links,\n * the search index and the four block expanders — and a bundler cannot drop\n * the rest of it around a single named import.\n */\n\n/**\n * How an entry's published date reads (AGL-1459).\n *\n * Named shapes rather than a format string, for the same reason the styles\n * panel offers a unit picker rather than a CSS box: an editor choosing a\n * byline is not choosing a grammar, and a free-typed pattern is a field where\n * every typo renders as itself on a published page.\n */\nexport type CollectionEntryDateFormat =\n 'default' | 'monthYear' | 'mediumDate' | 'longDate' | 'iso'\n\n/**\n * \"However the site already renders it\" — a REAL value, never absence\n * (AGL-1459).\n *\n * `''` is the shape AGL-1451/AGL-1453 closed repo-wide: an emptied field\n * cannot survive a save, so an author who tried a format and wanted the\n * original back would have no option to pick. So the do-nothing choice is a\n * word, exactly like `COLLECTION_ALL_PILL_NONE` in `collection-entries.ts`.\n */\nexport const COLLECTION_ENTRY_DATE_FORMAT_DEFAULT: CollectionEntryDateFormat =\n 'default'\n\n/**\n * The offered formats, with the labels an author reads (AGL-1459). Lives here\n * rather than in the block's schema so the list and the formatter cannot\n * drift into offering a shape nothing knows how to produce.\n *\n * Example dates in the labels are written the way the default runtime renders\n * them, which is what makes the choice legible without opening a preview.\n */\nexport const COLLECTION_ENTRY_DATE_FORMAT_OPTIONS: readonly {\n value: CollectionEntryDateFormat\n label: string\n}[] = [\n { value: 'default', label: 'Site default — 8/9/2026' },\n { value: 'monthYear', label: 'Month and year — Aug 2026' },\n { value: 'mediumDate', label: 'Short date — Aug 9, 2026' },\n { value: 'longDate', label: 'Long date — August 9, 2026' },\n { value: 'iso', label: 'ISO — 2026-08-09' },\n]\n\n/** Any stored value read back as a format this module knows (AGL-1459). */\nexport function normalizeCollectionEntryDateFormat(\n value: unknown,\n): CollectionEntryDateFormat {\n const wanted = String(value ?? '').trim()\n const match = COLLECTION_ENTRY_DATE_FORMAT_OPTIONS.find(\n (option) => option.value === wanted,\n )\n return match?.value ?? COLLECTION_ENTRY_DATE_FORMAT_DEFAULT\n}\n\n/**\n * One entry's published date, in the shape the author asked for (AGL-1459).\n *\n * **The formatting lives HERE, beside the timestamp, and deliberately not in\n * the block.** By the time a date reaches the component it is already a\n * formatted string, and re-parsing one is ambiguous by construction: the same\n * `8/9/2026` reads as 9 August under an `en-US` runtime and 8 September under\n * `en-GB`. A byline that silently moves an article by three weeks is far worse\n * than one that is the wrong shape.\n *\n * `default` returns exactly `toLocaleDateString()` — the string this function\n * replaced, character for character — because the block is live on published\n * entries and opening a dropdown must not restyle them.\n *\n * ## Why the runtime gets no say (AGL-1926)\n *\n * Every branch pins BOTH the locale and the time zone, and the answer is a\n * pure function of the timestamp. It used to pass `locale` straight through\n * (normally `undefined`) with no `timeZone` at all, so the output was a\n * function of the RUNTIME: `en-US` + UTC on a Vercel server, the visitor's\n * own locale and zone in their browser. That is fine while only the server\n * ever calls it — the string is stamped into node props at compose time and\n * both sides then agree on it — but it makes the function a hydration\n * mismatch waiting for its first client-side caller, and `catch-all-client`\n * was exactly that caller. A post published at 02:30 UTC is dated the 10th by\n * the server and the 9th by every visitor west of Greenwich; React reports\n * the difference as a text mismatch (the live React #418 on tenant-web,\n * AGL-1926) and then reconciles against a DOM it no longer describes, which\n * is where the `removeChild`/`insertBefore` pair comes from.\n *\n * The pinned values are the ones production already emits, so no published\n * page changes: Vercel runs UTC with an `en-US` ICU default, which is why\n * every entry date served from aglyn.com today reads `8/9/2026`. Pinning\n * makes that byte-for-byte guaranteed instead of a property of the host.\n *\n * `locale` still exists for a caller that must render in a different one; it\n * now defaults to the value the server was picking implicitly rather than to\n * \"whatever this runtime happens to be\".\n */\nexport const COLLECTION_ENTRY_DATE_LOCALE = 'en-US'\n\n/**\n * The zone a calendar day is read in when a site has not named one.\n *\n * Entry timestamps are absolute instants; the day they are ATTRIBUTED to is\n * an editorial fact about the PUBLISHER, and `timeZone` below is how a site\n * states it. UTC remains the default because it is the answer every existing\n * site is already rendering — a site that never sets a zone must not have its\n * archive move by a day on deploy.\n *\n * ⚑ What AGL-1926 needed was not UTC, it was a zone BOTH SIDES AGREE ON. A\n * per-site zone is still that: it is resolved once, server-side, and travels\n * in the node props, so the client re-render reads the same string. What\n * would reopen the React #418 crash is reading the VISITOR's zone, because\n * only one side of the render knows it.\n */\nexport const COLLECTION_ENTRY_DATE_TIME_ZONE = 'UTC'\n\n/**\n * Is this a zone the runtime can actually format in (AGL-3237)?\n *\n * `Intl` is the only authority worth asking — an allowlist of IANA names goes\n * stale, and `toLocaleDateString` throws a RangeError on a name it does not\n * know, which would take down a composing page rather than mis-date one post.\n */\nexport function isSupportedTimeZone(value: unknown): boolean {\n const name = String(value ?? '').trim()\n if (!name) return false\n try {\n new Intl.DateTimeFormat('en-US', { timeZone: name })\n return true\n } catch {\n return false\n }\n}\n\n/**\n * Every zone this runtime can offer as a choice (AGL-3252).\n *\n * Read off `Intl` rather than checked in, for the reason\n * {@link isSupportedTimeZone} asks `Intl` rather than an allowlist: the IANA\n * database renames zones, and a stored list would offer names the runtime has\n * stopped accepting while missing ones it has learned. A picker built from\n * this and a validator built from that cannot disagree about what is\n * choosable.\n *\n * A memoized FUNCTION rather than a module constant: this module is imported\n * by the tenant page composer, which never draws a picker, and enumerating\n * four hundred zone names on import is work nothing there asks for.\n *\n * An old runtime without `supportedValuesOf` gets an EMPTY list rather than a\n * broken control — the callers offer their inherited-default option first, so\n * a picker with no zones in it still says what the site is doing.\n */\nlet supportedTimeZonesCache: readonly string[] | null = null\nexport function supportedTimeZones(): readonly string[] {\n if (supportedTimeZonesCache) return supportedTimeZonesCache\n try {\n supportedTimeZonesCache =\n (Intl as { supportedValuesOf?: (key: string) => string[] })\n .supportedValuesOf?.('timeZone') ?? []\n } catch {\n supportedTimeZonesCache = []\n }\n return supportedTimeZonesCache\n}\n\n/**\n * The zone a site's dates are read in (AGL-3237, AGL-3252).\n *\n * THE SITE WINS, then the workspace, then UTC. The organization names the\n * zone once and every site it owns inherits it — which is the answer a\n * customer with one site wants and never has to think about — and a site that\n * names its own overrides it, for the agency running a Chicago site and a\n * Berlin site out of one workspace. Neither set is UTC: the value every\n * existing site already renders, so nothing moves by a day when this ships.\n *\n * Each candidate is validated in turn rather than trusted, and an unusable\n * one FALLS THROUGH rather than terminating the chain: a stored zone can\n * predate an IANA rename, or be whatever a hand-edited document holds, and a\n * site whose own zone has gone stale should read in its workspace's rather\n * than jump to UTC.\n *\n * ⚑ AGL-3237 deferred the site half, on the reading that a `timeZone` on the\n * host document would need a Firestore rules change to go with it. It did\n * not. The host block's client branch is a `hasAny([…])` DENY list, so a\n * field it does not name is already writable by an editor; what the override\n * needed was a classification in `HOST_CLIENT_WRITABLE_FIELDS`, which is a\n * code change on the same commit rather than a rules deploy. The deferral was\n * a misreading of the guard, not a cost.\n */\nexport function resolveSiteTimeZone(\n org?: { timeZone?: string } | null,\n host?: { timeZone?: string } | null,\n): string {\n const siteZone = String(host?.timeZone ?? '').trim()\n if (isSupportedTimeZone(siteZone)) return siteZone\n const orgZone = String(org?.timeZone ?? '').trim()\n return isSupportedTimeZone(orgZone) ? orgZone : COLLECTION_ENTRY_DATE_TIME_ZONE\n}\n\nexport function formatCollectionEntryDate(\n publishedAt: { seconds: number } | null | undefined,\n format?: CollectionEntryDateFormat,\n locale: string = COLLECTION_ENTRY_DATE_LOCALE,\n /**\n * The site's zone (AGL-3237) — resolved once per render and passed down, so\n * server and client format the same instant into the same string.\n */\n timeZoneName: string = COLLECTION_ENTRY_DATE_TIME_ZONE,\n): string {\n const seconds = publishedAt?.seconds\n if (!seconds) return ''\n const date = new Date(seconds * 1000)\n // An unknown zone formats in UTC rather than throwing: this runs while a\n // page composes, and a RangeError here is a site that does not render.\n const timeZone = isSupportedTimeZone(timeZoneName)\n ? timeZoneName\n : COLLECTION_ENTRY_DATE_TIME_ZONE\n switch (normalizeCollectionEntryDateFormat(format)) {\n case 'monthYear':\n return date.toLocaleDateString(locale, {\n month: 'short',\n year: 'numeric',\n timeZone,\n })\n case 'mediumDate':\n return date.toLocaleDateString(locale, {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n timeZone,\n })\n case 'longDate':\n return date.toLocaleDateString(locale, {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n timeZone,\n })\n case 'iso': {\n // The calendar day IN THE SITE'S ZONE, not `toISOString()`'s slice by\n // luck and not the RUNTIME's local day: `getFullYear`/`getMonth`/\n // `getDate` read the host's zone, so this branch moved an entry by a\n // day depending on who rendered it. Read through the same formatter the\n // branches above use, so all four shapes name one day.\n const parts = new Intl.DateTimeFormat('en-US', {\n timeZone,\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n }).formatToParts(date)\n const part = (type: string) =>\n parts.find((entry) => entry.type === type)?.value ?? ''\n return `${part('year')}-${part('month')}-${part('day')}`\n }\n default:\n return date.toLocaleDateString(locale, { timeZone })\n }\n}\n\n/**\n * One entry's publish instant for a machine to read: an ISO 8601 date-time in\n * UTC, or `''` for an entry with no date (AGL-2956).\n *\n * {@link formatCollectionEntryDate} writes the date a READER sees, and every\n * one of its shapes is ambiguous or incomplete to a parser: `8/9/2026` is a\n * different day in `en-GB`, and even its `iso` shape is a calendar day with no\n * time or zone. A field that has to be parsed — a Video element's publication\n * date, which the page publishes as `VideoObject.uploadDate` — needs the\n * instant itself, spelled by `toISOString()` as `Article.datePublished` is.\n *\n * It reads the same `publishedAt` and treats a missing or zero `seconds` the\n * same way, so an entry is dated here exactly when it is dated there.\n *\n * A `seconds` no `Date` can hold answers `''` rather than throwing:\n * `toISOString` raises a RangeError on an invalid date, and this runs while a\n * page composes.\n */\nexport function collectionEntryPublishedAtIso(\n publishedAt: { seconds: number } | null | undefined,\n): string {\n const seconds = publishedAt?.seconds\n if (!seconds) return ''\n const date = new Date(seconds * 1000)\n return Number.isNaN(date.getTime()) ? '' : date.toISOString()\n}\n"],"names":["COLLECTION_ENTRY_DATE_FORMAT_DEFAULT","COLLECTION_ENTRY_DATE_FORMAT_OPTIONS","value","label","normalizeCollectionEntryDateFormat","wanted","String","trim","match","find","option","COLLECTION_ENTRY_DATE_LOCALE","COLLECTION_ENTRY_DATE_TIME_ZONE","isSupportedTimeZone","name","Intl","DateTimeFormat","timeZone","supportedTimeZonesCache","supportedTimeZones","supportedValuesOf","resolveSiteTimeZone","org","host","siteZone","orgZone","formatCollectionEntryDate","publishedAt","format","locale","timeZoneName","seconds","date","Date","toLocaleDateString","month","year","day","parts","formatToParts","part","type","entry","collectionEntryPublishedAtIso","Number","isNaN","getTime","toISOString"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;CASC,GAED;;;;;;;CAOC,GAID;;;;;;;;CAQC,GACD,OAAO,MAAMA,uCACX,UAAS;AAEX;;;;;;;CAOC,GACD,OAAO,MAAMC,uCAGP;IACJ;QAAEC,OAAO;QAAWC,OAAO;IAA0B;IACrD;QAAED,OAAO;QAAaC,OAAO;IAA4B;IACzD;QAAED,OAAO;QAAcC,OAAO;IAA2B;IACzD;QAAED,OAAO;QAAYC,OAAO;IAA6B;IACzD;QAAED,OAAO;QAAOC,OAAO;IAAmB;CAC3C,CAAA;AAED,yEAAyE,GACzE,OAAO,SAASC,mCACdF,KAAc;;IAEd,MAAMG,SAASC,OAAOJ,gBAAAA,QAAS,IAAIK,IAAI;IACvC,MAAMC,QA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KAAK,CAACb,KAAKc,OAAO,MAAM,KAAKd,KAAKe,WAAW;AAC7D"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/collection-entry-date.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * How an entry's published date is spelled, and the one function that spells\n * it.\n *\n * Its own module because a published page's client bundle reads\n * `formatCollectionEntryDate` and nothing else here: `collection-entries.ts`\n * carries the whole collection runtime — routing, pagination, category links,\n * the search index and the four block expanders — and a bundler cannot drop\n * the rest of it around a single named import.\n */\n\n/**\n * How an entry's published date reads (AGL-1459).\n *\n * Named shapes rather than a format string, for the same reason the styles\n * panel offers a unit picker rather than a CSS box: an editor choosing a\n * byline is not choosing a grammar, and a free-typed pattern is a field where\n * every typo renders as itself on a published page.\n */\nexport type CollectionEntryDateFormat =\n 'default' | 'monthYear' | 'mediumDate' | 'longDate' | 'iso'\n\n/**\n * \"However the site already renders it\" — a REAL value, never absence\n * (AGL-1459).\n *\n * `''` is the shape AGL-1451/AGL-1453 closed repo-wide: an emptied field\n * cannot survive a save, so an author who tried a format and wanted the\n * original back would have no option to pick. So the do-nothing choice is a\n * word, exactly like `COLLECTION_ALL_PILL_NONE` in `collection-entries.ts`.\n */\nexport const COLLECTION_ENTRY_DATE_FORMAT_DEFAULT: CollectionEntryDateFormat =\n 'default'\n\n/**\n * The offered formats, with the labels an author reads (AGL-1459). Lives here\n * rather than in the block's schema so the list and the formatter cannot\n * drift into offering a shape nothing knows how to produce.\n *\n * Example dates in the labels are written the way the default runtime renders\n * them, which is what makes the choice legible without opening a preview.\n */\nexport const COLLECTION_ENTRY_DATE_FORMAT_OPTIONS: readonly {\n value: CollectionEntryDateFormat\n label: string\n}[] = [\n { value: 'default', label: 'Site default — 8/9/2026' },\n { value: 'monthYear', label: 'Month and year — Aug 2026' },\n { value: 'mediumDate', label: 'Short date — Aug 9, 2026' },\n { value: 'longDate', label: 'Long date — August 9, 2026' },\n { value: 'iso', label: 'ISO — 2026-08-09' },\n]\n\n/** Any stored value read back as a format this module knows (AGL-1459). */\nexport function normalizeCollectionEntryDateFormat(\n value: unknown,\n): CollectionEntryDateFormat {\n const wanted = String(value ?? '').trim()\n const match = COLLECTION_ENTRY_DATE_FORMAT_OPTIONS.find(\n (option) => option.value === wanted,\n )\n return match?.value ?? COLLECTION_ENTRY_DATE_FORMAT_DEFAULT\n}\n\n/**\n * One entry's published date, in the shape the author asked for (AGL-1459).\n *\n * **The formatting lives HERE, beside the timestamp, and deliberately not in\n * the block.** By the time a date reaches the component it is already a\n * formatted string, and re-parsing one is ambiguous by construction: the same\n * `8/9/2026` reads as 9 August under an `en-US` runtime and 8 September under\n * `en-GB`. A byline that silently moves an article by three weeks is far worse\n * than one that is the wrong shape.\n *\n * `default` returns exactly `toLocaleDateString()` — the string this function\n * replaced, character for character — because the block is live on published\n * entries and opening a dropdown must not restyle them.\n *\n * ## Why the runtime gets no say (AGL-1926)\n *\n * Every branch pins BOTH the locale and the time zone, and the answer is a\n * pure function of the timestamp. It used to pass `locale` straight through\n * (normally `undefined`) with no `timeZone` at all, so the output was a\n * function of the RUNTIME: `en-US` + UTC on a Vercel server, the visitor's\n * own locale and zone in their browser. That is fine while only the server\n * ever calls it — the string is stamped into node props at compose time and\n * both sides then agree on it — but it makes the function a hydration\n * mismatch waiting for its first client-side caller, and `catch-all-client`\n * was exactly that caller. A post published at 02:30 UTC is dated the 10th by\n * the server and the 9th by every visitor west of Greenwich; React reports\n * the difference as a text mismatch (the live React #418 on tenant-web,\n * AGL-1926) and then reconciles against a DOM it no longer describes, which\n * is where the `removeChild`/`insertBefore` pair comes from.\n *\n * The pinned values are the ones production already emits, so no published\n * page changes: Vercel runs UTC with an `en-US` ICU default, which is why\n * every entry date served from aglyn.com today reads `8/9/2026`. Pinning\n * makes that byte-for-byte guaranteed instead of a property of the host.\n *\n * `locale` still exists for a caller that must render in a different one; it\n * now defaults to the value the server was picking implicitly rather than to\n * \"whatever this runtime happens to be\".\n */\nexport const COLLECTION_ENTRY_DATE_LOCALE = 'en-US'\n\n/**\n * The zone a calendar day is read in when a site has not named one.\n *\n * Entry timestamps are absolute instants; the day they are ATTRIBUTED to is\n * an editorial fact about the PUBLISHER, and `timeZone` below is how a site\n * states it. UTC remains the default because it is the answer every existing\n * site is already rendering — a site that never sets a zone must not have its\n * archive move by a day on deploy.\n *\n * ⚑ What AGL-1926 needed was not UTC, it was a zone BOTH SIDES AGREE ON. A\n * per-site zone is still that: it is resolved once, server-side, and travels\n * in the node props, so the client re-render reads the same string. What\n * would reopen the React #418 crash is reading the VISITOR's zone, because\n * only one side of the render knows it.\n */\nexport const COLLECTION_ENTRY_DATE_TIME_ZONE = 'UTC'\n\n/**\n * Is this a zone the runtime can actually format in (AGL-3237)?\n *\n * `Intl` is the only authority worth asking — an allowlist of IANA names goes\n * stale, and `toLocaleDateString` throws a RangeError on a name it does not\n * know, which would take down a composing page rather than mis-date one post.\n */\nexport function isSupportedTimeZone(value: unknown): boolean {\n const name = String(value ?? '').trim()\n if (!name) return false\n try {\n new Intl.DateTimeFormat('en-US', { timeZone: name })\n return true\n } catch {\n return false\n }\n}\n\n/**\n * Every zone this runtime can offer as a choice (AGL-3252).\n *\n * Read off `Intl` rather than checked in, for the reason\n * {@link isSupportedTimeZone} asks `Intl` rather than an allowlist: the IANA\n * database renames zones, and a stored list would offer names the runtime has\n * stopped accepting while missing ones it has learned. A picker built from\n * this and a validator built from that cannot disagree about what is\n * choosable.\n *\n * A memoized FUNCTION rather than a module constant: this module is imported\n * by the tenant page composer, which never draws a picker, and enumerating\n * four hundred zone names on import is work nothing there asks for.\n *\n * An old runtime without `supportedValuesOf` gets an EMPTY list rather than a\n * broken control — the callers offer their inherited-default option first, so\n * a picker with no zones in it still says what the site is doing.\n */\nlet supportedTimeZonesCache: readonly string[] | null = null\nexport function supportedTimeZones(): readonly string[] {\n if (supportedTimeZonesCache) return supportedTimeZonesCache\n try {\n supportedTimeZonesCache =\n (Intl as { supportedValuesOf?: (key: string) => string[] })\n .supportedValuesOf?.('timeZone') ?? []\n } catch {\n supportedTimeZonesCache = []\n }\n return supportedTimeZonesCache\n}\n\n/**\n * The zone a site's dates are read in (AGL-3237, AGL-3252).\n *\n * THE SITE WINS, then the workspace, then UTC. The organization names the\n * zone once and every site it owns inherits it — which is the answer a\n * customer with one site wants and never has to think about — and a site that\n * names its own overrides it, for the agency running a Chicago site and a\n * Berlin site out of one workspace. Neither set is UTC: the value every\n * existing site already renders, so nothing moves by a day when this ships.\n *\n * Each candidate is validated in turn rather than trusted, and an unusable\n * one FALLS THROUGH rather than terminating the chain: a stored zone can\n * predate an IANA rename, or be whatever a hand-edited document holds, and a\n * site whose own zone has gone stale should read in its workspace's rather\n * than jump to UTC.\n *\n * ⚑ AGL-3237 deferred the site half, on the reading that a `timeZone` on the\n * host document would need a Firestore rules change to go with it. It did\n * not. The host block's client branch is a `hasAny([…])` DENY list, so a\n * field it does not name is already writable by an editor; what the override\n * needed was a classification in `HOST_CLIENT_WRITABLE_FIELDS`, which is a\n * code change on the same commit rather than a rules deploy. The deferral was\n * a misreading of the guard, not a cost.\n */\nexport function resolveSiteTimeZone(\n org?: { timeZone?: string } | null,\n host?: { timeZone?: string } | null,\n): string {\n const siteZone = String(host?.timeZone ?? '').trim()\n if (isSupportedTimeZone(siteZone)) return siteZone\n const orgZone = String(org?.timeZone ?? '').trim()\n return isSupportedTimeZone(orgZone) ? orgZone : COLLECTION_ENTRY_DATE_TIME_ZONE\n}\n\nexport function formatCollectionEntryDate(\n publishedAt: { seconds: number } | null | undefined,\n format?: CollectionEntryDateFormat,\n locale: string = COLLECTION_ENTRY_DATE_LOCALE,\n /**\n * The site's zone (AGL-3237) — resolved once per render and passed down, so\n * server and client format the same instant into the same string.\n */\n timeZoneName: string = COLLECTION_ENTRY_DATE_TIME_ZONE,\n): string {\n const seconds = publishedAt?.seconds\n if (!seconds) return ''\n const date = new Date(seconds * 1000)\n // An unknown zone formats in UTC rather than throwing: this runs while a\n // page composes, and a RangeError here is a site that does not render.\n const timeZone = isSupportedTimeZone(timeZoneName)\n ? timeZoneName\n : COLLECTION_ENTRY_DATE_TIME_ZONE\n switch (normalizeCollectionEntryDateFormat(format)) {\n case 'monthYear':\n return date.toLocaleDateString(locale, {\n month: 'short',\n year: 'numeric',\n timeZone,\n })\n case 'mediumDate':\n return date.toLocaleDateString(locale, {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n timeZone,\n })\n case 'longDate':\n return date.toLocaleDateString(locale, {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n timeZone,\n })\n case 'iso': {\n // The calendar day IN THE SITE'S ZONE, not `toISOString()`'s slice by\n // luck and not the RUNTIME's local day: `getFullYear`/`getMonth`/\n // `getDate` read the host's zone, so this branch moved an entry by a\n // day depending on who rendered it. Read through the same formatter the\n // branches above use, so all four shapes name one day.\n const parts = new Intl.DateTimeFormat('en-US', {\n timeZone,\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n }).formatToParts(date)\n const part = (type: string) =>\n parts.find((entry) => entry.type === type)?.value ?? ''\n return `${part('year')}-${part('month')}-${part('day')}`\n }\n default:\n return date.toLocaleDateString(locale, { timeZone })\n }\n}\n\n/**\n * One entry's publish instant for a machine to read: an ISO 8601 date-time in\n * UTC, or `''` for an entry with no date (AGL-2956).\n *\n * {@link formatCollectionEntryDate} writes the date a READER sees, and every\n * one of its shapes is ambiguous or incomplete to a parser: `8/9/2026` is a\n * different day in `en-GB`, and even its `iso` shape is a calendar day with no\n * time or zone. A field that has to be parsed — a Video element's publication\n * date, which the page publishes as `VideoObject.uploadDate` — needs the\n * instant itself, spelled by `toISOString()` as `Article.datePublished` is.\n *\n * It reads the same `publishedAt` and treats a missing or zero `seconds` the\n * same way, so an entry is dated here exactly when it is dated there.\n *\n * A `seconds` no `Date` can hold answers `''` rather than throwing:\n * `toISOString` raises a RangeError on an invalid date, and this runs while a\n * page composes.\n */\nexport function collectionEntryPublishedAtIso(\n publishedAt: { seconds: number } | null | undefined,\n): string {\n const seconds = publishedAt?.seconds\n if (!seconds) return ''\n const date = new Date(seconds * 1000)\n return Number.isNaN(date.getTime()) ? '' : date.toISOString()\n}\n\n/**\n * The stored field the console's entries table sorts its Published column by\n * (AGL-3323): the instant {@link entryPublishSortStamp} names, kept on the\n * entry beside the two fields it is derived from.\n *\n * It exists because Firestore cannot sort on a fallback. `orderBy` reads one\n * field, and an entry that lacks it is not sorted last, it is left out of the\n * ordered read entirely. A scheduled entry has no `publishedAt` until it goes\n * live, so a table ordered on `publishedAt` could only append it after every\n * published entry — the last page, in both directions — while the cell above\n * it showed its `publishAt`. One stored field holding the date the cell shows\n * is the only shape an index can walk.\n *\n * It is a CONSOLE key. The public site's listings go on sorting and filtering\n * `publishedAt`, which only a live entry carries; this field must never become\n * what decides what a visitor sees, because a scheduled entry carries it too.\n */\nexport const ENTRY_PUBLISH_SORT_FIELD = 'publishSortAt'\n\n/**\n * The one instant an entry is listed under in the console (AGL-3206,\n * AGL-3323): its scheduled `publishAt` while it waits to go out, its\n * `publishedAt` otherwise, and `null` when it has neither.\n *\n * Scheduled wins over `publishedAt` because a SCHEDULED entry is not on the\n * site: scheduling a published entry takes it off the live set until the date\n * arrives, and it keeps the old `publishedAt` only until the runtime flips it\n * back and overwrites that with `publishAt`. The date it will go out on is\n * the true one for it.\n *\n * The `status` guard is load-bearing in the other direction too. A draft that\n * still holds a `publishAt` from a cancelled schedule is undated here rather\n * than sorting among the dated rows on a date it never displays.\n *\n * Every writer of `status`, `publishedAt` or `publishAt` stores this value\n * under {@link ENTRY_PUBLISH_SORT_FIELD} — and removes the field on `null` —\n * so the stored key and the rendered cell answer from the same rule.\n */\nexport function entryPublishSortStamp<T>(entry: {\n status?: unknown\n publishedAt?: T | null\n publishAt?: T | null\n} | null | undefined): T | null {\n if (entry?.status === 'scheduled' && entry.publishAt) return entry.publishAt\n return entry?.publishedAt ?? null\n}\n"],"names":["COLLECTION_ENTRY_DATE_FORMAT_DEFAULT","COLLECTION_ENTRY_DATE_FORMAT_OPTIONS","value","label","normalizeCollectionEntryDateFormat","wanted","String","trim","match","find","option","COLLECTION_ENTRY_DATE_LOCALE","COLLECTION_ENTRY_DATE_TIME_ZONE","isSupportedTimeZone","name","Intl","DateTimeFormat","timeZone","supportedTimeZonesCache","supportedTimeZones","supportedValuesOf","resolveSiteTimeZone","org","host","siteZone","orgZone","formatCollectionEntryDate","publishedAt","format","locale","timeZoneName","seconds","date","Date","toLocaleDateString","month","year","day","parts","formatToParts","part","type","entry","collectionEntryPublishedAtIso","Number","isNaN","getTime","toISOString","ENTRY_PUBLISH_SORT_FIELD","entryPublishSortStamp","status","publishAt"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;CASC,GAED;;;;;;;CAOC,GAID;;;;;;;;CAQC,GACD,OAAO,MAAMA,uCACX,UAAS;AAEX;;;;;;;CAOC,GACD,OAAO,MAAMC,uCAGP;IACJ;QAAEC,OAAO;QAAWC,OAAO;IAA0B;IACrD;QAAED,OAAO;QAAaC,OAAO;IAA4B;IACzD;QAAED,OAAO;QAAcC,OAAO;IAA2B;IACzD;QAAED,OAAO;QAAYC,OAAO;IAA6B;IACzD;QAAED,OAAO;QAAOC,OAAO;IAAmB;CAC3C,CAAA;AAED,yEAAyE,GACzE,OAAO,SAASC,mCACdF,KAAc;;IAEd,MAAMG,SAASC,OAAOJ,gBAAAA,QAAS,IAAIK,IAAI;IACvC,MAAMC,QAAQP,qCAAqCQ,IAAI,CACrD,CAACC,SAAWA,OAAOR,KAAK,KAAKG;IAE/B,eAAOG,yB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;;;;CAgBC,GACD,OAAO,MAAMC,2BAA2B,gBAAe;AAEvD;;;;;;;;;;;;;;;;;;CAkBC,GACD,OAAO,SAASC,sBAAyBP,KAIrB;;IAClB,IAAIA,CAAAA,yBAAAA,MAAOQ,MAAM,MAAK,eAAeR,MAAMS,SAAS,EAAE,OAAOT,MAAMS,SAAS;IAC5E,eAAOT,yBAAAA,MAAOf,WAAW,mBAAI;AAC/B"}
|
|
@@ -2774,7 +2774,7 @@ export const ASSIST_DOCS_INDEX = [
|
|
|
2774
2774
|
title: 'Build a blog',
|
|
2775
2775
|
heading: '2. Write entries',
|
|
2776
2776
|
anchor: '#2-write-entries',
|
|
2777
|
-
text: 'Add rich blog entries with images, a live preview, and scheduling so posts publish at the right time.\nNew entry, or clicking any row in the entries table, opens that entry on its own page. The page has its own address, so you can bookmark an entry you\'re mid-way through or paste the link to a colleague and they land on the same one. Back to entries — or your browser\'s Back button — returns to the list; if the entry has edits you haven\'t saved, you\'re asked before they\'re dropped.\nThe table opens with the most recently Published entries first. Click the Title, Status, Updated or Published header to sort by that column, and again to reverse it. Entries with nothing in the sorted column, such as a draft with no published date, follow the rest in either direction rather than dropping out. Filters in the table\'s toolbar narrows the list to one Status or one Category across the whole collection, not only the page you\'re on, and the filter in force shows as a chip above the table.\nEach entry carries, besides the title, excerpt, cover image, and markdown body:\n- Category — a single bucket (e.g. Guides) used for filtering and related posts, picked from the collection\'s category list (see below), never typed free-form.\n- Tags — comma-separated labels (e.g. nextjs, seo).\n- Author — the entry\'s byline: an author record from the Authors tab or a one-off custom byline. An entry needs one to be published or scheduled; a draft can be saved without it. See Authors.\n- SEO title / SEO description — search & social overrides; they fall back to the title and excerpt when blank.\n- Featured video — a film for the entry\'s
|
|
2777
|
+
text: 'Add rich blog entries with images, a live preview, and scheduling so posts publish at the right time.\nNew entry, or clicking any row in the entries table, opens that entry on its own page. The page has its own address, so you can bookmark an entry you\'re mid-way through or paste the link to a colleague and they land on the same one. Back to entries — or your browser\'s Back button — returns to the list; if the entry has edits you haven\'t saved, you\'re asked before they\'re dropped.\nThe table opens with the most recently Published entries first. A scheduled entry sorts by the date it\'s due to go out, so the next posts in your queue open the list, and when you reverse the column they come last among the dated entries. Click the Title, Status, Updated or Published header to sort by that column, and again to reverse it. Entries with nothing in the sorted column, such as a draft with no published date, follow the rest in either direction rather than dropping out. Filters in the table\'s toolbar narrows the list to one Status or one Category across the whole collection, not only the page you\'re on, and the filter in force shows as a chip above the table.\nEach entry carries, besides the title, excerpt, cover image, and markdown body:\n- Category — a single bucket (e.g. Guides) used for filtering and related posts, picked from the collection\'s category list (see below), never typed free-form.\n- Tags — comma-separated labels (e.g. nextjs, seo).\n- Author — the entry\'s byline: an author record from the Authors tab or a one-off custom byline. An entry needs one to be published or scheduled; a draft can be saved without it. See Authors.\n- SEO title / SEO description — search & social overrides; they fall back to the title and excerpt when blank.\n- Featured video — a film for the entry\'s'
|
|
2778
2778
|
},
|
|
2779
2779
|
{
|
|
2780
2780
|
path: '/building-sites/site-templates/build-a-blog',
|