@scalemule/news-publication 0.0.52 → 0.0.53

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.
@@ -304,7 +304,10 @@ function PetSubmissionForm({
304
304
  } else void save();
305
305
  },
306
306
  children: [
307
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "paw-context", children: step === 0 ? "Your pet\u2019s story" : "Your private preview" }),
307
+ /* @__PURE__ */ jsxRuntime.jsxs("ol", { className: "paw-form-steps", "aria-label": "Submission progress", children: [
308
+ /* @__PURE__ */ jsxRuntime.jsx("li", { "aria-current": step === 0 ? "step" : void 0, children: "1. Their story" }),
309
+ /* @__PURE__ */ jsxRuntime.jsx("li", { "aria-current": step === 1 ? "step" : void 0, children: "2. Preview & permission" })
310
+ ] }),
308
311
  /* @__PURE__ */ jsxRuntime.jsx("h1", { children: kind === "celebration" && content.category === "memorial" ? "Remember a beloved companion." : "Someone worth meeting." }),
309
312
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "paw-safety", children: "Choose a community, never a home address. Keep phone numbers, email addresses and microchip details out of your story." }),
310
313
  step === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { PawMark } from './chunk-N4JMMFPK.js';
2
+ import { PawMark } from './chunk-KNO2LIDQ.js';
3
3
  import './chunk-4JRWZXAP.js';
4
4
  import './chunk-66GI2IX6.js';
5
5
  import { PET_PHOTO_CATEGORIES, PET_CELEBRATIONS, PET_SAFETY } from './chunk-AFJ6S5WJ.js';
@@ -199,7 +199,10 @@ function PetSubmissionForm({
199
199
  } else void save();
200
200
  },
201
201
  children: [
202
- /* @__PURE__ */ jsx("p", { className: "paw-context", children: step === 0 ? "Your pet\u2019s story" : "Your private preview" }),
202
+ /* @__PURE__ */ jsxs("ol", { className: "paw-form-steps", "aria-label": "Submission progress", children: [
203
+ /* @__PURE__ */ jsx("li", { "aria-current": step === 0 ? "step" : void 0, children: "1. Their story" }),
204
+ /* @__PURE__ */ jsx("li", { "aria-current": step === 1 ? "step" : void 0, children: "2. Preview & permission" })
205
+ ] }),
203
206
  /* @__PURE__ */ jsx("h1", { children: kind === "celebration" && content.category === "memorial" ? "Remember a beloved companion." : "Someone worth meeting." }),
204
207
  /* @__PURE__ */ jsx("p", { className: "paw-safety", children: "Choose a community, never a home address. Keep phone numbers, email addresses and microchip details out of your story." }),
205
208
  step === 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -122,26 +122,32 @@ function PetPreferencesForm({
122
122
  }
123
123
  )
124
124
  ] }),
125
- /* @__PURE__ */ jsxRuntime.jsxs("fieldset", { children: [
126
- /* @__PURE__ */ jsxRuntime.jsx("legend", { children: "Communities you follow" }),
127
- communities.map((c) => /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "paw-consent", children: [
128
- /* @__PURE__ */ jsxRuntime.jsx(
129
- "input",
130
- {
131
- type: "checkbox",
132
- checked: value.followed_area_ids.includes(c.id),
133
- onChange: (e) => setValue({
134
- ...value,
135
- followed_area_ids: e.target.checked ? [...value.followed_area_ids, c.id] : value.followed_area_ids.filter((id) => id !== c.id)
136
- })
137
- }
138
- ),
139
- c.name
140
- ] }, c.id))
125
+ /* @__PURE__ */ jsxRuntime.jsxs("details", { className: "paw-preference-details", children: [
126
+ /* @__PURE__ */ jsxRuntime.jsxs("summary", { children: [
127
+ "Communities you follow",
128
+ " ",
129
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: value.followed_area_ids.length ? `${value.followed_area_ids.length} selected` : "Choose communities" })
130
+ ] }),
131
+ /* @__PURE__ */ jsxRuntime.jsxs("fieldset", { className: "paw-community-choices", children: [
132
+ /* @__PURE__ */ jsxRuntime.jsx("legend", { className: "paw-sr-only", children: "Communities you follow" }),
133
+ communities.map((c) => /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "paw-consent", children: [
134
+ /* @__PURE__ */ jsxRuntime.jsx(
135
+ "input",
136
+ {
137
+ type: "checkbox",
138
+ checked: value.followed_area_ids.includes(c.id),
139
+ onChange: (e) => setValue({
140
+ ...value,
141
+ followed_area_ids: e.target.checked ? [...value.followed_area_ids, c.id] : value.followed_area_ids.filter((id) => id !== c.id)
142
+ })
143
+ }
144
+ ),
145
+ c.name
146
+ ] }, c.id))
147
+ ] })
141
148
  ] }),
