@vespercms/admin 0.1.0-next.0 → 0.1.0-next.1

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,5 +1,5 @@
1
- import { B as e, R as t, n, pt as r, x as i, z as a } from "./shortcuts-B_JMAvF9.js";
2
- import { LinkDialog as o, n as s, t as c } from "./BodyEditor-CAGNfofv.js";
1
+ import { B as e, V as t, ht as n, n as r, x as i, z as a } from "./shortcuts-CarKeDqp.js";
2
+ import { LinkDialog as o, n as s, t as c } from "./BodyEditor-_mkh0BSQ.js";
3
3
  import { useEffect as l, useRef as u, useState as d } from "react";
4
4
  import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
5
5
  import { Extension as h } from "@tiptap/core";
@@ -110,7 +110,7 @@ function k(x) {
110
110
  "aria-describedby": [E, `${T}-md`].filter(Boolean).join(" "),
111
111
  ...D ? { "aria-invalid": "true" } : {},
112
112
  ...w.required ? { "aria-required": "true" } : {},
113
- class: r("vesper-body w-full px-3 py-2 text-body text-content outline-none", A ? "min-h-10" : "min-h-24")
113
+ class: n("vesper-body w-full px-3 py-2 text-body text-content outline-none", A ? "min-h-10" : "min-h-24")
114
114
  }
115
115
  },
