@scalemule/news-publication 0.0.52 → 0.0.55

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.
@@ -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 })
@@ -338,7 +338,36 @@ function Shell({
338
338
  signedIn && /* @__PURE__ */ jsxRuntime.jsx(petsInteractions.PetSignOut, { returnTo: paths.home })
339
339
  ] })
340
340
  ] }),
341
- children
341
+ children,
342
+ /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: "paw-footer paw-page-footer", children: [
343
+ /* @__PURE__ */ jsxRuntime.jsxs("a", { href: paths.home, className: "paw-brand", children: [
344
+ /* @__PURE__ */ jsxRuntime.jsx(PawMark, { size: 28 }),
345
+ "Bay Area Paw"
346
+ ] }),
347
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Happier pets. Closer communities." }),
348
+ /* @__PURE__ */ jsxRuntime.jsx("a", { href: paths.home, children: "Back to your community" })
349
+ ] })
350
+ ] });
351
+ }
352
+ function LoadError({
353
+ error,
354
+ retry,
355
+ account
356
+ }) {
357
+ const status = error && typeof error === "object" && "status" in error ? error.status : void 0;
358
+ if (status === 401 || status === 403)
359
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "paw-load-error", role: "status", children: [
360
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { children: "Reconnect your community account." }),
361
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Your network sign-in gives you access to your pets across participating publications." }),
362
+ /* @__PURE__ */ jsxRuntime.jsx(petsForms.PetSignIn, { returnTo: retry })
363
+ ] });
364
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "paw-load-error", role: "status", children: [
365
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { children: "We couldn\u2019t open your pet community." }),
366
+ /* @__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." }),
367
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "paw-form-actions", children: [
368
+ /* @__PURE__ */ jsxRuntime.jsx("a", { className: "paw-button", href: retry, children: "Try again" }),
369
+ retry !== account && /* @__PURE__ */ jsxRuntime.jsx("a", { className: "paw-text-link", href: account, children: "Back to My pets" })
370
+ ] })
342
371
  ] });
343
372
  }
344
373
  async function PetAccountPage({
@@ -384,18 +413,18 @@ async function PetAccountPage({
384
413
  )
385
414
  ] });
386
415
  } 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." });
416
+ body = /* @__PURE__ */ jsxRuntime.jsx(
417
+ LoadError,
418
+ {
419
+ error,
420
+ retry: paths.account,
421
+ account: paths.account
422
+ }
423
+ );
391
424
  }
392
425
  return /* @__PURE__ */ jsxRuntime.jsx(Shell, { paths, signedIn, children: /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "paw-story", children: [
393
426
  /* @__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
- ] }),
427
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { children: "A home for your pets." }),
399
428
  body
400
429
  ] }) });
401
430
  }
@@ -449,8 +478,11 @@ async function PetSubmitPage({
449
478
  accountUrl: paths.account
450
479
  }
451
480
  );
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." });
481
+ } catch (error) {
482
+ form = /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "paw-form", children: [
483
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { children: "Let\u2019s meet your pet." }),
484
+ /* @__PURE__ */ jsxRuntime.jsx(LoadError, { error, retry: next, account: paths.account })
485
+ ] });
454
486
  }
455
487
  return /* @__PURE__ */ jsxRuntime.jsx(Shell, { paths, children: form });
456
488
  }
@@ -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-ZALGE4PF.js';
2
2
  import './chunk-4JRWZXAP.js';
3
3
  import './chunk-66GI2IX6.js';
4
4
  import { petRequest } from './chunk-ABPJMDUG.js';
@@ -55,7 +55,36 @@ function Shell({
55
55
  signedIn && /* @__PURE__ */ jsx(PetSignOut, { returnTo: paths.home })
56
56
  ] })
57
57
  ] }),
58
- children
58
+ children,
59
+ /* @__PURE__ */ jsxs("footer", { className: "paw-footer paw-page-footer", children: [
60
+ /* @__PURE__ */ jsxs("a", { href: paths.home, className: "paw-brand", children: [
61
+ /* @__PURE__ */ jsx(PawMark, { size: 28 }),
62
+ "Bay Area Paw"
63
+ ] }),
64
+ /* @__PURE__ */ jsx("p", { children: "Happier pets. Closer communities." }),
65
+ /* @__PURE__ */ jsx("a", { href: paths.home, children: "Back to your community" })
66
+ ] })
67
+ ] });
68
+ }
69
+ function LoadError({
70
+ error,
71
+ retry,
72
+ account
73
+ }) {
74
+ const status = error && typeof error === "object" && "status" in error ? error.status : void 0;
75
+ if (status === 401 || status === 403)
76
+ return /* @__PURE__ */ jsxs("div", { className: "paw-load-error", role: "status", children: [
77
+ /* @__PURE__ */ jsx("h2", { children: "Reconnect your community account." }),
78
+ /* @__PURE__ */ jsx("p", { children: "Your network sign-in gives you access to your pets across participating publications." }),
79
+ /* @__PURE__ */ jsx(PetSignIn, { returnTo: retry })
80
+ ] });
81
+ return /* @__PURE__ */ jsxs("div", { className: "paw-load-error", role: "status", children: [
82
+ /* @__PURE__ */ jsx("h2", { children: "We couldn\u2019t open your pet community." }),
83
+ /* @__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." }),
84
+ /* @__PURE__ */ jsxs("div", { className: "paw-form-actions", children: [
85
+ /* @__PURE__ */ jsx("a", { className: "paw-button", href: retry, children: "Try again" }),
86
+ retry !== account && /* @__PURE__ */ jsx("a", { className: "paw-text-link", href: account, children: "Back to My pets" })
87
+ ] })
59
88
  ] });
60
89
  }
61
90
  async function PetAccountPage({
@@ -101,18 +130,18 @@ async function PetAccountPage({
101
130
  )
102
131
  ] });
103
132
  } 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." });
133
+ body = /* @__PURE__ */ jsx(
134
+ LoadError,
135
+ {
136
+ error,
137
+ retry: paths.account,
138
+ account: paths.account
139
+ }
140
+ );
108
141
  }
109
142
  return /* @__PURE__ */ jsx(Shell, { paths, signedIn, children: /* @__PURE__ */ jsxs("section", { className: "paw-story", children: [
110
143
  /* @__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
- ] }),
144
+ /* @__PURE__ */ jsx("h1", { children: "A home for your pets." }),
116
145
  body
117
146
  ] }) });
118
147
  }
@@ -166,8 +195,11 @@ async function PetSubmitPage({
166
195
  accountUrl: paths.account
167
196
  }
168
197
  );
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." });
198
+ } catch (error) {
199
+ form = /* @__PURE__ */ jsxs("section", { className: "paw-form", children: [
200
+ /* @__PURE__ */ jsx("h1", { children: "Let\u2019s meet your pet." }),
201
+ /* @__PURE__ */ jsx(LoadError, { error, retry: next, account: paths.account })
202
+ ] });
171
203
  }
172
204
  return /* @__PURE__ */ jsx(Shell, { paths, children: form });
173
205
  }