142
- /* @__PURE__ */ jsxRuntime.jsxs("fieldset", { disabled: !notificationsReady, children: [
149
+ notificationsReady ? /* @__PURE__ */ jsxRuntime.jsxs("fieldset", { children: [
143
150
  /* @__PURE__ */ jsxRuntime.jsx("legend", { children: "Optional community updates" }),
144
- !notificationsReady && /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Community alerts are not active yet. No emails or alerts will be sent from these settings." }),
145
151
  PET_NOTIFICATION_CATEGORIES.map(([key, label]) => /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "paw-consent", children: [
146
152
  /* @__PURE__ */ jsxRuntime.jsx(
147
153
  "input",
@@ -185,7 +191,7 @@ function PetPreferencesForm({
185
191
  }
186
192
  )
187
193
  ] })
188
- ] }),
194
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "paw-safety", children: "Community alerts are not active yet. No community emails or alerts will be sent from these settings." }),
189
195
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "paw-safety", children: "Account and submission messages are separate from optional community updates. Sponsors never receive your profile or preferences." }),
190
196
  /* @__PURE__ */ jsxRuntime.jsx("button", { disabled: busy, children: "Save preferences" }),
191
197
  message && /* @__PURE__ */ jsxRuntime.jsx("p", { role: "status", children: message })
@@ -112,26 +112,32 @@ function PetPreferencesForm({
112
112
  }
113
113
  )
114
114
  ] }),
115
- /* @__PURE__ */ jsxs("fieldset", { children: [
116
- /* @__PURE__ */ jsx("legend", { children: "Communities you follow" }),
117
- communities.map((c) => /* @__PURE__ */ jsxs("label", { className: "paw-consent", children: [
118
- /* @__PURE__ */ jsx(
119
- "input",
120
- {
121
- type: "checkbox",
122
- checked: value.followed_area_ids.includes(c.id),
123
- onChange: (e) => setValue({
124
- ...value,
125
- followed_area_ids: e.target.checked ? [...value.followed_area_ids, c.id] : value.followed_area_ids.filter((id) => id !== c.id)
126
- })
127
- }
128
- ),
129
- c.name
130
- ] }, c.id))
115
+ /* @__PURE__ */ jsxs("details", { className: "paw-preference-details", children: [
116
+ /* @__PURE__ */ jsxs("summary", { children: [
117
+ "Communities you follow",
118
+ " ",
119
+ /* @__PURE__ */ jsx("span", { children: value.followed_area_ids.length ? `${value.followed_area_ids.length} selected` : "Choose communities" })
120
+ ] }),
121
+ /* @__PURE__ */ jsxs("fieldset", { className: "paw-community-choices", children: [
122
+ /* @__PURE__ */ jsx("legend", { className: "paw-sr-only", children: "Communities you follow" }),
123
+ communities.map((c) => /* @__PURE__ */ jsxs("label", { className: "paw-consent", children: [
124
+ /* @__PURE__ */ jsx(
125
+ "input",
126
+ {
127
+ type: "checkbox",
128
+ checked: value.followed_area_ids.includes(c.id),
129
+ onChange: (e) => setValue({
130
+ ...value,
131
+ followed_area_ids: e.target.checked ? [...value.followed_area_ids, c.id] : value.followed_area_ids.filter((id) => id !== c.id)
132
+ })
133
+ }
134
+ ),
135
+ c.name
136
+ ] }, c.id))
137
+ ] })
131
138
  ] }),
132
- /* @__PURE__ */ jsxs("fieldset", { disabled: !notificationsReady, children: [
139
+ notificationsReady ? /* @__PURE__ */ jsxs("fieldset", { children: [
133
140
  /* @__PURE__ */ jsx("legend", { children: "Optional community updates" }),
134
- !notificationsReady && /* @__PURE__ */ jsx("p", { children: "Community alerts are not active yet. No emails or alerts will be sent from these settings." }),
135
141
  PET_NOTIFICATION_CATEGORIES.map(([key, label]) => /* @__PURE__ */ jsxs("label", { className: "paw-consent", children: [
136
142
  /* @__PURE__ */ jsx(
137
143
  "input",
@@ -175,7 +181,7 @@ function PetPreferencesForm({
175
181
  }
176
182
  )
177
183
  ] })
178
- ] }),
184
+ ] }) : /* @__PURE__ */ jsx("p", { className: "paw-safety", children: "Community alerts are not active yet. No community emails or alerts will be sent from these settings." }),
179
185
  /* @__PURE__ */ jsx("p", { className: "paw-safety", children: "Account and submission messages are separate from optional community updates. Sponsors never receive your profile or preferences." }),
180
186
  /* @__PURE__ */ jsx("button", { disabled: busy, children: "Save preferences" }),
181
187
  message && /* @__PURE__ */ jsx("p", { role: "status", children: message })
@@ -341,6 +341,27 @@ function Shell({
341
341
  children
342
342
  ] });
343
343
  }
344
+ function LoadError({
345
+ error,
346
+ retry,
347
+ account
348
+ }) {
349
+ const status = error && typeof error === "object" && "status" in error ? error.status : void 0;
350
+ if (status === 401 || status === 403)
351
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "paw-load-error", role: "status", children: [
352
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { children: "Reconnect your community account." }),
353
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Your network sign-in gives you access to your pets across participating publications." }),
354
+ /* @__PURE__ */ jsxRuntime.jsx(petsForms.PetSignIn, { returnTo: retry })
355
+ ] });
356
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "paw-load-error", role: "status", children: [
357
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { children: "We couldn\u2019t open your pet community." }),
358
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: status === 429 ? "There have been several requests in a short time. Wait a moment, then try again." : "The connection is temporarily unavailable. Try loading this page again to continue." }),
359
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "paw-form-actions", children: [
360
+ /* @__PURE__ */ jsxRuntime.jsx("a", { className: "paw-button", href: retry, children: "Try again" }),
361
+ retry !== account && /* @__PURE__ */ jsxRuntime.jsx("a", { className: "paw-text-link", href: account, children: "Back to My pets" })
362
+ ] })
363
+ ] });
364
+ }
344
365
  async function PetAccountPage({
345
366
  scope,
346
367
  signedIn,
@@ -384,18 +405,18 @@ async function PetAccountPage({
384
405
  )
385
406
  ] });
