@acryldev/blends-frame 0.2.12 → 0.2.13

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/lib/client.js CHANGED
@@ -140,7 +140,7 @@ window.__ModuleLoader__.load({
140
140
  /** @throws an Error naming the field when the answer is not a frame state. */
141
141
  function parseFrameState(value) {
142
142
  if (!isRecord$5(value)) throw new Error("frame state: not an object");
143
- const { appName, appRoot, appPage, branches, head, unsaved, upstreamHead } = value;
143
+ const { appName, appRoot, appPage, branches, head, unsaved, upstreamHead, appVersions } = value;
144
144
  if (typeof appName !== "string" || appName === "") throw new Error("frame state: appName");
145
145
  if (typeof appRoot !== "string" || appRoot === "") throw new Error("frame state: appRoot");
146
146
  if (appPage !== void 0 && (typeof appPage !== "string" || !appPage.startsWith("/"))) throw new Error("frame state: appPage");
@@ -148,6 +148,7 @@ window.__ModuleLoader__.load({
148
148
  if (head !== void 0 && (typeof head !== "string" || head === "")) throw new Error("frame state: head");
149
149
  if (unsaved !== void 0 && (typeof unsaved !== "number" || !Number.isInteger(unsaved) || unsaved < 0)) throw new Error("frame state: unsaved");
150
150
  if (upstreamHead !== void 0 && (typeof upstreamHead !== "string" || upstreamHead === "")) throw new Error("frame state: upstreamHead");
151
+ if (appVersions !== void 0 && (!isRecord$5(appVersions) || [appVersions.blend, appVersions.framework].some((v) => v !== void 0 && typeof v !== "string"))) throw new Error("frame state: appVersions");
151
152
  const parsed = branches.map((branch) => {
152
153
  if (!isRecord$5(branch) || typeof branch.name !== "string" || typeof branch.current !== "boolean") throw new Error("frame state: branch");
153
154
  return {
@@ -162,7 +163,8 @@ window.__ModuleLoader__.load({
162
163
  branches: parsed,
163
164
  ...head === void 0 ? {} : { head },
164
165
  ...unsaved === void 0 ? {} : { unsaved },
165
- ...upstreamHead === void 0 ? {} : { upstreamHead }
166
+ ...upstreamHead === void 0 ? {} : { upstreamHead },
167
+ ...appVersions === void 0 ? {} : { appVersions }
166
168
  };
167
169
  }
168
170
  const FRAME_PLUGINS_PATH = `${FRAME_API_PREFIX}/plugins`;
@@ -4280,6 +4282,8 @@ window.__ModuleLoader__.load({
4280
4282
  }, [switchRequest, view]);
4281
4283
  const appName = label ?? (state.status === "ready" ? state.state.appName : "");
4282
4284
  const barLabel = [versionLabel, state.status === "ready" ? savedLabel(state.state.unsaved) : void 0].filter((part) => part !== void 0).join(" · ");
4285
+ const appVersions = state.status === "ready" ? state.state.appVersions : void 0;
4286
+ const versionsLabel = [appVersions?.blend === void 0 ? void 0 : `Blend ${appVersions.blend}`, appVersions?.framework === void 0 ? void 0 : `ACRYL Blends ${appVersions.framework}`].filter((part) => part !== void 0).join(" · ");
4283
4287
  const preview = frameView.mode === "preview";
4284
4288
  const selected = useStore(selection).selection;
4285
4289
  (0, react.useEffect)(() => {
@@ -4367,6 +4371,11 @@ window.__ModuleLoader__.load({
4367
4371
  children: ["Not reloaded: ", appError]
4368
4372
  }),
4369
4373
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "acrylBlendsGrow" }),
4374
+ versionsLabel !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", {
4375
+ className: "acrylBlendsVersions",
4376
+ title: "Your Blend's version (blend.yaml) and the ACRYL Blends framework it runs on",
4377
+ children: versionsLabel
4378
+ }),
4370
4379
  !preview && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
4371
4380
  type: "button",
4372
4381
  className: "acrylBlendsSelectButton",
@@ -49678,6 +49687,8 @@ body[data-dsh-desktop-platform="darwin"] .acrylBlendsBar { padding-left: 78px; }
49678
49687
  .acrylBlendsAppName small { color: var(--bf-dim); font-weight: 400; margin-left: 6px; font-size: 12px; }
49679
49688
  .acrylBlendsAppError { min-width: 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--bf-error); }
49680
49689
  .acrylBlendsGrow { flex: 1; }
49690
+ .acrylBlendsVersions { color: var(--bf-dim); font-size: 11px; white-space: nowrap; margin-right: 8px; user-select: text; }
49691
+ @media (max-width: 640px) { .acrylBlendsVersions { display: none; } }
49681
49692
  .acrylBlendsIconButton { width: 28px; height: 26px; display: grid; place-items: center; border-radius: 6px; border: 0; background: transparent; color: var(--bf-text-2); cursor: pointer; }
49682
49693
  .acrylBlendsIconButton:hover:not(:disabled) { background: var(--bf-surface-2); }
49683
49694
  .acrylBlendsIconButton[aria-pressed="true"] { color: var(--bf-strong); background: var(--bf-surface-2); }