@realiizlabs/admin 0.15.1 → 0.15.3

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.
@@ -102,7 +102,7 @@ function isActive(item, activeHref, basePath) {
102
102
  if (item.href === basePath) return activeHref === basePath || activeHref === `${basePath}/`;
103
103
  return activeHref === item.href || activeHref.startsWith(`${item.href}/`);
104
104
  }
105
- function Sidebar({ items, pinned = [], activeHref, basePath }) {
105
+ function Sidebar({ items, pinned = [], activeHref, basePath, version }) {
106
106
  const [collapsed, setCollapsed] = react.useState(false);
107
107
  react.useEffect(() => {
108
108
  try {
@@ -157,7 +157,11 @@ function Sidebar({ items, pinned = [], activeHref, basePath }) {
157
157
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rz-sidebar__label", children: "Collapse" })
158
158
  ]
159
159
  }
160
- )
160
+ ),
161
+ version && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "rz-sidebar__version", title: `Studio ${version}`, children: [
162
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rz-sidebar__label", children: "Studio " }),
163
+ version
164
+ ] })
161
165
  ] });
162
166
  }
163
167
  function buttonClass(variant = "secondary", size = "md", extra) {
@@ -405,6 +409,8 @@ var SHELL_CSS = `
405
409
  .rz-sidebar__collapse:hover { color: var(--text-primary); }
406
410
  .rz-sidebar__collapse svg { flex-shrink: 0; }
407
411
  .rz-sidebar--collapsed .rz-sidebar__collapse { justify-content: center; padding: .6rem 0; }
412
+ .rz-sidebar__version { display: block; padding: 0 1rem .75rem; font-family: var(--rz-font-mono); font-size: .6875rem; letter-spacing: .04em; color: var(--text-muted); opacity: .8; white-space: nowrap; }
413
+ .rz-sidebar--collapsed .rz-sidebar__version { padding: 0 0 .75rem; text-align: center; }
408
414
  .rz-main { flex: 1; min-width: 0; }
409
415
  .rz-content { max-width: 1400px; margin: 0; padding: 28px 32px 80px; }
410
416
  .rz-content .realiiz-form { max-width: none; }
@@ -600,6 +606,7 @@ function AdminShell({
600
606
  siteUrl,
601
607
  branding,
602
608
  defaultTheme = "light",
609
+ version,
603
610
  children
604
611
  }) {
605
612
  const [theme, setTheme] = useTheme(defaultTheme);
@@ -626,7 +633,7 @@ function AdminShell({
626
633
  }
627
634
  ),
628
635
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rz-body", children: [
629
- showNav && /* @__PURE__ */ jsxRuntime.jsx(Sidebar, { items: nav, pinned: pinnedNav, activeHref, basePath }),
636
+ showNav && /* @__PURE__ */ jsxRuntime.jsx(Sidebar, { items: nav, pinned: pinnedNav, activeHref, basePath, version }),
630
637
  /* @__PURE__ */ jsxRuntime.jsx("main", { className: "rz-main", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rz-content", children }) })
631
638
  ] })
632
639
  ] });
@@ -708,6 +715,9 @@ function Tabs({ options, value, onChange, label = "Sections" }) {
708
715
  }) });
709
716
  }
710
717
 
718
+ // src/version.ts
719
+ var ADMIN_VERSION = "0.15.3" ;
720
+
711
721
  // src/studio-ui/css.ts
712
722
  var STUDIO_CSS = `
713
723
  /*
@@ -896,10 +906,11 @@ var STUDIO_CSS = `
896
906
  @media (prefers-reduced-motion: no-preference) { .rz-admin a:hover .rz-arrow--back { transform: translateX(-4px); } }
897
907
 
898
908
  /* ---- Studio update strip / Settings \u2192 Studio ---------------------------- */
899
- .rz-admin .rz-update { border: 1px solid var(--border); border-left: 3px solid var(--signal); border-radius: var(--rz-radius); background: var(--surface-1); padding: .7rem 1rem; }
900
- .rz-admin .rz-update--strip { margin: 0 0 1.25rem; }
901
- .rz-admin .rz-update__row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
902
- .rz-admin .rz-update__title { font-weight: 600; color: var(--text-primary); }
909
+ .rz-admin .rz-update { border: 1px solid color-mix(in srgb, var(--signal) 22%, var(--border)); border-radius: 8px; background: color-mix(in srgb, var(--signal) 5%, var(--surface-1)); padding: .75rem 1.1rem; }
910
+ .rz-admin .rz-update--strip { margin: 0 0 1.5rem; }
911
+ .rz-admin .rz-update__row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.1rem; }
912
+ .rz-admin .rz-update__title { display: inline-flex; align-items: center; gap: .55rem; font-weight: 600; color: var(--text-primary); }
913
+ .rz-admin .rz-update__title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 18%, transparent); }
903
914
  .rz-admin .rz-update__link { display: inline-flex; align-items: center; gap: .3rem; background: none; border: 0; padding: 0; font: inherit; font-size: .875rem; color: var(--signal); cursor: pointer; text-decoration: none; }