386
407
  } catch (error) {
387
- body = error && typeof error === "object" && "status" in error && error.status === 403 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
388
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Connect your network sign-in to open this pet community." }),
389
- /* @__PURE__ */ jsxRuntime.jsx(petsForms.PetSignIn, { returnTo: paths.account })
390
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("p", { role: "status", children: "Your pets could not be loaded. Please try again shortly." });
408
+ body = /* @__PURE__ */ jsxRuntime.jsx(
409
+ LoadError,
410
+ {
411
+ error,
412
+ retry: paths.account,
413
+ account: paths.account
414
+ }
415
+ );
391
416
  }
392
417
  return /* @__PURE__ */ jsxRuntime.jsx(Shell, { paths, signedIn, children: /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "paw-story", children: [
393
418
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "paw-eyebrow", children: "Your community account" }),
394
- /* @__PURE__ */ jsxRuntime.jsxs("h1", { children: [
395
- "Your pets.",
396
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
397
- "Your little corner."
398
- ] }),
419
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { children: "A home for your pets." }),
399
420
  body
400
421
  ] }) });
401
422
  }
@@ -449,8 +470,11 @@ async function PetSubmitPage({
449
470
  accountUrl: paths.account
450
471
  }
451
472
  );
452
- } catch {
453
- form = /* @__PURE__ */ jsxRuntime.jsx("p", { role: "status", children: "This contribution could not be loaded. Open it from My pets or try again shortly." });
473
+ } catch (error) {
474
+ form = /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "paw-form", children: [
475
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { children: "Let\u2019s meet your pet." }),
476
+ /* @__PURE__ */ jsxRuntime.jsx(LoadError, { error, retry: next, account: paths.account })
477
+ ] });
454
478
  }
455
479
  return /* @__PURE__ */ jsxRuntime.jsx(Shell, { paths, children: form });
456
480
  }
