@scalio-cloud/ui 0.67.0 → 0.70.0

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/README.md CHANGED
@@ -749,6 +749,13 @@ markdownOutline(page.body) // [{ level, text, id }] for a table of contents; h
749
749
  `labels` overrides the callout titles (`{ note, tip, important, warning, caution }`). Also exported:
750
750
  `parseMarkdownBlocks`, `parseMarkdownInline`, `markdownHeadingId`, `safeHref`. Test IDs: `callout-<kind>`.
751
751
 
752
+ From 0.70.0: `pageLinks` reads `[[Title]]`, `[[KEY:Title]]` and `[[Title|text]]` as page links (shown as text with a
753
+ dotted line, `.scalio-md-pagelink`, unless the app renders them). `render={{ image, link, pagelink }}` puts the app's
754
+ own elements in: `image(node, key)`, `link(node, key, children)`, `pagelink(node, key)`; a function that returns
755
+ `undefined` keeps the building block's element (Folio: images of the space, router links, resolved page links). Also
756
+ `markdownPageLinks(text)` (every page link once, not in code), `markdownPageLinkKey(space, title)` and
757
+ `parseMarkdownPageLink(inner)`.
758
+
752
759
  ## shadcn/ui components (from 0.38.0)
753
760
 
754
761
  One copy of the shadcn/ui components the apps used to keep in `src/components/ui` (code-quality plan QA6, decision
package/nav.css CHANGED
@@ -139,6 +139,7 @@
139
139
  .scalio-switcher-item.is-active { background: #002FA7; color: #fff; }
140
140
  .scalio-switcher-item.is-off, .scalio-switcher-item.is-soon { cursor: not-allowed; }
141
141
  .scalio-switcher-item.is-soon { color: #52525b; }
142
+ .scalio-switcher-sep { width: 1px; height: 14px; margin: 0 0.375rem; background: #3f3f46; flex: none; }
142
143
  .scalio-switcher-icon { width: 0.75rem; height: 0.75rem; }
143
144
  .scalio-switcher-soon { margin-left: 0.125rem; padding: 0 0.25rem; border: 1px solid #3f3f46; border-radius: 2px; font-size: 9px; line-height: 14px; text-transform: none; letter-spacing: normal; color: #71717a; }
144
145
 
@@ -329,6 +330,21 @@
329
330
  .dark .scalio-notice.is-warn { --notice-tone: 245 158 11; }
330
331
  .dark .scalio-notice.is-error { --notice-tone: 248 113 113; }
331
332
  .dark .scalio-notice { background: rgb(var(--notice-tone) / 0.12); }
333
+ /* On/off switch: <input type="checkbox" role="switch" class="scalio-switch">, a slider like the shadcn Switch. */
334
+ .scalio-switch {
335
+ appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 2.75rem; height: 1.5rem; margin: 0;
336
+ border: 2px solid transparent; border-radius: 9999px; background: hsl(var(--input)); cursor: pointer;
337
+ transition: background-color 0.15s ease;
338
+ }
339
+ .scalio-switch::before {
340
+ content: ""; position: absolute; top: 0; left: 0; width: 1.25rem; height: 1.25rem; border-radius: 50%;
341
+ background: hsl(var(--background)); box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); transition: transform 0.15s ease;
342
+ }
343
+ .scalio-switch:checked { background: hsl(var(--primary)); }
344
+ .scalio-switch:checked::before { transform: translateX(1.25rem); }
345
+ .scalio-switch:disabled { cursor: not-allowed; opacity: 0.5; }
346
+ .scalio-switch:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
347
+ @media (prefers-reduced-motion: reduce) { .scalio-switch, .scalio-switch::before { transition: none; } }
332
348
  .scalio-badge {
333
349
  display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.0625rem 0.375rem; border: 1px solid; border-radius: 2px;
334
350
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap;
@@ -931,6 +947,7 @@ ul.scalio-notice { flex-direction: column; gap: 0.25rem; padding-left: 2rem; lis
931
947
  .scalio-md-h5, .scalio-md-h6 { font-size: 0.875rem; }
932
948
  .scalio-md-h6 { color: hsl(var(--muted-foreground)); }
933
949
  .scalio-md-link { color: hsl(var(--primary)); text-decoration: underline; }
950
+ .scalio-md-pagelink { text-decoration: underline dotted; }
934
951
  .scalio-md-code { padding: 0.125rem 0.25rem; border-radius: 2px; background: hsl(var(--secondary)); font-family: 'JetBrains Mono', monospace; font-size: 0.85em; }
935
952
  .scalio-md-pre { padding: 0.75rem; border-radius: 2px; background: hsl(var(--secondary)); font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; overflow-x: auto; white-space: pre; }
936
953
  .scalio-md-rule { border: 0; border-top: 1px solid hsl(var(--border)); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalio-cloud/ui",
3
- "version": "0.67.0",
3
+ "version": "0.70.0",
4
4
  "description": "Scalio Control Room design tokens, Tailwind preset, self-hosted fonts, the shared app header, sign-in layout, sidebar and page blocks",
5
5
  "license": "SEE LICENSE IN README.md",
6
6
  "private": false,
package/react/ai.js CHANGED
@@ -31,7 +31,7 @@ const LABELS = {
31
31
  title: "KI-Assistent",
32
32
  hint: "KI ist eine Option: Sie erklärt, fasst zusammen und schlägt vor. Was etwas ändert, bestätigen Sie immer selbst.",
33
33
  enable: "KI einschalten",
34
- enableHint: "Aus: alle KI-Funktionen sind ausgeblendet.",
34
+ enableHint: "Ausgeschaltet sind alle KI-Funktionen ausgeblendet.",
35
35
  statusOff: "Aus",
36
36
  statusReady: "Bereit",
37
37
  statusSetup: "Einrichtung nötig",
@@ -96,7 +96,7 @@ const LABELS = {
96
96
  title: "AI assistant",
97
97
  hint: "AI is optional: it explains, summarises and suggests. Anything that changes something you always confirm yourself.",
98
98
  enable: "Turn on AI",
99
- enableHint: "Off: all AI features are hidden.",
99
+ enableHint: "When off, all AI features are hidden.",
100
100
  statusOff: "Off",
101
101
  statusReady: "Ready",
102
102
  statusSetup: "Setup needed",
package/react/markdown.js CHANGED
@@ -129,14 +129,26 @@ function parseBlocks(src) {
129
129
  return blocks;
130
130
  }
131
131
 
132
- // code | image | link | bold | strike | italic | bare url
133
- const INLINE = /(`+)([\s\S]*?[^`])\1(?!`)|!\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|\*\*([\s\S]+?)\*\*|__([\s\S]+?)__|~~([\s\S]+?)~~|\*([^*\s][^*]*?)\*|(?<![\w])_([^_\s][^_]*?)_(?![\w])|(https?:\/\/[^\s<>()]+[^\s<>().,;:!?])/g;
132
+ // [[Title]], [[KEY:Title]] and [[Title|text]]: a link to another page by its title (Folio). KEY is a space key.
133
+ const PAGE_LINK = /^\s*(?:([A-Z][A-Z0-9]{1,9})\s*:\s*)?([^|]*?)\s*(?:\\?\|\s*(.*?)\s*)?$/; // \| in a table cell
134
+ function parsePageLink(inner) {
135
+ const m = String(inner || "").match(PAGE_LINK);
136
+ const title = m ? m[2].replace(/\s+/g, " ") : "";
137
+ return title ? { space: m[1] || "", title, label: m[3] || "" } : null;
138
+ }
139
+
140
+ // code | image | link | bold | strike | italic | bare url (| page link, only with the option pageLinks)
141
+ const INLINE_SRC = "(`+)([\\s\\S]*?[^`])\\1(?!`)|!\\[([^\\]]*)\\]\\(([^)\\s]+)(?:\\s+\"[^\"]*\")?\\)|\\[([^\\]]+)\\]\\(([^)\\s]+)(?:\\s+\"[^\"]*\")?\\)|\\*\\*([\\s\\S]+?)\\*\\*|__([\\s\\S]+?)__|~~([\\s\\S]+?)~~|\\*([^*\\s][^*]*?)\\*|(?<![\\w])_([^_\\s][^_]*?)_(?![\\w])|(https?:\\/\\/[^\\s<>()]+[^\\s<>().,;:!?])";
142
+ const INLINE = new RegExp(INLINE_SRC, "g");
143
+ const INLINE_PAGES = new RegExp(INLINE_SRC + "|\\[\\[([^[\\]\\n]+)\\]\\]", "g");
134
144
 
135
- function parseInline(src) {
145
+ // opts.pageLinks: [[...]] becomes {type: "pagelink", space, title, label} (else it stays text).
146
+ function parseInline(src, opts) {
147
+ const pages = !!(opts && opts.pageLinks);
136
148
  const out = [];
137
149
  const text = String(src || "");
138
150
  let last = 0;
139
- for (const m of text.matchAll(INLINE)) {
151
+ for (const m of text.matchAll(pages ? INLINE_PAGES : INLINE)) {
140
152
  if (m.index > last) out.push({ type: "text", text: text.slice(last, m.index) });
141
153
  if (m[1]) out.push({ type: "code", text: m[2].trim() ? m[2].replace(/^ (.*) $/, "$1") : m[2] });
142
154
  else if (m[4] !== undefined) {
@@ -144,11 +156,15 @@ function parseInline(src) {
144
156
  out.push(href ? { type: "image", alt: m[3], href } : { type: "text", text: m[0] });
145
157
  } else if (m[6] !== undefined) {
146
158
  const href = safeHref(m[6]);
147
- out.push(href ? { type: "link", href, children: parseInline(m[5]) } : { type: "text", text: m[5] });
148
- } else if (m[7] !== undefined || m[8] !== undefined) out.push({ type: "bold", children: parseInline(m[7] ?? m[8]) });
149
- else if (m[9] !== undefined) out.push({ type: "strike", children: parseInline(m[9]) });
150
- else if (m[10] !== undefined || m[11] !== undefined) out.push({ type: "italic", children: parseInline(m[10] ?? m[11]) });
159
+ out.push(href ? { type: "link", href, children: parseInline(m[5], opts) } : { type: "text", text: m[5] });
160
+ } else if (m[7] !== undefined || m[8] !== undefined) out.push({ type: "bold", children: parseInline(m[7] ?? m[8], opts) });
161
+ else if (m[9] !== undefined) out.push({ type: "strike", children: parseInline(m[9], opts) });
162
+ else if (m[10] !== undefined || m[11] !== undefined) out.push({ type: "italic", children: parseInline(m[10] ?? m[11], opts) });
151
163
  else if (m[12]) out.push({ type: "link", href: m[12], children: [{ type: "text", text: m[12] }] });
164
+ else if (m[13] !== undefined) {
165
+ const link = parsePageLink(m[13]);
166
+ out.push(link ? Object.assign({ type: "pagelink" }, link) : { type: "text", text: m[0] });
167
+ }
152
168
  last = m.index + m[0].length;
153
169
  }
154
170
  if (last < text.length) out.push({ type: "text", text: text.slice(last) });
@@ -165,8 +181,53 @@ function outline(src) {
165
181
  .map((b) => ({ level: b.level, text: b.text, id: headingId(b.text) }));
166
182
  }
167
183
 
184
+ const pageLinkKey = (space, title) => `${space || ""}:${String(title || "").trim().replace(/\s+/g, " ").toLowerCase()}`;
185
+
186
+ // Every [[page link]] of a text (not in code), once per space and title.
187
+ function pageLinks(src) {
188
+ const found = new Map();
189
+ const nodes = (ns) => ns.forEach((n) => {
190
+ if (n.type === "pagelink") { const k = pageLinkKey(n.space, n.title); if (!found.has(k)) found.set(k, { space: n.space, title: n.title }); }
191
+ else if (n.children) nodes(n.children);
192
+ });
193
+ const inl = (text) => nodes(parseInline(text, { pageLinks: true }));
194
+ const list = (l) => l.items.forEach((it) => { inl(it.text); if (it.children) list(it.children); });
195
+ const walk = (blocks) => blocks.forEach((b) => {
196
+ if (b.type === "heading" || b.type === "paragraph") inl(b.text);
197
+ else if (b.type === "list") list(b);
198
+ else if (b.type === "table") [b.head, ...b.rows].forEach((r) => r.forEach(inl));
199
+ else if (b.blocks) walk(b.blocks);
200
+ });
201
+ walk(parseBlocks(src));
202
+ return [...found.values()];
203
+ }
204
+
205
+ // The app's own elements (props.render): image(node, key), link(node, key, children), pagelink(node, key). A function
206
+ // that returns undefined leaves the building block's own element.
207
+ const Ctx = React.createContext({ render: {}, opts: null });
208
+
209
+ function own(ctx, kind, args) {
210
+ const fn = ctx.render && ctx.render[kind];
211
+ if (typeof fn !== "function") return undefined;
212
+ return fn.apply(null, args);
213
+ }
214
+
168
215
  function Inline(props) {
216
+ const ctx = React.useContext(Ctx);
169
217
  return h(React.Fragment, null, props.nodes.map((n, i) => {
218
+ if (n.type === "image") {
219
+ const mine = own(ctx, "image", [n, i]);
220
+ if (mine !== undefined) return mine;
221
+ }
222
+ if (n.type === "link") {
223
+ const mine = own(ctx, "link", [n, i, h(Inline, { nodes: n.children })]);
224
+ if (mine !== undefined) return mine;
225
+ }
226
+ if (n.type === "pagelink") {
227
+ const mine = own(ctx, "pagelink", [n, i]);
228
+ if (mine !== undefined) return mine;
229
+ return h("span", { key: i, className: "scalio-md-pagelink" }, n.label || n.title);
230
+ }
170
231
  if (n.type === "code") return h("code", { key: i, className: "scalio-md-code" }, n.text);
171
232
  if (n.type === "bold") return h("strong", { key: i }, h(Inline, { nodes: n.children }));
172
233
  if (n.type === "italic") return h("em", { key: i }, h(Inline, { nodes: n.children }));
@@ -183,7 +244,11 @@ function Inline(props) {
183
244
  }));
184
245
  }
185
246
 
186
- const inline = (text) => h(Inline, { nodes: parseInline(text) });
247
+ function InlineText(props) {
248
+ const ctx = React.useContext(Ctx);
249
+ return h(Inline, { nodes: parseInline(props.text, ctx.opts) });
250
+ }
251
+ const inline = (text) => h(InlineText, { text });
187
252
 
188
253
  function List(props) {
189
254
  const list = props.list;
@@ -223,11 +288,16 @@ function Blocks(props) {
223
288
  }));
224
289
  }
225
290
 
226
- // <Markdown text="..." lang="de" /> shows the text; labels.markdown overrides the callout titles.
291
+ // <Markdown text="..." lang="de" /> shows the text; labels.markdown overrides the callout titles. pageLinks reads
292
+ // [[...]] as page links; render = {image, link, pagelink} puts the app's own elements in (Folio: images of the space,
293
+ // router links, resolved page links).
227
294
  function Markdown(props) {
228
295
  const L = Object.assign({}, labelsFor(props.lang).markdown, props.labels);
229
- return h("div", { className: "scalio-md" + (props.className ? " " + props.className : ""), "data-testid": props.testId },
230
- h(Blocks, { blocks: parseBlocks(props.text), labels: L }));
296
+ const ctx = React.useMemo(() => ({ render: props.render || {}, opts: props.pageLinks ? { pageLinks: true } : null }),
297
+ [props.render, props.pageLinks]);
298
+ return h(Ctx.Provider, { value: ctx },
299
+ h("div", { className: "scalio-md" + (props.className ? " " + props.className : ""), "data-testid": props.testId },
300
+ h(Blocks, { blocks: parseBlocks(props.text), labels: L })));
231
301
  }
232
302
 
233
303
  module.exports = {
@@ -236,5 +306,8 @@ module.exports = {
236
306
  parseMarkdownInline: parseInline,
237
307
  markdownOutline: outline,
238
308
  markdownHeadingId: headingId,
309
+ markdownPageLinks: pageLinks,
310
+ markdownPageLinkKey: pageLinkKey,
311
+ parseMarkdownPageLink: parsePageLink,
239
312
  safeHref,
240
313
  };
package/react/nav.js CHANGED
@@ -304,18 +304,36 @@ function ContextSelect({ label, value, options, onChange, hint, after, testId, i
304
304
  }
305
305
 
306
306
  // --- Product switcher -------------------------------------------------------------------------
307
- // Display order of the app group. Compass is not part of it (decided 2026-10-26).
307
+ // Display order of the app group, in groups (Markus 2026-11-12): identity | M365 governance | devices and
308
+ // desktops | work. A thin divider separates the groups. Compass is not part of it (decided 2026-10-26).
308
309
  const PRODUCTS = [
309
- { key: "nexus", name: "Nexus", icon: Icons.Fingerprint },
310
- { key: "rosetta", name: "Rosetta", icon: Icons.FileStack },
311
- { key: "foundry", name: "Foundry", icon: Icons.Hammer },
312
- { key: "citadel", name: "Citadel", icon: Icons.ShieldCheck },
313
- { key: "beacon", name: "Beacon", icon: Icons.RadioTower },
314
- { key: "pulse", name: "Pulse", icon: Icons.Activity },
315
- { key: "folio", name: "Folio", icon: Icons.Library },
316
- { key: "atrium", name: "Atrium", icon: Icons.Monitor },
310
+ { key: "nexus", name: "Nexus", icon: Icons.Fingerprint, group: "identity" },
311
+ { key: "rosetta", name: "Rosetta", icon: Icons.FileStack, group: "governance" },
312
+ { key: "foundry", name: "Foundry", icon: Icons.Hammer, group: "governance" },
313
+ { key: "citadel", name: "Citadel", icon: Icons.ShieldCheck, group: "governance" },
314
+ { key: "pulse", name: "Pulse", icon: Icons.Activity, group: "devices" },
315
+ { key: "atrium", name: "Atrium", icon: Icons.Monitor, group: "devices" },
316
+ { key: "beacon", name: "Beacon", icon: Icons.RadioTower, group: "work" },
317
+ { key: "folio", name: "Folio", icon: Icons.Library, group: "work" },
317
318
  ];
318
319
 
320
+ // Each app opens in its own tab, named after the app: a second click finds that tab again instead of opening
321
+ // another one. The current tab takes the name of its app, so a tab opened from the switcher is found as well.
322
+ // Browsers only find tabs that are related (opened from one another); a tab the person opened by hand opens anew.
323
+ function switcherTarget(key) {
324
+ return `scalio-${key}`;
325
+ }
326
+
327
+ function nameCurrentTab(current) {
328
+ if (typeof window === "undefined" || !current) return;
329
+ try {
330
+ const name = window.name || "";
331
+ if (!name || name.startsWith("scalio-")) window.name = switcherTarget(current);
332
+ } catch (e) {
333
+ /* window.name is not writable in some sandboxes */
334
+ }
335
+ }
336
+
319
337
  function productStatus(product, current) {
320
338
  if (product.key === current) return "active";
321
339
  return product.soon ? "soon" : "available";
@@ -352,6 +370,16 @@ function scalioFeatures(answer) {
352
370
  function ProductSwitcher({ current, links, stage, sso, lang, labels, products, testId }) {
353
371
  const L = labelsFor(lang, labels);
354
372
  const badge = stageBadge(stage);
373
+ React.useEffect(() => nameCurrentTab(current), [current]);
374
+ const list = products || PRODUCTS;
375
+ const items = [];
376
+ list.forEach((product, i) => {
377
+ const prev = list[i - 1];
378
+ if (prev && product.group && prev.group && product.group !== prev.group) {
379
+ items.push(h("span", { key: `sep-${product.key}`, className: "scalio-switcher-sep", "aria-hidden": "true", "data-testid": "switcher-separator" }));
380
+ }
381
+ items.push(product);
382
+ });
355
383
  return h(
356
384
  "div",
357
385
  { className: "scalio-switcher", "data-testid": testId || "scalio-product-switcher" },
@@ -359,7 +387,8 @@ function ProductSwitcher({ current, links, stage, sso, lang, labels, products, t
359
387
  badge
360
388
  ? h("span", { className: `scalio-stage scalio-stage-${stage}`, title: L.stageHint, "data-testid": "scalio-stage-badge", "data-stage": stage }, badge)
361
389
  : null,
362
- (products || PRODUCTS).map((product) => {
390
+ items.map((product) => {
391
+ if (React.isValidElement(product)) return product;
363
392
  const status = productStatus(product, current);
364
393
  const Icon = product.icon;
365
394
  const href = switcherHref(product, links, sso, current);
@@ -370,7 +399,7 @@ function ProductSwitcher({ current, links, stage, sso, lang, labels, products, t
370
399
  status === "soon" ? h("span", { key: "s", className: "scalio-switcher-soon", "data-testid": `product-soon-${product.key}` }, L.soon) : null,
371
400
  ];
372
401
  if (href) {
373
- return h("a", Object.assign({ href, title: L.switchTo, className: "scalio-switcher-item is-link" }, common), content);
402
+ return h("a", Object.assign({ href, target: switcherTarget(product.key), title: L.switchTo, className: "scalio-switcher-item is-link" }, common), content);
374
403
  }
375
404
  const title = status === "active" ? L.activeApp : status === "soon" ? L.comingSoon : L.notSetUp;
376
405
  return h(