904
915
  .rz-admin .rz-update__link:hover { color: var(--text-primary); }
905
916
  .rz-admin .rz-update__later { margin-left: auto; background: none; border: 0; padding: 0; font: inherit; font-size: .8rem; color: var(--text-muted); cursor: pointer; }
@@ -999,11 +1010,7 @@ function UpdateBody({ update, onLater, compact = false }) {
999
1010
  ];
1000
1011
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `rz-update${compact ? " rz-update--strip" : ""}`, role: "status", children: [
1001
1012
  /* @__PURE__ */ jsxRuntime.jsx(Steps, { steps }),
1002
- live && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "rz-update__done", children: [
1003
- "Studio updated to ",
1004
- update.version,
1005
- ". Reload to see it."
1006
- ] })
1013
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rz-update__done", children: live ? `Studio ${update.version} is live. Reload and the version at the foot of the sidebar will change.` : "The version shown in Studio changes once the site has rebuilt." })
1007
1014
  ] });
1008
1015
  }
1009
1016
  const problem = outcome && outcome.state !== "pending" ? outcome.state === "stale" ? "The site changed since the checks ran. Try again in a minute." : outcome.state === "red" ? `The checks failed${outcome.failingCheck ? ` (${outcome.failingCheck})` : ""}. Your web team has been able to see this.` : outcome.state === "error" ? outcome.message : null : null;
@@ -1033,7 +1040,7 @@ function StudioShellFrame({ siteName, logoUrl, siteUrl = "/", user, role, nav, p
1033
1040
  }, [user]);
1034
1041
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1035
1042
  /* @__PURE__ */ jsxRuntime.jsx("style", { children: STUDIO_CSS }),
1036
- /* @__PURE__ */ jsxRuntime.jsxs(AdminShell, { siteName, logoUrl: logoUrl ?? void 0, siteUrl, user, role, nav, pinnedNav, branding, accountHref: null, activeHref: pathname, children: [
1043
+ /* @__PURE__ */ jsxRuntime.jsxs(AdminShell, { siteName, logoUrl: logoUrl ?? void 0, siteUrl, user, role, nav, pinnedNav, branding, accountHref: null, activeHref: pathname, version: ADMIN_VERSION, children: [
1037
1044
  /* @__PURE__ */ jsxRuntime.jsx(UpdateStrip, { update, role }),
1038
1045
  children
1039
1046
  ] })
@@ -3975,7 +3982,11 @@ function StudioTab({ update, version, role }) {
3975
3982
  supportName,
3976
3983
  " releases a new version, your site prepares the update as a checked change \u2014 the same way a blog post is checked before it goes live \u2014 and builds a private preview. Nothing changes until you press ",
3977
3984
  /* @__PURE__ */ jsxRuntime.jsx("b", { children: "Update" }),
3978
- ". If the update would break anything, the button never unlocks."
3985
+ ". If the update would break anything, the button never unlocks. Your site looks for new versions once a week, on Monday morning."
3986
+ ] }),
3987
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "acct-blurb", style: { marginTop: ".5rem" }, children: [
3988
+ /* @__PURE__ */ jsxRuntime.jsx("a", { href: "/admin/help#s-updates", children: "Everything about updates, in the Help center" }),
3989
+ " \u2014 when they arrive, what they can and can\u2019t change, and what to do if one fails."
3979
3990
  ] })
3980
3991
  ] })
3981
3992
  ] });