116
116
  onCreate: ({ editor: e }) => {
@@ -141,7 +141,7 @@ function k(x) {
141
141
  "aria-invalid": D || void 0,
142
142
  "aria-required": w.required || void 0,
143
143
  disabled: k,
144
- className: r(i, "resize-y font-mono text-small")
144
+ className: n(i, "resize-y font-mono text-small")
145
145
  }), /* @__PURE__ */ p("p", {
146
146
  id: `${T}-md`,
147
147
  className: "text-small text-content-muted",
@@ -150,41 +150,41 @@ function k(x) {
150
150
  className: "flex flex-col gap-2",
151
151
  children: [
152
152
  /* @__PURE__ */ m("div", {
153
- className: r("rounded-md border border-border-strong bg-surface-raised", D && "border-danger", k && "opacity-60", "has-[.ProseMirror-focused]:outline-2 has-[.ProseMirror-focused]:outline-solid has-[.ProseMirror-focused]:outline-offset-2 has-[.ProseMirror-focused]:outline-focus", "has-[.ProseMirror-focused]:ring-6 has-[.ProseMirror-focused]:ring-(color:--glow-focus)"),
153
+ className: n("rounded-md border border-border-strong bg-surface-raised", D && "border-danger", k && "opacity-60", "has-[.ProseMirror-focused]:outline-2 has-[.ProseMirror-focused]:outline-solid has-[.ProseMirror-focused]:outline-offset-2 has-[.ProseMirror-focused]:outline-focus", "has-[.ProseMirror-focused]:ring-6 has-[.ProseMirror-focused]:ring-(color:--glow-focus)"),
154
154
  children: [/* @__PURE__ */ p("div", {
155
155
  ref: I,
156
156
  className: s,
157
- children: /* @__PURE__ */ m(e, {
157
+ children: /* @__PURE__ */ m(t, {
158
158
  label: `Formatting for ${w.label}`,
159
159
  children: [
160
- /* @__PURE__ */ p(t, {
160
+ /* @__PURE__ */ p(a, {
161
161
  icon: "bold",
162
162
  label: "Bold",
163
- shortcut: n("Mod", "B"),
163
+ shortcut: r("Mod", "B"),
164
164
  isDisabled: k,
165
165
  isSelected: z.bold,
166
166
  onChange: () => R.chain().focus().toggleBold().run()
167
167
  }),
168
- /* @__PURE__ */ p(t, {
168
+ /* @__PURE__ */ p(a, {
169
169
  icon: "italic",
170
170
  label: "Italic",
171
- shortcut: n("Mod", "I"),
171
+ shortcut: r("Mod", "I"),
172
172
  isDisabled: k,
173
173
  isSelected: z.italic,
174
174
  onChange: () => R.chain().focus().toggleItalic().run()
175
175
  }),
176
- /* @__PURE__ */ p(t, {
176
+ /* @__PURE__ */ p(a, {
177
177
  icon: "code",
178
178
  label: "Code",
179
- shortcut: n("Mod", "E"),
179
+ shortcut: r("Mod", "E"),
180
180
  isDisabled: k,
181
181
  isSelected: z.code,
182
182
  onChange: () => R.chain().focus().toggleCode().run()
183
183
  }),
184
- /* @__PURE__ */ p(a, {
184
+ /* @__PURE__ */ p(e, {
185
185
  icon: "link",
186
186
  label: z.link ? "Edit link" : "Link",
187
- shortcut: n("Mod", "K"),
187
+ shortcut: r("Mod", "K"),
188
188
  isDisabled: k,
189
189
  onPress: () => {
190
190
  P(!0);
@@ -1,4 +1,4 @@
1
- import { type CollectionManifest, type DataObject, type DataValue, type Manifest, type SchedulePresentation } from '@vespercms/core';
1
+ import { type CollectionManifest, type DataObject, type Manifest, type SchedulePresentation } from '@vespercms/core';
2
2
  /** When an entry goes live and comes down, and where its page sends visitors after. */
3
3
  export type ScheduleTimes = {
4
4
  publishAt?: Date;
@@ -21,8 +21,6 @@ export declare function timesOf(collection: CollectionManifest, values: DataObje
21
21
  * written out, as the date-time field keeps it.
22
22
  */
23
23
  export declare function withTimes(collection: CollectionManifest, values: DataObject, times: ScheduleTimes): DataObject;
24
- /** The entry's schedule as status words, or null when there's nothing to say. */
25
- export declare function scheduleWords(schedule: SchedulePresentation | undefined, data: DataValue, zone: string, now?: Date): string | null;
26
24
  /** An entry row's schedule (ISO times) as values under the schedule's field names. */
27
25
  export declare function rowData(schedule: SchedulePresentation | undefined, times: {
28
26
  publishAt?: string;
@@ -9,8 +9,6 @@ export declare function EntryList({ collection }: {
9
9
  collection: CollectionManifest;
10
10
  }): import("react").JSX.Element;
11
11
  export declare const TITLE_KEYS: Set<string>;
12
- /** An entry's status in words: what it is, then its schedule ("Draft · Scheduled · Sat, Oct 31, 8:00 AM"). */
13
- export declare function statusText(entry: Pick<EntrySummary, 'status' | 'draft'>, schedule?: string | null): string;
14
12
  /** A list field's value as short text. Dates at midnight UTC are calendar dates. */
15
13
  export declare function formatListValue(encoded: unknown): string;
16
14
  export declare function labelFor(collection: CollectionManifest, key: string): string;
@@ -0,0 +1,36 @@
1
+ import { type CollectionManifest, type DataValue, type Draft, type EntryStatus } from '@vespercms/core';
2
+ import { type StatusTone } from '@vespercms/ui';
3
+ export type EntryState = {
4
+ tone: StatusTone;
5
+ /** "Draft", "Scheduled", "Live" or "Unpublished". */
6
+ word: string;
7
+ /** What follows the word, its joiner included: " · Sat, Oct 31, 8:00 AM". */
8
+ rest: string;
9
+ };
10
+ /**
11
+ * What an entry is now. `times` is the entry's data with its schedule's
12
+ * fields, or null where they aren't known (a page tree's rows), which then
13
+ * never claims Live. Live is said only where an entry could be something
14
+ * else: a collection with a schedule or a `draft` field, or any in the cloud,
15
+ * where a new entry starts as a draft. Elsewhere every entry is live, and
16
+ * saying so on every row would only be noise.
17
+ */
18
+ export declare function entryState(collection: CollectionManifest, entry: {
19
+ draft: boolean;
20
+ times: DataValue | null;
21
+ newDraft?: boolean;
22
+ }, options: {
23
+ zone: string;
24
+ cloud: boolean;
25
+ now?: Date;
26
+ }): EntryState | null;
27
+ /** Whether a file is in a draft that would create it: in the cloud, an entry never published. */
28
+ export declare function isNewInDraft(drafts: readonly Draft[], path: string | undefined): boolean;
29
+ /** "Read only" or "Edit as YAML": what can be done with the entry, after its state. */
30
+ export declare function kindText(status: EntryStatus | undefined): string;
31
+ /** The state as plain words, for names and type-ahead. */
32
+ export declare function stateText(state: EntryState | null): string;
33
+ /** The state's word on its colour, then the words after it as text. */
34
+ export declare function StateWords({ state }: {
35
+ state: EntryState | null;
36
+ }): import("react").JSX.Element | null;