@@ -1,4 +1,4 @@
1
- import { LostPetNotice, PetCelebrationCard, AdoptionListingCard, PetEventCard, PetProfileCard, PawMark } from './chunk-N4JMMFPK.js';
1
+ import { LostPetNotice, PetCelebrationCard, AdoptionListingCard, PetEventCard, PetProfileCard, PawMark } from './chunk-KNO2LIDQ.js';
2
2
  import './chunk-4JRWZXAP.js';
3
3
  import './chunk-66GI2IX6.js';
4
4
  import { petRequest } from './chunk-ABPJMDUG.js';
@@ -58,6 +58,27 @@ function Shell({
58
58
  children
59
59
  ] });
60
60
  }
61
+ function LoadError({
62
+ error,
63
+ retry,
64
+ account
65
+ }) {
66
+ const status = error && typeof error === "object" && "status" in error ? error.status : void 0;
67
+ if (status === 401 || status === 403)
68
+ return /* @__PURE__ */ jsxs("div", { className: "paw-load-error", role: "status", children: [
69
+ /* @__PURE__ */ jsx("h2", { children: "Reconnect your community account." }),
70
+ /* @__PURE__ */ jsx("p", { children: "Your network sign-in gives you access to your pets across participating publications." }),
71
+ /* @__PURE__ */ jsx(PetSignIn, { returnTo: retry })
72
+ ] });
73
+ return /* @__PURE__ */ jsxs("div", { className: "paw-load-error", role: "status", children: [
74
+ /* @__PURE__ */ jsx("h2", { children: "We couldn\u2019t open your pet community." }),
75
+ /* @__PURE__ */ jsx("p", { children: status === 429 ? "There have been several requests in a short time. Wait a moment, then try again." : "The connection is temporarily unavailable. Try loading this page again to continue." }),
76
+ /* @__PURE__ */ jsxs("div", { className: "paw-form-actions", children: [
77
+ /* @__PURE__ */ jsx("a", { className: "paw-button", href: retry, children: "Try again" }),
78
+ retry !== account && /* @__PURE__ */ jsx("a", { className: "paw-text-link", href: account, children: "Back to My pets" })
79
+ ] })
80
+ ] });
81
+ }
61
82
  async function PetAccountPage({
62
83
  scope,
63
84
  signedIn,
@@ -101,18 +122,18 @@ async function PetAccountPage({
101
122
  )
102
123
  ] });
103
124
  } catch (error) {
104
- body = error && typeof error === "object" && "status" in error && error.status === 403 ? /* @__PURE__ */ jsxs(Fragment, { children: [
105
- /* @__PURE__ */ jsx("p", { children: "Connect your network sign-in to open this pet community." }),
106
- /* @__PURE__ */ jsx(PetSignIn, { returnTo: paths.account })
107
- ] }) : /* @__PURE__ */ jsx("p", { role: "status", children: "Your pets could not be loaded. Please try again shortly." });
125
+ body = /* @__PURE__ */ jsx(
126
+ LoadError,
127
+ {
128
+ error,
129
+ retry: paths.account,
130
+ account: paths.account
131
+ }
132
+ );
108
133
  }
109
134
  return /* @__PURE__ */ jsx(Shell, { paths, signedIn, children: /* @__PURE__ */ jsxs("section", { className: "paw-story", children: [
110
135
  /* @__PURE__ */ jsx("p", { className: "paw-eyebrow", children: "Your community account" }),
111
- /* @__PURE__ */ jsxs("h1", { children: [
112
- "Your pets.",
113
- /* @__PURE__ */ jsx("br", {}),
114
- "Your little corner."
115
- ] }),
136
+ /* @__PURE__ */ jsx("h1", { children: "A home for your pets." }),
116
137
  body
117
138
  ] }) });
118
139
  }
@@ -166,8 +187,11 @@ async function PetSubmitPage({
166
187
  accountUrl: paths.account
167
188
  }
168
189
  );
169
- } catch {
170
- form = /* @__PURE__ */ jsx("p", { role: "status", children: "This contribution could not be loaded. Open it from My pets or try again shortly." });
190
+ } catch (error) {
191
+ form = /* @__PURE__ */ jsxs("section", { className: "paw-form", children: [
192
+ /* @__PURE__ */ jsx("h1", { children: "Let\u2019s meet your pet." }),
193
+ /* @__PURE__ */ jsx(LoadError, { error, retry: next, account: paths.account })
194
+ ] });
171
195
  }
172
196
  return /* @__PURE__ */ jsx(Shell, { paths, children: form });
173
197
  }