@@ -4015,6 +4026,7 @@ var HELP_SECTIONS = [
4015
4026
  { id: "markdown", title: "Writing in Markdown", blurb: "Headings, lists, links, tables \u2014 the formatting the editor understands." },
4016
4027
  { id: "events", title: "Events", blurb: "Dates, times, time zones, kinds, and what to do when plans change." },
4017
4028
  { id: "account", title: "Account & team", blurb: "Your profile, your password, who else can sign in, your branding." },
4029
+ { id: "updates", title: "Studio updates", blurb: "How new versions reach you, what the Update button does, and what could go wrong (not much)." },
4018
4030
  { id: "trouble", title: "Troubleshooting", blurb: "When something doesn't look right \u2014 what it means and what to do." }
4019
4031
  ];
4020
4032
 
@@ -4983,37 +4995,161 @@ Pictures save the moment you choose them (**Choose a picture**, **Replace**, **R
4983
4995
 
4984
4996
  In Studio's own secure storage \u2014 not in your website's files, so they don't go through Save/Publish.
4985
4997
  `
4986
- },
4998
+ }
4999
+ ];
5000
+
5001
+ // src/studio-ui/help/updates.ts
5002
+ var UPDATES = [
4987
5003
  {
4988
5004
  id: "updating-studio",
4989
- section: "account",
5005
+ section: "updates",
4990
5006
  title: "Updating Studio",
4991
5007
  summary: "When a new version is out, owners see a strip with what's new, a preview and an Update button. Nothing installs until you press it.",
4992
- keywords: ["update", "upgrade", "new version", "release", "what's new", "studio version"],
5008
+ keywords: ["update", "upgrade", "new version", "release", "what's new", "studio version", "update button"],
4993
5009
  body: `
4994
5010
  ## What it is
4995
5011
 
4996
- Studio is a small package inside your website, and it improves over time. When {supportName} releases a new version, your website prepares the update automatically as a **checked change** \u2014 exactly like a blog post is checked before it goes live \u2014 and builds a private preview of your site with the new Studio in it.
5012
+ Studio is a small package inside your website, and it improves over time \u2014 new features, small fixes, a nicer screen here and there. When {supportName} releases a new version, your website prepares it as a **checked change**, exactly like a blog post is checked before it goes live, and builds a private preview of your site with the new Studio in it.
4997
5013
 
4998
5014
  ## Where you see it
4999
5015
 
5000
- - A quiet strip at the top of every Studio page: **Studio 0.15 is available \xB7 What's new \xB7 Preview \xB7 Update \xB7 Later**. Only owners and {supportName} see it; editors don't.
5016
+ - A quiet strip at the top of every Studio page: **Studio 0.15.2 is available \xB7 What's new \xB7 Preview \xB7 Update \xB7 Later**. Only owners and {supportName} see it; editors don't.
5001
5017
  - **Settings \u2192 Studio**: the version you're running, the pending update with its notes, and the same Update button.
5018
+ - The version you're running is always printed in small type at the bottom of the sidebar, under **Collapse**.
5002
5019
 
5003
- The strip appears only once the update's checks have passed. If they fail, nothing is offered \u2014 {supportName} sees the failure and fixes it.
5020
+ The strip appears only once the update's checks have passed. If they fail, nothing is offered \u2014 {supportName} sees the failure and fixes it before you ever hear about it.
5004
5021
 
5005
5022
  ## How to update
5006
5023
 
5007
- 1. Read **What's new** (a few lines, plain English).
5024
+ 1. Read **What's new** \u2014 a few lines, plain English.
5008
5025
  2. Optional: press **Preview** to open your website running the new Studio.
5009
5026
  3. Press **Update**. The tracker shows *Updated \u2192 Live*; about two minutes later the website has rebuilt.
5010
- 4. Reload Studio to use the new version.
5027
+ 4. Reload Studio. The number at the bottom of the sidebar changes \u2014 that's how you know it landed.
5011
5028
 
5012
5029
  ## Good to know
5013
5030
 
5014
- - **Later** hides the strip for this browser tab; it comes back next time.
5015
- - Nothing on your public website changes because of a Studio update \u2014 only the dashboard does.
5031
+ - **Later** hides the strip for this browser tab; it comes back next time you open Studio.
5032
+ - Nothing on your public website changes because of a Studio update \u2014 only the dashboard does. Your posts, pictures and events are untouched.
5016
5033
  - You can't skip a version or go back from here; if something looks wrong after an update, tell {supportName}.
5034
+ `
5035
+ },
5036
+ {
5037
+ id: "when-updates-arrive",
5038
+ section: "updates",
5039
+ title: "When updates arrive",
5040
+ summary: "Once a week, on Monday morning. You don't have to check anything \u2014 if there's a new version, the strip is waiting.",
5041
+ keywords: ["monday", "schedule", "when", "how often", "weekly", "check for updates", "notification"],
5042
+ body: `
5043
+ ## The rhythm
5044
+
5045
+ Your website looks for a new Studio version **once a week, early Monday morning**. If there's one, it prepares the update, runs the checks, and the strip is waiting the next time an owner opens Studio. If there isn't one, nothing happens and you see nothing.
5046
+
5047
+ There's no button to press and nothing to install on your computer. You don't have to remember to look \u2014 if you don't see a strip, you're up to date.
5048
+
5049
+ ## Why weekly and not instantly
5050
+
5051
+ {supportName} may release more than one version in a week. Batching them means you get **one** update to read about and press, not three. It also means every release has been running on other sites for a few days before it's offered to you.
5052
+
5053
+ ## What if I'm away that Monday?
5054
+
5055
+ Nothing expires. The strip stays until an owner presses **Update** or a newer version replaces it \u2014 in which case the newer one is offered instead, and its notes cover everything since the version you're on.
5056
+
5057
+ ## Will I get an email?
5058
+
5059
+ No. Updates are quiet by design; the strip and **Settings \u2192 Studio** are the only places they appear. If an update is important enough to act on quickly, {supportName} will tell you directly.
5060
+ `
5061
+ },
5062
+ {
5063
+ id: "what-an-update-changes",
5064
+ section: "updates",
5065
+ title: "What an update does and doesn't change",
5066
+ summary: "The dashboard, yes. Your website's content, design and visitors' experience, no.",
5067
+ keywords: ["safe", "risk", "what changes", "content", "design", "visitors", "break", "downtime"],
5068
+ body: `
5069
+ ## What changes
5070
+
5071
+ The Studio dashboard \u2014 the screens you use at **/admin**. A new version might add a field to a form, improve the editor, fix something that was confusing, or add a Help article. **What's new** tells you exactly what, in a sentence or two.
5072
+
5073
+ ## What doesn't change
5074
+
5075
+ - **Your content.** Posts, pictures, events, pages: untouched. An update never edits, moves or deletes anything you've published or saved.
5076
+ - **Your website's design.** How {siteName} looks to visitors is separate from Studio. An update can't restyle your site.
5077
+ - **Your visitors' experience.** The website keeps running the whole time. There's no maintenance page and no downtime \u2014 the new version simply replaces the old one when the rebuild finishes, the same way a published post does.
5078
+ - **Your sign-ins and team.** Everyone keeps their access and role.
5079
+
5080
+ ## Why it's safe to press
5081
+
5082
+ Every update has already been built and checked against **your** website \u2014 not a generic one \u2014 before the strip appears. The **Preview** link is that exact build. If the checks had failed, you'd never have been offered it.
5083
+ `
5084
+ },
5085
+ {
5086
+ id: "update-questions",
5087
+ section: "updates",
5088
+ title: "Update questions, answered",
5089
+ summary: "Do I have to? Who can? Can I undo it? What if I press it twice? The short answers.",
5090
+ keywords: ["faq", "questions", "must i update", "who can update", "undo update", "roll back", "editors", "pressed twice"],
5091
+ body: `
5092
+ ## Do I have to update?
5093
+
5094
+ No \u2014 but you should. Updates are how fixes and improvements reach you, and each one has been checked against your site. If you'd rather wait, press **Later**; it'll be there when you come back.
5095
+
5096
+ ## Who can press Update?
5097
+
5098
+ Owners and {supportName}. Editors don't see the strip or the Settings \u2192 Studio tab at all, so a well-meaning teammate can't update the site by accident.
5099
+
5100
+ ## Can I see what's coming before I press it?
5101
+
5102
+ Yes, two ways: **What's new** shows the notes, and **Preview** opens your real website \u2014 with the new Studio installed \u2014 at a private address. Click around; nothing you do there affects the live site.
5103
+
5104
+ ## Can I undo an update?
5105
+
5106
+ Not from Studio. It's rarely needed, because an update can't touch your content, but if something looks wrong afterwards tell {supportName} \u2014 going back is a quick job for them.
5107
+
5108
+ ## I pressed Update and nothing seems different
5109
+
5110
+ Two things to check. First, the tracker: **Updated** means the update was accepted; **Live** means the website has finished rebuilding, which takes about two minutes. Second, reload Studio \u2014 the number at the bottom of the sidebar should now match the version the strip offered. Until the rebuild finishes you're still running the old one, which is normal.
5111
+
5112
+ ## I pressed Update twice
5113
+
5114
+ No harm done. The second press finds nothing to update and does nothing.
5115
+
5116
+ ## The strip disappeared before I pressed anything
5117
+
5118
+ Either another owner pressed Update, or a newer version arrived and replaced the offer. Either way, **Settings \u2192 Studio** shows what you're running now.
5119
+
5120
+ ## What does the version number mean?
5121
+
5122
+ Just a label \u2014 0.15.2 is newer than 0.15.1. The first two numbers change when a feature is added, the last one when something is fixed or polished. You don't need to track them; the strip does.
5123
+ `
5124
+ },
5125
+ {
5126
+ id: "update-problems",
5127
+ section: "updates",
5128
+ title: "When an update isn't offered, or fails",
5129
+ summary: "Settings \u2192 Studio says checking or failed; the Update button gave an error. What each means and who's handling it.",
5130
+ keywords: ["checks failed", "checking", "failed", "error", "not available", "stuck", "no update", "problem"],
5131
+ body: `
5132
+ ## Settings \u2192 Studio says "Checking\u2026"
5133
+
5134
+ A new version exists and your website is building a test copy with it. That takes a few minutes. The strip appears once the checks pass; you don't need to wait on the page.
5135
+
5136
+ ## Settings \u2192 Studio says "The checks failed"
5137
+
5138
+ The new version didn't build cleanly against your website. Nothing was installed and nothing on your site changed. **This is not something you need to fix** \u2014 {supportName} is told automatically and will either correct the release or adjust your site, after which the update is offered again. If it's still showing after a couple of days, mention it to them.
5139
+
5140
+ ## I pressed Update and got a message
5141
+
5142
+ - **"The site changed since the checks ran."** Someone published a post between the checks and your press. Wait a minute and press again \u2014 the checks re-run with the newest site.
5143
+ - **"The checks failed."** Same as above: a fresh check found a problem. {supportName} can see it.
5144
+ - **"That isn't a Studio update."** The offer you were looking at is no longer current \u2014 reload Studio for the latest one.
5145
+
5146
+ ## The tracker is stuck on "Live"
5147
+
5148
+ The rebuild usually takes about two minutes; occasionally the hosting service is slow and it takes ten. If the tracker says *taking longer than usual*, that's all it means. Leave the page and come back \u2014 the update is already accepted and will finish on its own.
5149
+
5150
+ ## I'm not seeing updates at all
5151
+
5152
+ Only owners see them, and only when one is ready. If you're an owner, it's been a few weeks, and {supportName} says a version has shipped, tell them \u2014 it's a one-minute check on their side.
5017
5153
  `
5018
5154
  }
5019
5155
  ];
@@ -5134,7 +5270,7 @@ Nothing you do in Studio can damage the live website \u2014 every edit is checke
5134
5270
  ];
5135
5271
 
5136
5272
  // src/studio-ui/help/index.ts
5137
- var HELP_ARTICLES = [...QUICK_START, ...PUBLISHING, ...BLOG, ...PICTURES, ...MARKDOWN, ...EVENTS, ...ACCOUNT, ...TROUBLE];
5273
+ var HELP_ARTICLES = [...QUICK_START, ...PUBLISHING, ...BLOG, ...PICTURES, ...MARKDOWN, ...EVENTS, ...ACCOUNT, ...UPDATES, ...TROUBLE];
5138
5274
  var GENERIC_VARS = { siteName: "your website", supportName: "your web team", types: "blog posts and events" };
5139
5275
  function joinTypes(labels) {
5140
5276
  if (labels.length === 0) return GENERIC_VARS.types;
@@ -5452,9 +5588,6 @@ function BackArrow() {
5452
5588
  ] });
5453
5589
  }
5454
5590
 
5455
- // src/version.ts
5456
- var ADMIN_VERSION = "0.15.1" ;
5457
-
5458
5591
  // src/studio-ui/types.ts
5459
5592
  var ACTION_NAMES = [
5460
5593
  "updateStudio",