@phis/ui 0.6.5 → 0.6.7

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.
Files changed (43) hide show
  1. package/components/controls/phi-image-control.js +9 -1
  2. package/components/forms/auth-admin-settings-labels.d.ts +4 -0
  3. package/components/forms/auth-admin-settings-labels.js +11 -3
  4. package/components/forms/form-provider-contract.d.ts +1 -1
  5. package/components/forms/form-provider-contract.js +1 -1
  6. package/components/media/picture-surface.d.ts +15 -0
  7. package/components/media/picture-surface.js +26 -0
  8. package/components/motion/phi-sequence-run.d.ts +6 -1
  9. package/components/motion/phi-sequence-run.js +2 -2
  10. package/components/navigation/phi-link.d.ts +7 -1
  11. package/components/navigation/phi-link.js +6 -2
  12. package/components/root/phi-root-theme-resolver.js +2 -0
  13. package/components/widgets/client/shared/phi-rendered-value.js +1 -1
  14. package/components/widgets/label-sets/account.js +6 -2
  15. package/components/widgets/label-sets/effects.js +5 -1
  16. package/components/widgets/shared/markdown-body-client.js +1 -1
  17. package/package.json +1 -1
  18. package/plugins/runtime-modules/auth/admin-settings-forms.js +47 -1
  19. package/plugins/runtime-modules/auth/data-providers.js +2 -0
  20. package/plugins/runtime-modules/core/definition.d.ts +1 -1
  21. package/plugins/runtime-modules/core/form-providers.d.ts +1 -1
  22. package/plugins/runtime-modules/core/widgets/breadcrumb/config.js +1 -1
  23. package/plugins/runtime-modules/core/widgets/cascader/config.js +1 -1
  24. package/plugins/runtime-modules/core/widgets/gallery/client.js +9 -1
  25. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -0
  26. package/plugins/runtime-modules/core/widgets/gallery/config.js +5 -0
  27. package/plugins/runtime-modules/core/widgets/image/client.js +6 -10
  28. package/plugins/runtime-modules/core/widgets/image/config.d.ts +1 -53
  29. package/plugins/runtime-modules/core/widgets/image/config.js +6 -17
  30. package/plugins/runtime-modules/core/widgets/record/config.js +1 -1
  31. package/plugins/runtime-modules/core/widgets/simple-text/client.js +1 -1
  32. package/plugins/runtime-modules/core/widgets/table/config.js +1 -1
  33. package/plugins/runtime-modules/theme/brand-theme-model.d.ts +4 -1
  34. package/plugins/runtime-modules/theme/brand-theme-model.js +6 -2
  35. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +17 -0
  36. package/plugins/runtime-modules/threads/labels.js +6 -2
  37. package/styles/controls.css +20 -0
  38. package/theme/phi-link-mark.d.ts +26 -0
  39. package/theme/phi-link-mark.js +26 -0
  40. package/theme/phi-theme-tokens.d.ts +3 -2
  41. package/theme/phi-theme-tokens.js +3 -1
  42. package/types/core-widget-placements.d.ts +0 -4
  43. package/types/site-config.d.ts +3 -0
@@ -34,10 +34,18 @@ export function PhiImageControl({ presentation, source, alt, title, width, heigh
34
34
  const drawnHeight = height ?? presentation.height;
35
35
  const blur = source === "asset" ? blurDataUrl ?? null : null;
36
36
  const loaded = loadedUrl === url;
37
+ /*
38
+ * A box of two numbers keeps their proportion rather than their height: where its column is narrower
39
+ * than the width and `maxWidth` takes it in, the height comes down with it. A fixed height would stay
40
+ * and leave the picture a tall strip, with air above and below what stands beside it.
41
+ */
42
+ const proportion = typeof drawnWidth === "number" && typeof drawnHeight === "number" && drawnWidth > 0 && drawnHeight > 0
43
+ ? `${drawnWidth} / ${drawnHeight}`
44
+ : undefined;
37
45
  const boxStyle = {
38
46
  position: presentation.simulatedCropStyle ? "relative" : undefined,
39
47
  width: toCssSize(drawnWidth) ?? "100%",
40
- height: toCssSize(drawnHeight),
48
+ ...(proportion ? { height: "auto", aspectRatio: proportion } : { height: toCssSize(drawnHeight) }),
41
49
  maxWidth: "100%",
42
50
  lineHeight: 0,
43
51
  overflow: presentation.simulatedCropStyle ? "hidden" : undefined,
@@ -122,6 +122,10 @@ export declare function getPhiAuthAdminSettingsLabels(options: PhiGlobalTranslat
122
122
  clientIdRequired: string;
123
123
  tenant: string;
124
124
  tenantPlaceholder: string;
125
+ teamId: string;
126
+ teamIdHint: string;
127
+ keyId: string;
128
+ keyIdHint: string;
125
129
  clientSecret: string;
126
130
  secretStatusConfigured: string;
127
131
  secretStatusMissing: string;
@@ -48,16 +48,20 @@ const PHI_AUTH_ADMIN_SETTINGS_LABEL_SET = definePhiLabelSet({
48
48
  provider_client_secret_label: "Client secret",
49
49
  provider_secret_status_configured: "configured",
50
50
  provider_secret_status_missing: "missing",
51
- provider_secret_hint: definePhiMessageLabel("Leave empty to keep the currently stored secret."),
51
+ provider_secret_hint: definePhiMessageLabel("Leave empty to keep the currently stored secret. For Apple, the contents of the .p8 key file."),
52
+ provider_team_id_label: "Team ID",
53
+ provider_team_id_hint: definePhiMessageLabel("The ten characters shown at the top right of the Apple Developer account."),
54
+ provider_key_id_label: "Key ID",
55
+ provider_key_id_hint: definePhiMessageLabel("The ten characters of the Sign in with Apple key under Keys."),
52
56
  provider_enabled_label: "Installation enabled",
53
57
  provider_login_enabled_label: "Offer on login",
54
58
  provider_sort_order_label: "Order",
55
59
  provider_scopes_label: "Scopes",
56
- provider_scopes_hint: definePhiMessageLabel("Space separated. Empty asks the provider for the login defaults: read:user user:email at GitHub, openid email profile elsewhere."),
60
+ provider_scopes_hint: definePhiMessageLabel("Space separated. Empty asks the provider for the login defaults: read:user user:email at GitHub, openid email at Apple, openid email profile elsewhere."),
57
61
  provider_restrictions_label: "Restrict sign-in to",
58
62
  provider_restrictions_hint: definePhiMessageLabel("Space separated, and empty admits everyone the provider admits. GitHub organizations for GitHub, hosted domains for Google; an organization needs read:org in the scopes as well."),
59
63
  provider_prompt_label: "Prompt",
60
- provider_prompt_hint: definePhiMessageLabel("OpenID providers only: login, consent, or select_account. GitHub has no such setting."),
64
+ provider_prompt_hint: definePhiMessageLabel("Google and Microsoft only: login, consent, or select_account."),
61
65
  provider_trusted_email_link_label: "Trust for email linking",
62
66
  provider_trusted_email_link_hint: definePhiMessageLabel("Lets a verified address from this provider join an existing account without a further proof, where the site policy allows it. Only for a provider that verifies addresses itself."),
63
67
  provider_save_label: "Save",
@@ -197,6 +201,10 @@ export async function getPhiAuthAdminSettingsLabels(options) {
197
201
  clientIdRequired: labels.provider_client_id_required,
198
202
  tenant: labels.provider_tenant_label,
199
203
  tenantPlaceholder: labels.provider_tenant_placeholder,
204
+ teamId: labels.provider_team_id_label,
205
+ teamIdHint: labels.provider_team_id_hint,
206
+ keyId: labels.provider_key_id_label,
207
+ keyIdHint: labels.provider_key_id_hint,
200
208
  clientSecret: labels.provider_client_secret_label,
201
209
  secretStatusConfigured: labels.provider_secret_status_configured,
202
210
  secretStatusMissing: labels.provider_secret_status_missing,
@@ -299,7 +299,7 @@ export declare const PHI_SHARED_FORM_FIELD_TYPE_PROVIDER_DESCRIPTORS: readonly [
299
299
  }, {
300
300
  readonly key: "separator";
301
301
  readonly type: "string";
302
- readonly label: "Separator";
302
+ readonly label: "Separator character";
303
303
  }, {
304
304
  readonly key: "rootValue";
305
305
  readonly type: "string";
@@ -166,7 +166,7 @@ export const PHI_SHARED_FORM_FIELD_TYPE_PROVIDER_DESCRIPTORS = [
166
166
  presentation: "control",
167
167
  settingsFields: [
168
168
  { key: "allowRoot", type: "boolean", label: "Allow Root" },
169
- { key: "separator", type: "string", label: "Separator" },
169
+ { key: "separator", type: "string", label: "Separator character" },
170
170
  { key: "rootValue", type: "string", label: "Root Value" },
171
171
  {
172
172
  key: "normalize",
@@ -0,0 +1,15 @@
1
+ import type { CSSProperties } from "react";
2
+ import type { PhiSurface } from "../../types/surface";
3
+ /**
4
+ * The Surface of a picture, as the Image and the Gallery Widget draw it on their own box.
5
+ *
6
+ * A picture is a surface on the page: where its Surface states no corner -- or it has none -- it takes
7
+ * the Site's surface step, as a Layout's and a Markdown picture's do (THEME.md "Control shape"). Its
8
+ * ground stays on the box rather than on a layer of its own, because a picture fills the box and covers
9
+ * it; a ground shows only behind a transparent picture or around one that is contained. A tone has
10
+ * nothing to turn on a picture and is not drawn.
11
+ */
12
+ export declare function resolvePhiPictureSurface(surface: PhiSurface | null | undefined): {
13
+ style: CSSProperties;
14
+ corners: CSSProperties;
15
+ };
@@ -0,0 +1,26 @@
1
+ import { PHI_LAYOUT_SURFACE_RADIUS } from "../layouts/phi-layout-contract";
2
+ import { resolvePhiSurfaceStyle } from "../../helpers/surface-style";
3
+ /**
4
+ * The Surface of a picture, as the Image and the Gallery Widget draw it on their own box.
5
+ *
6
+ * A picture is a surface on the page: where its Surface states no corner -- or it has none -- it takes
7
+ * the Site's surface step, as a Layout's and a Markdown picture's do (THEME.md "Control shape"). Its
8
+ * ground stays on the box rather than on a layer of its own, because a picture fills the box and covers
9
+ * it; a ground shows only behind a transparent picture or around one that is contained. A tone has
10
+ * nothing to turn on a picture and is not drawn.
11
+ */
12
+ export function resolvePhiPictureSurface(surface) {
13
+ const { style } = resolvePhiSurfaceStyle(surface ?? {}, {
14
+ cornerFallback: PHI_LAYOUT_SURFACE_RADIUS,
15
+ groundLayer: false,
16
+ });
17
+ return {
18
+ style,
19
+ corners: {
20
+ borderTopLeftRadius: style.borderTopLeftRadius,
21
+ borderTopRightRadius: style.borderTopRightRadius,
22
+ borderBottomRightRadius: style.borderBottomRightRadius,
23
+ borderBottomLeftRadius: style.borderBottomLeftRadius,
24
+ },
25
+ };
26
+ }
@@ -24,12 +24,17 @@ export type PhiSequenceThumbnail = {
24
24
  *
25
25
  * What the items are is the caller's: the Gallery's pictures, the Entries list's cards.
26
26
  */
27
- export declare function PhiSequenceRun({ items, settings, labels, itemStyle, thumbnails, thumbnailWidth, }: {
27
+ export declare function PhiSequenceRun({ items, settings, labels, itemStyle, windowStyle, thumbnails, thumbnailWidth, }: {
28
28
  /** Keyed by the caller; the run neither wraps nor rekeys them. */
29
29
  items: readonly ReactNode[];
30
30
  settings: PhiSequenceSettings | undefined;
31
31
  labels: PhiSequenceControlLabels;
32
32
  itemStyle?: CSSProperties;
33
+ /**
34
+ * The window the items run in, with the arrows on it: where a caller's Surface goes (the Gallery's),
35
+ * so its depth stands around what is seen rather than being cut off with the items outside it.
36
+ */
37
+ windowStyle?: CSSProperties;
33
38
  /**
34
39
  * A row of buttons under the window, one per item, in place of the dots. Acts only while one item is
35
40
  * shown at a time; the active item's is marked and a press makes its item the active one.
@@ -37,7 +37,7 @@ function resolvePhiSequenceShowsThumbnails(thumbnails, span, itemCount) {
37
37
  *
38
38
  * What the items are is the caller's: the Gallery's pictures, the Entries list's cards.
39
39
  */
40
- export function PhiSequenceRun({ items, settings, labels, itemStyle, thumbnails, thumbnailWidth, }) {
40
+ export function PhiSequenceRun({ items, settings, labels, itemStyle, windowStyle, thumbnails, thumbnailWidth, }) {
41
41
  const { token } = usePhiConfig();
42
42
  const defaults = PHI_SEQUENCE_SETTINGS_DEFAULTS;
43
43
  const loop = settings?.loop ?? defaults.loop;
@@ -76,7 +76,7 @@ export function PhiSequenceRun({ items, settings, labels, itemStyle, thumbnails,
76
76
  const showArrows = (controls === "arrows" || controls === "both") && itemCount > span;
77
77
  const showThumbnails = resolvePhiSequenceShowsThumbnails(thumbnails, span, itemCount);
78
78
  const showDots = !showThumbnails && (controls === "dots" || controls === "both") && pageCount > 1;
79
- return (_jsxs("div", { role: "region", "aria-roledescription": "carousel", "aria-label": labels.region, style: { display: "flex", flexDirection: "column", gap: token.marginXS, width: "100%", minWidth: 0, ...gestures.style }, ...autoplay.holdHandlers, ...gestures.handlers, children: [_jsxs("div", { style: { position: "relative", minWidth: 0 }, "aria-live": autoplay.running ? "off" : "polite", children: [_jsx(PhiSequenceViewport, { items: [...items], activeIndex: activeIndex, visibleCount: span, anchor: "start", transition: settings?.transition ?? defaults.transition, ...(settings?.durationMs === undefined ? {} : { durationMs: settings.durationMs }), ...(settings?.easing === undefined ? {} : { easing: settings.easing }), lookahead: settings?.lookahead ?? defaults.lookahead, mountPolicy: settings?.mountPolicy ?? defaults.mountPolicy, gap: resolvePhiSpacingScaleValue(settings?.gap ?? defaults.gap), itemStyle: itemStyle }), showArrows ? (_jsxs(_Fragment, { children: [_jsx("div", { style: { position: "absolute", insetBlockStart: "50%", insetInlineStart: token.marginXS, transform: "translateY(-50%)" }, children: _jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "left", size: "inherit" }), ariaLabel: labels.previous, shape: "circle", disabled: atStart && !loop, onClick: () => stepByHand(-1) }) }), _jsx("div", { style: { position: "absolute", insetBlockStart: "50%", insetInlineEnd: token.marginXS, transform: "translateY(-50%)" }, children: _jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "right", size: "inherit" }), ariaLabel: labels.next, shape: "circle", disabled: atEnd && !loop, onClick: () => stepByHand(1) }) })] })) : null, autoplay.offered ? (_jsx("div", { style: { position: "absolute", insetBlockEnd: token.marginXS, insetInlineEnd: token.marginXS }, children: _jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: autoplay.stopped ? "play-circle" : "pause-circle", size: "inherit" }), ariaLabel: autoplay.stopped ? labels.play : labels.pause, ariaPressed: autoplay.stopped, shape: "circle", onClick: autoplay.toggleStopped }) })) : null] }), showThumbnails ? (_jsx("div", { role: "group", "aria-label": labels.pages, style: { display: "flex", flexWrap: "wrap", justifyContent: "center", gap: resolvePhiSpacingScaleValue("xs"), minWidth: 0 }, children: thumbnails?.map((thumbnail, index) => (_jsx("button", { type: "button", "aria-label": thumbnail.label || formatPageLabel(labels.page, index + 1, index + 1), "aria-current": index === activeIndex || undefined, "aria-pressed": index === activeIndex, onClick: () => {
79
+ return (_jsxs("div", { role: "region", "aria-roledescription": "carousel", "aria-label": labels.region, style: { display: "flex", flexDirection: "column", gap: token.marginXS, width: "100%", minWidth: 0, ...gestures.style }, ...autoplay.holdHandlers, ...gestures.handlers, children: [_jsxs("div", { style: { position: "relative", minWidth: 0, ...windowStyle }, "aria-live": autoplay.running ? "off" : "polite", children: [_jsx(PhiSequenceViewport, { items: [...items], activeIndex: activeIndex, visibleCount: span, anchor: "start", transition: settings?.transition ?? defaults.transition, ...(settings?.durationMs === undefined ? {} : { durationMs: settings.durationMs }), ...(settings?.easing === undefined ? {} : { easing: settings.easing }), lookahead: settings?.lookahead ?? defaults.lookahead, mountPolicy: settings?.mountPolicy ?? defaults.mountPolicy, gap: resolvePhiSpacingScaleValue(settings?.gap ?? defaults.gap), itemStyle: itemStyle }), showArrows ? (_jsxs(_Fragment, { children: [_jsx("div", { style: { position: "absolute", insetBlockStart: "50%", insetInlineStart: token.marginXS, transform: "translateY(-50%)" }, children: _jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "left", size: "inherit" }), ariaLabel: labels.previous, shape: "circle", disabled: atStart && !loop, onClick: () => stepByHand(-1) }) }), _jsx("div", { style: { position: "absolute", insetBlockStart: "50%", insetInlineEnd: token.marginXS, transform: "translateY(-50%)" }, children: _jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "right", size: "inherit" }), ariaLabel: labels.next, shape: "circle", disabled: atEnd && !loop, onClick: () => stepByHand(1) }) })] })) : null, autoplay.offered ? (_jsx("div", { style: { position: "absolute", insetBlockEnd: token.marginXS, insetInlineEnd: token.marginXS }, children: _jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: autoplay.stopped ? "play-circle" : "pause-circle", size: "inherit" }), ariaLabel: autoplay.stopped ? labels.play : labels.pause, ariaPressed: autoplay.stopped, shape: "circle", onClick: autoplay.toggleStopped }) })) : null] }), showThumbnails ? (_jsx("div", { role: "group", "aria-label": labels.pages, style: { display: "flex", flexWrap: "wrap", justifyContent: "center", gap: resolvePhiSpacingScaleValue("xs"), minWidth: 0 }, children: thumbnails?.map((thumbnail, index) => (_jsx("button", { type: "button", "aria-label": thumbnail.label || formatPageLabel(labels.page, index + 1, index + 1), "aria-current": index === activeIndex || undefined, "aria-pressed": index === activeIndex, onClick: () => {
80
80
  setActiveIndex(index);
81
81
  autoplay.restart();
82
82
  }, style: {
@@ -14,8 +14,14 @@ export type PhiLinkProps = {
14
14
  * prefetched.
15
15
  */
16
16
  prefetch?: boolean;
17
+ /**
18
+ * Whether this link, where it leads to another site, wears the external mark (theme/phi-link-mark.ts).
19
+ * Said by a link in running text -- Markdown, Simple Text, a link cell -- and left out by a link that
20
+ * is a button, a logo or a picture. The Theme can still turn every mark off.
21
+ */
22
+ markExternal?: boolean;
17
23
  className?: string;
18
24
  style?: CSSProperties;
19
25
  onClick?: MouseEventHandler<HTMLAnchorElement>;
20
26
  };
21
- export declare function PhiLink({ href, children, external, newTab, prefetch, className, style, onClick, }: PhiLinkProps): import("react").JSX.Element;
27
+ export declare function PhiLink({ href, children, external, newTab, prefetch, markExternal, className, style, onClick, }: PhiLinkProps): import("react").JSX.Element;
@@ -3,10 +3,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useMemo, useState } from "react";
4
4
  import Link from "next/link";
5
5
  import { isPhiExternalHref } from "../../helpers/external-href";
6
+ import { PHI_LINK_EXTERNAL_MARK_ATTRIBUTE, isPhiMarkableExternalHref } from "../../theme/phi-link-mark";
6
7
  import { isPhiProtectedMail } from "../../helpers/protected-mail";
7
8
  import { usePhiConfig } from "../root/phi-config-provider";
8
9
  import { usePhiRevealedHref } from "./use-phi-protected-mail";
9
- export function PhiLink({ href, children, external, newTab, prefetch, className, style, onClick, }) {
10
+ export function PhiLink({ href, children, external, newTab, prefetch, markExternal, className, style, onClick, }) {
10
11
  const { token } = usePhiConfig();
11
12
  const [hovered, setHovered] = useState(false);
12
13
  const [active, setActive] = useState(false);
@@ -14,6 +15,9 @@ export function PhiLink({ href, children, external, newTab, prefetch, className,
14
15
  const useAnchor = isPhiProtectedMail(href) || (external ?? isPhiExternalHref(href));
15
16
  // A protected address (`helpers/protected-mail.ts`) is written into the anchor once mounted.
16
17
  const anchorHref = usePhiRevealedHref(href);
18
+ const markProps = markExternal && useAnchor && isPhiMarkableExternalHref(href)
19
+ ? { [PHI_LINK_EXTERNAL_MARK_ATTRIBUTE]: "" }
20
+ : {};
17
21
  const linkStyle = useMemo(() => ({
18
22
  textDecoration: "none",
19
23
  cursor: "pointer",
@@ -36,7 +40,7 @@ export function PhiLink({ href, children, external, newTab, prefetch, className,
36
40
  onBlur: () => setActive(false),
37
41
  };
38
42
  if (useAnchor) {
39
- return (_jsx("a", { href: anchorHref, target: newTab ? "_blank" : undefined, rel: newTab ? "noreferrer noopener" : undefined, className: className, style: linkStyle, onClick: onClick, ...interactionProps, children: children }));
43
+ return (_jsx("a", { href: anchorHref, target: newTab ? "_blank" : undefined, rel: newTab ? "noreferrer noopener" : undefined, className: className, style: linkStyle, onClick: onClick, ...markProps, ...interactionProps, children: children }));
40
44
  }
41
45
  return (_jsx(Link, { href: href, ...(prefetch === undefined ? {} : { prefetch }), className: className, style: linkStyle, onClick: onClick, ...interactionProps, children: children }));
42
46
  }
@@ -6,6 +6,7 @@ import { mergePhiThemePalettes, PHI_THEME_PALETTE_MODE_SEED_KEYS, resolvePhiThem
6
6
  import { assertPhiThemeVocabulary } from "../../theme/phi-theme-tokens";
7
7
  import { applyPhiButtonShadowComponentTokens } from "../../theme/phi-button-shadow";
8
8
  import { buildPhiThemeGradientTokens, readPhiThemeGradientKey } from "../../theme/phi-theme-gradients";
9
+ import { buildPhiThemeLinkTokens } from "../../theme/phi-link-mark";
9
10
  import { buildPhiThemeCustomColorTokens } from "../../theme/phi-theme-palette";
10
11
  import { applyPhiControlShapeComponentTokens, applyPhiSurfaceShapeComponentTokens, resolvePhiControlShape, } from "../../theme/phi-control-shape";
11
12
  const PHI_DEFAULT_DARK_NAV_BACKGROUND = "#001529";
@@ -96,6 +97,7 @@ export function resolvePhiRootTheme({ siteTheme, mode, fonts, presets, }) {
96
97
  token: effectiveThemeTokens,
97
98
  primaryButtonGradient: readPhiThemeGradientKey(siteTheme?.buttons?.primaryGradient),
98
99
  }),
100
+ ...buildPhiThemeLinkTokens(siteTheme?.links),
99
101
  };
100
102
  return {
101
103
  mode,
@@ -65,7 +65,7 @@ export function renderPhiValueContent(value, definition, labels, presentation =
65
65
  const displayValue = definition.valueMap?.[normalizedValue] ?? normalizedValue;
66
66
  if (definition.renderer === "email" || definition.renderer === "link") {
67
67
  const href = String(value);
68
- return _jsx(PhiLink, { href: definition.renderer === "email" ? `mailto:${href}` : href, children: displayValue });
68
+ return _jsx(PhiLink, { href: definition.renderer === "email" ? `mailto:${href}` : href, markExternal: true, children: displayValue });
69
69
  }
70
70
  if (definition.renderer === "tags") {
71
71
  const values = Array.isArray(value) ? value : [value];
@@ -6,7 +6,11 @@ const PHI_ACCOUNT_MENU_LABEL_SET = definePhiLabelSet({
6
6
  ctx: PHI_TR_CTX_WEB_UI_LABEL,
7
7
  labels: {
8
8
  account: "Account",
9
- login: "Login",
9
+ /*
10
+ * The action, not the column head: "Login" in this register is a table's, so the button and the
11
+ * dialog it opens name their own.
12
+ */
13
+ login: { text: "Login", ctx: "Web UI label, action" },
10
14
  register: "Register",
11
15
  // The Areas, named here because the menu is where a person reads them rather than routes by them.
12
16
  areas_title: "Go to",
@@ -21,7 +25,7 @@ const PHI_LOGIN_MODAL_LABEL_SET = definePhiLabelSet({
21
25
  key: "widget:login-modal",
22
26
  ctx: PHI_TR_CTX_WEB_UI_LABEL,
23
27
  labels: {
24
- title: "Login",
28
+ title: { text: "Login", ctx: "Web UI label, action" },
25
29
  submit_label: "Sign in",
26
30
  email_label: "Email",
27
31
  password_label: "Password",
@@ -82,7 +82,11 @@ const PHI_EFFECTS_WIDGET_LABEL_SET = definePhiLabelSet({
82
82
  viewport_x: PHI_EFFECTS_WIDGET_DEFAULT_LABELS.viewport.x,
83
83
  viewport_y: PHI_EFFECTS_WIDGET_DEFAULT_LABELS.viewport.y,
84
84
  viewport_z: PHI_EFFECTS_WIDGET_DEFAULT_LABELS.viewport.z,
85
- viewport_translate: PHI_EFFECTS_WIDGET_DEFAULT_LABELS.viewport.translate,
85
+ /*
86
+ * Moving an element, not putting it into another language: "Translate" in this register is the
87
+ * Messaging button's, so the motion property names its own.
88
+ */
89
+ viewport_translate: { text: PHI_EFFECTS_WIDGET_DEFAULT_LABELS.viewport.translate, ctx: "Web UI label, motion" },
86
90
  viewport_opacity: PHI_EFFECTS_WIDGET_DEFAULT_LABELS.viewport.opacity,
87
91
  viewport_rotate: PHI_EFFECTS_WIDGET_DEFAULT_LABELS.viewport.rotate,
88
92
  viewport_scale: PHI_EFFECTS_WIDGET_DEFAULT_LABELS.viewport.scale,
@@ -77,7 +77,7 @@ function renderInlineNodes(inlines) {
77
77
  case "inline_code":
78
78
  return (_jsx(PhiTypographyControl, { code: true, children: inline.text }, key));
79
79
  case "link":
80
- return (_jsx(PhiLink, { href: inline.href || "#", external: inline.external, newTab: inline.external, children: renderInlineNodes(inline.children) }, key));
80
+ return (_jsx(PhiLink, { href: inline.href || "#", external: inline.external, newTab: inline.external, markExternal: true, children: renderInlineNodes(inline.children) }, key));
81
81
  case "image":
82
82
  return (_jsx("img", { src: inline.src, alt: inline.alt, title: inline.title || undefined, style: { maxWidth: "100%", height: "auto" } }, key));
83
83
  case "break":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phis/ui",
3
- "version": "0.6.5",
3
+ "version": "0.6.7",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -133,6 +133,23 @@ const PROVIDER_OPTIONS = [
133
133
  { value: "github", label: label("providerGithub", "GitHub") },
134
134
  { value: "microsoft", label: label("providerMicrosoft", "Microsoft") },
135
135
  ];
136
+ /*
137
+ * Which settings a provider has, as the Form shows them: a field the chosen provider does not read is
138
+ * not drawn. The provider is the create Form's own select and a hidden field of the edit Form, filled
139
+ * from the row. The server refuses a setting a provider has no use for either way
140
+ * (`buildAuthInstallationConfig`); this only keeps the Form from offering it.
141
+ */
142
+ function forProviders(...providerKeys) {
143
+ return {
144
+ match: "any",
145
+ conditions: providerKeys.map((value) => ({
146
+ source: "form",
147
+ valuePath: "providerKey",
148
+ operator: "equals",
149
+ value,
150
+ })),
151
+ };
152
+ }
136
153
  const INSTALLATION_SHARED_FIELDS = [
137
154
  {
138
155
  key: "clientId",
@@ -148,7 +165,7 @@ const INSTALLATION_SHARED_FIELDS = [
148
165
  key: "clientSecret",
149
166
  fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.password,
150
167
  label: label("installationClientSecret", "Client secret"),
151
- description: label("installationClientSecretHint", "Leave empty to keep the currently stored secret."),
168
+ description: label("installationClientSecretHint", "Leave empty to keep the currently stored secret. For Apple, the contents of the .p8 key file."),
152
169
  autoComplete: "new-password",
153
170
  },
154
171
  {
@@ -158,6 +175,27 @@ const INSTALLATION_SHARED_FIELDS = [
158
175
  description: label("installationTenantHint", "Microsoft only: common, organizations, consumers, or a tenant UUID."),
159
176
  placeholder: label("installationTenantPlaceholder", "common"),
160
177
  autoComplete: "off",
178
+ visibleWhen: forProviders("microsoft"),
179
+ },
180
+ /*
181
+ * Apple issues a signing key instead of a client secret; the client secret is signed from the key,
182
+ * the developer team and the key's id for every token request.
183
+ */
184
+ {
185
+ key: "teamId",
186
+ fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.text,
187
+ label: label("installationTeamId", "Team ID"),
188
+ description: label("installationTeamIdHint", "The ten characters shown at the top right of the Apple Developer account."),
189
+ autoComplete: "off",
190
+ visibleWhen: forProviders("apple"),
191
+ },
192
+ {
193
+ key: "keyId",
194
+ fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.text,
195
+ label: label("installationKeyId", "Key ID"),
196
+ description: label("installationKeyIdHint", "The ten characters of the Sign in with Apple key under Keys."),
197
+ autoComplete: "off",
198
+ visibleWhen: forProviders("apple"),
161
199
  },
162
200
  /*
163
201
  * The provider's own settings, in one field each.
@@ -186,6 +224,7 @@ const INSTALLATION_SHARED_FIELDS = [
186
224
  label: label("installationRestrictions", "Restrict sign-in to"),
187
225
  description: label("installationRestrictionsHint", "Space separated, and empty admits everyone the provider admits. GitHub organizations for GitHub, hosted domains for Google."),
188
226
  autoComplete: "off",
227
+ visibleWhen: forProviders("google", "github"),
189
228
  },
190
229
  {
191
230
  key: "prompt",
@@ -193,6 +232,7 @@ const INSTALLATION_SHARED_FIELDS = [
193
232
  label: label("installationPrompt", "Prompt"),
194
233
  description: label("installationPromptHint", "OpenID providers only: login, consent, or select_account."),
195
234
  autoComplete: "off",
235
+ visibleWhen: forProviders("google", "microsoft"),
196
236
  },
197
237
  {
198
238
  key: "trustedEmailLink",
@@ -255,6 +295,8 @@ const INSTALLATION_EDIT_FORM_DESCRIPTOR = {
255
295
  labelSetKey: LABEL_SET_KEY,
256
296
  fields: [
257
297
  { key: "installationKey", fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.hidden },
298
+ // Read by the fields' conditions only; an installation keeps its provider.
299
+ { key: "providerKey", fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.hidden },
258
300
  ...INSTALLATION_SHARED_FIELDS,
259
301
  {
260
302
  key: "loginEnabled",
@@ -324,6 +366,10 @@ async function loadLabels(context) {
324
366
  installationTenant: labels.providers.tenant,
325
367
  installationTenantHint: labels.installations.tenantHint,
326
368
  installationTenantPlaceholder: labels.providers.tenantPlaceholder,
369
+ installationTeamId: labels.providers.teamId,
370
+ installationTeamIdHint: labels.providers.teamIdHint,
371
+ installationKeyId: labels.providers.keyId,
372
+ installationKeyIdHint: labels.providers.keyIdHint,
327
373
  installationScopes: labels.providers.scopes,
328
374
  installationScopesHint: labels.providers.scopesHint,
329
375
  installationRestrictions: labels.providers.restrictions,
@@ -23,6 +23,8 @@ export const PHI_AUTH_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
23
23
  { key: "providerKey", title: "Provider", type: "string", required: true },
24
24
  { key: "clientId", title: "Client ID", type: "string" },
25
25
  { key: "tenant", title: "Tenant", type: "string" },
26
+ { key: "teamId", title: "Team ID", type: "string" },
27
+ { key: "keyId", title: "Key ID", type: "string" },
26
28
  { key: "enabled", title: "Installation enabled", type: "boolean", mutable: true },
27
29
  { key: "loginEnabled", title: "Offer on login", type: "boolean", mutable: true },
28
30
  { key: "sortOrder", title: "Order", type: "number" },
@@ -619,7 +619,7 @@ export declare const PHI_CORE_RUNTIME_MODULE_DEFINITION: {
619
619
  }, {
620
620
  readonly key: "separator";
621
621
  readonly type: "string";
622
- readonly label: "Separator";
622
+ readonly label: "Separator character";
623
623
  }, {
624
624
  readonly key: "rootValue";
625
625
  readonly type: "string";
@@ -223,7 +223,7 @@ export declare const PHI_CORE_FORM_PROVIDER_DESCRIPTORS: {
223
223
  }, {
224
224
  readonly key: "separator";
225
225
  readonly type: "string";
226
- readonly label: "Separator";
226
+ readonly label: "Separator character";
227
227
  }, {
228
228
  readonly key: "rootValue";
229
229
  readonly type: "string";
@@ -18,7 +18,7 @@ export const PHI_BREADCRUMB_WIDGET_DEFINITION = {
18
18
  { key: "showArea", type: "boolean", label: "Show Area" },
19
19
  { key: "showPath", type: "boolean", label: "Show Path" },
20
20
  { key: "pathLabel", type: "string", label: "Path Label" },
21
- { key: "separator", type: "string", label: "Separator" },
21
+ { key: "separator", type: "string", label: "Separator character" },
22
22
  ],
23
23
  parseConfig: parsePhiCmsBreadcrumbWidgetConfig,
24
24
  };
@@ -42,7 +42,7 @@ export const PHI_CASCADER_WIDGET_DEFINITION = {
42
42
  { key: "placeholder", type: "string", label: "Placeholder" },
43
43
  ...buildPhiChoiceControlOptionFields("toolbar"),
44
44
  { key: "allowRoot", type: "boolean", label: "Allow Root" },
45
- { key: "separator", type: "string", label: "Separator" },
45
+ { key: "separator", type: "string", label: "Separator character" },
46
46
  { key: "rootValue", type: "string", label: "Root Value" },
47
47
  {
48
48
  key: "normalize",
@@ -9,6 +9,7 @@ import { readPhiAspectRatio, resolvePhiImagePresentation } from "../../../../../
9
9
  import { PHI_GALLERY_WIDGET_DEFAULT_LABELS, } from "../../../../../components/widgets/label-types/gallery";
10
10
  import { isPhiMediaSvgContentType } from "../../../../../constants/media";
11
11
  import { resolvePhiGalleryFrame } from "./defaults";
12
+ import { resolvePhiPictureSurface } from "../../../../../components/media/picture-surface";
12
13
  /** A thumbnail's width in pixels: also what the optimiser is told to size it for. */
13
14
  const PHI_GALLERY_THUMBNAIL_WIDTH = 80;
14
15
  function GalleryPicture({ item, variantKey, fit, preview, sizes, aspectRatio, }) {
@@ -69,8 +70,15 @@ export function PhiGalleryWidget({ config, images: imagesInput, pictures, labels
69
70
  borderRadius: token.borderRadius,
70
71
  overflow: "hidden",
71
72
  };
73
+ /*
74
+ * The Gallery's own Surface goes on the window the pictures run in, with the arrows on it: its depth
75
+ * stands around what is seen, and its corners clip the run. Without one the window is bare, as before.
76
+ */
77
+ const windowStyle = config?.surface
78
+ ? { ...resolvePhiPictureSurface(config.surface).style, overflow: "hidden" }
79
+ : undefined;
72
80
  if (items.length === 0) {
73
81
  return _jsx(PhiEmptyControl, { description: labels.empty });
74
82
  }
75
- return (_jsx(PhiSequenceRun, { items: items.map((item) => (_jsx(GalleryPicture, { item: item, variantKey: config?.variantKey, fit: fit, preview: config?.preview === true, sizes: sizes, aspectRatio: aspectRatio }, item.key))), settings: config, labels: labels, itemStyle: frameStyle, thumbnails: thumbnails, thumbnailWidth: PHI_GALLERY_THUMBNAIL_WIDTH }));
83
+ return (_jsx(PhiSequenceRun, { items: items.map((item) => (_jsx(GalleryPicture, { item: item, variantKey: config?.variantKey, fit: fit, preview: config?.preview === true, sizes: sizes, aspectRatio: aspectRatio }, item.key))), settings: config, labels: labels, itemStyle: frameStyle, windowStyle: windowStyle, thumbnails: thumbnails, thumbnailWidth: PHI_GALLERY_THUMBNAIL_WIDTH }));
76
84
  }
@@ -36,6 +36,7 @@ export declare const PHI_GALLERY_WIDGET_DEFINITION: {
36
36
  pluginKey: string;
37
37
  typeKey: string;
38
38
  slotSizePolicy: "fill-inline";
39
+ surface: "own";
39
40
  title: string;
40
41
  description: string;
41
42
  category: "media";
@@ -81,6 +81,11 @@ export const PHI_GALLERY_WIDGET_DEFINITION = {
81
81
  typeKey: "gallery",
82
82
  // A slideshow is as wide as the place it is put; its height follows from the aspect ratio.
83
83
  slotSizePolicy: "fill-inline",
84
+ /*
85
+ * The Gallery draws its Surface itself, on the window its pictures run in: around the slot frame it
86
+ * would stand around the dots below as well, and on each picture the window would cut its depth off.
87
+ */
88
+ surface: "own",
84
89
  title: "Gallery",
85
90
  description: "A run of pictures shown a few at a time, with arrows, dots and optional autoplay.",
86
91
  category: "media",
@@ -8,7 +8,7 @@ import { PhiEmptyControl } from "../../../../../components/controls/phi-empty-co
8
8
  import { PhiImageControl } from "../../../../../components/controls/phi-image-control";
9
9
  import { PhiFlexControl } from "../../../../../components/controls/phi-flex-control";
10
10
  import { PhiTypographyControl } from "../../../../../components/controls/phi-typography-control";
11
- import { PHI_LAYOUT_SURFACE_RADIUS } from "../../../../../components/layouts/phi-layout-contract";
11
+ import { resolvePhiPictureSurface } from "../../../../../components/media/picture-surface";
12
12
  function formatImageSize(value) {
13
13
  if (typeof value === "number" && Number.isFinite(value)) {
14
14
  return `${value}px`;
@@ -70,15 +70,11 @@ export function PhiImageWidget({ labels, config, resolvedAsset, focalRect, autho
70
70
  const renderedHeight = formatImageSize(height);
71
71
  const maskStyle = resolvePhiMaskStyle(config?.mask);
72
72
  /*
73
- * A picture is a surface: a corner the author left unstated is the Theme's surface step, as a Layout's
74
- * and a Markdown picture's are (THEME.md "Control shape"); a corner the author stated keeps its value.
73
+ * The picture's own Surface (`components/media/picture-surface.ts`): its corners, the Theme's surface
74
+ * step where it states none, and its edge, depth and ground on the picture's box.
75
75
  */
76
- const radiusStyle = {
77
- borderTopLeftRadius: config?.borderTopLeftRadius ?? PHI_LAYOUT_SURFACE_RADIUS,
78
- borderTopRightRadius: config?.borderTopRightRadius ?? PHI_LAYOUT_SURFACE_RADIUS,
79
- borderBottomLeftRadius: config?.borderBottomLeftRadius ?? PHI_LAYOUT_SURFACE_RADIUS,
80
- borderBottomRightRadius: config?.borderBottomRightRadius ?? PHI_LAYOUT_SURFACE_RADIUS,
81
- };
76
+ const pictureSurface = resolvePhiPictureSurface(config?.surface);
77
+ const radiusStyle = pictureSurface.corners;
82
78
  if (!renderUrl) {
83
79
  return (_jsxs(PhiFlexControl, { align: "center", justify: "center", vertical: true, gap: 6, style: {
84
80
  minHeight: 160,
@@ -93,7 +89,7 @@ export function PhiImageWidget({ labels, config, resolvedAsset, focalRect, autho
93
89
  }, children: [_jsx(PhiEmptyControl, {}), _jsx(PhiTypographyControl, { type: "secondary", strong: false, children: labels.emptyTitle }), _jsx(PhiTypographyControl, { type: "secondary", children: labels.emptyDescription })] }));
94
90
  }
95
91
  return (_jsx(PhiImageControl, { presentation: presentation, source: sourceKind === "asset" ? "asset" : config?.trusted === true ? "trusted-url" : "url", alt: alt, title: title || undefined, width: width, height: height, blurDataUrl: resolvedAsset?.blurDataUrl, optimizable: optimizable, sizes: config?.sizes, preload: config?.preload === true && isPublicAsset, preview: (config?.previewMode ?? "none") === "lightbox", zoom: config?.previewMode === "native", style: {
96
- ...radiusStyle,
92
+ ...pictureSurface.style,
97
93
  ...maskStyle,
98
94
  // Every corner has a radius now, the Theme's at least, so the box always clips its picture.
99
95
  overflow: "hidden",
@@ -15,10 +15,6 @@ export type PhiCmsImageWidgetConfig = PhiCmsWidgetConfigBase & PhiMediaImageSour
15
15
  * Absent, the image takes the variant's own size.
16
16
  */
17
17
  imageSize?: PhiImageWidgetSize;
18
- borderTopLeftRadius?: number | string;
19
- borderTopRightRadius?: number | string;
20
- borderBottomLeftRadius?: number | string;
21
- borderBottomRightRadius?: number | string;
22
18
  mask?: PhiMaskConfig;
23
19
  /** A picture field of the page record to show instead of the Widget's own picture. */
24
20
  recordField?: string;
@@ -30,6 +26,7 @@ export declare const PHI_IMAGE_WIDGET_DEFINITION: {
30
26
  pluginKey: string;
31
27
  typeKey: string;
32
28
  slotSizePolicy: "intrinsic";
29
+ surface: "own";
33
30
  title: string;
34
31
  description: string;
35
32
  category: "content";
@@ -48,10 +45,6 @@ export declare const PHI_IMAGE_WIDGET_DEFINITION: {
48
45
  emptyValue?: undefined;
49
46
  widthPlaceholder?: undefined;
50
47
  heightPlaceholder?: undefined;
51
- topLeftKey?: undefined;
52
- topRightKey?: undefined;
53
- bottomLeftKey?: undefined;
54
- bottomRightKey?: undefined;
55
48
  } | {
56
49
  key: string;
57
50
  type: "choice";
@@ -68,10 +61,6 @@ export declare const PHI_IMAGE_WIDGET_DEFINITION: {
68
61
  emptyValue?: undefined;
69
62
  widthPlaceholder?: undefined;
70
63
  heightPlaceholder?: undefined;
71
- topLeftKey?: undefined;
72
- topRightKey?: undefined;
73
- bottomLeftKey?: undefined;
74
- bottomRightKey?: undefined;
75
64
  } | {
76
65
  key: string;
77
66
  type: "url";
@@ -88,10 +77,6 @@ export declare const PHI_IMAGE_WIDGET_DEFINITION: {
88
77
  emptyValue?: undefined;
89
78
  widthPlaceholder?: undefined;
90
79
  heightPlaceholder?: undefined;
91
- topLeftKey?: undefined;
92
- topRightKey?: undefined;
93
- bottomLeftKey?: undefined;
94
- bottomRightKey?: undefined;
95
80
  } | {
96
81
  key: string;
97
82
  type: "choice";
@@ -111,10 +96,6 @@ export declare const PHI_IMAGE_WIDGET_DEFINITION: {
111
96
  kinds?: undefined;
112
97
  widthPlaceholder?: undefined;
113
98
  heightPlaceholder?: undefined;
114
- topLeftKey?: undefined;
115
- topRightKey?: undefined;
116
- bottomLeftKey?: undefined;
117
- bottomRightKey?: undefined;
118
99
  } | {
119
100
  key: string;
120
101
  type: "string";
@@ -131,10 +112,6 @@ export declare const PHI_IMAGE_WIDGET_DEFINITION: {
131
112
  emptyValue?: undefined;
132
113
  widthPlaceholder?: undefined;
133
114
  heightPlaceholder?: undefined;
134
- topLeftKey?: undefined;
135
- topRightKey?: undefined;
136
- bottomLeftKey?: undefined;
137
- bottomRightKey?: undefined;
138
115
  } | {
139
116
  key: string;
140
117
  type: "choice";
@@ -154,10 +131,6 @@ export declare const PHI_IMAGE_WIDGET_DEFINITION: {
154
131
  emptyValue?: undefined;
155
132
  widthPlaceholder?: undefined;
156
133
  heightPlaceholder?: undefined;
157
- topLeftKey?: undefined;
158
- topRightKey?: undefined;
159
- bottomLeftKey?: undefined;
160
- bottomRightKey?: undefined;
161
134
  } | {
162
135
  key: string;
163
136
  type: "boolean";
@@ -171,10 +144,6 @@ export declare const PHI_IMAGE_WIDGET_DEFINITION: {
171
144
  emptyValue?: undefined;
172
145
  widthPlaceholder?: undefined;
173
146
  heightPlaceholder?: undefined;
174
- topLeftKey?: undefined;
175
- topRightKey?: undefined;
176
- bottomLeftKey?: undefined;
177
- bottomRightKey?: undefined;
178
147
  } | {
179
148
  key: string;
180
149
  type: "dimension";
@@ -188,27 +157,6 @@ export declare const PHI_IMAGE_WIDGET_DEFINITION: {
188
157
  valueType?: undefined;
189
158
  emptyOption?: undefined;
190
159
  emptyValue?: undefined;
191
- topLeftKey?: undefined;
192
- topRightKey?: undefined;
193
- bottomLeftKey?: undefined;
194
- bottomRightKey?: undefined;
195
- } | {
196
- key: string;
197
- type: "radius";
198
- label: string;
199
- topLeftKey: string;
200
- topRightKey: string;
201
- bottomLeftKey: string;
202
- bottomRightKey: string;
203
- description?: undefined;
204
- kinds?: undefined;
205
- options?: undefined;
206
- visibleWhen?: undefined;
207
- valueType?: undefined;
208
- emptyOption?: undefined;
209
- emptyValue?: undefined;
210
- widthPlaceholder?: undefined;
211
- heightPlaceholder?: undefined;
212
160
  })[];
213
161
  contentBinding: {
214
162
  storage: "asset";
@@ -40,10 +40,6 @@ export function normalizePhiImageWidgetConfig(config) {
40
40
  preload: false,
41
41
  previewMode: "none",
42
42
  imageSize: undefined,
43
- borderTopLeftRadius: undefined,
44
- borderTopRightRadius: undefined,
45
- borderBottomLeftRadius: undefined,
46
- borderBottomRightRadius: undefined,
47
43
  mask: undefined,
48
44
  };
49
45
  }
@@ -60,10 +56,6 @@ export function normalizePhiImageWidgetConfig(config) {
60
56
  preload: readBoolean(raw.preload) ?? false,
61
57
  previewMode: readImagePreviewMode(raw.previewMode),
62
58
  imageSize: readImageSize(raw.imageSize),
63
- borderTopLeftRadius: readCssSize(raw.borderTopLeftRadius),
64
- borderTopRightRadius: readCssSize(raw.borderTopRightRadius),
65
- borderBottomLeftRadius: readCssSize(raw.borderBottomLeftRadius),
66
- borderBottomRightRadius: readCssSize(raw.borderBottomRightRadius),
67
59
  mask: readPhiMaskConfig(raw.mask),
68
60
  recordField: readString(raw.recordField),
69
61
  };
@@ -94,6 +86,12 @@ export const PHI_IMAGE_WIDGET_DEFINITION = {
94
86
  pluginKey: resolvePhiCmsWidgetPluginKey("image"),
95
87
  typeKey: "image",
96
88
  slotSizePolicy: "intrinsic",
89
+ /*
90
+ * The picture draws its Surface itself -- edge, corners, depth and a ground behind a transparent or
91
+ * contained picture -- on its own box, which clips the picture to the corners. The corners were a field
92
+ * of the Image's own until 2026-11-18; they are the Surface's edge now, as on every other box.
93
+ */
94
+ surface: "own",
97
95
  title: "Image",
98
96
  description: "Flexible image renderer for local media, trusted URLs, and on-demand renditions.",
99
97
  category: "content",
@@ -170,15 +168,6 @@ export const PHI_IMAGE_WIDGET_DEFINITION = {
170
168
  widthPlaceholder: "Width",
171
169
  heightPlaceholder: "Height",
172
170
  },
173
- {
174
- key: "radius",
175
- type: "radius",
176
- label: "Corner radius",
177
- topLeftKey: "borderTopLeftRadius",
178
- topRightKey: "borderTopRightRadius",
179
- bottomLeftKey: "borderBottomLeftRadius",
180
- bottomRightKey: "borderBottomRightRadius",
181
- },
182
171
  ],
183
172
  contentBinding: {
184
173
  storage: "asset",
@@ -193,7 +193,7 @@ export const PHI_RECORD_WIDGET_DEFINITION = {
193
193
  options: [
194
194
  { value: "outlined", label: "Outlined" },
195
195
  { value: "filled", label: "Filled" },
196
- { value: "solid", label: "Solid" },
196
+ { value: "solid", label: "Solid color" },
197
197
  ],
198
198
  },
199
199
  {
@@ -128,7 +128,7 @@ export function PhiSimpleTextWidgetClient({ blockId, labels, config, link = null
128
128
  if (!link) {
129
129
  return contentNode;
130
130
  }
131
- return (_jsx(PhiLink, { href: link.href, external: link.external, newTab: link.newTab, onClick: isLiveMode
131
+ return (_jsx(PhiLink, { href: link.href, external: link.external, newTab: link.newTab, markExternal: true, onClick: isLiveMode
132
132
  ? undefined
133
133
  : (event) => {
134
134
  event.preventDefault();
@@ -653,7 +653,7 @@ export const PHI_TABLE_WIDGET_DEFINITION = {
653
653
  options: [
654
654
  { value: "outlined", label: "Outlined" },
655
655
  { value: "filled", label: "Filled" },
656
- { value: "solid", label: "Solid" },
656
+ { value: "solid", label: "Solid color" },
657
657
  ],
658
658
  },
659
659
  {
@@ -129,7 +129,10 @@ export declare function resolveThemePayloadPreset(theme: ThemePayload, presets:
129
129
  * the very thing they asked for.
130
130
  */
131
131
  export declare function applyThemePreset(theme: ThemePayload, preset: PhiThemePresetPlugin): ThemePayload;
132
- /** Back to the blocks alone: the palette, the proportions, the Button shadows and the component overrides all go. */
132
+ /**
133
+ * Back to the blocks alone: the palette, the proportions, the Button shadows, the link marks and the
134
+ * component overrides all go.
135
+ */
133
136
  export declare function resetThemeToPreset(theme: ThemePayload, presets: readonly PhiThemePresetPlugin[], preset?: PhiThemePresetPlugin): ThemePayload;
134
137
  export declare function buildThemeReviewHref({ area, revisionId, themeKey, }: {
135
138
  area: PhiCmsAreaKey;
@@ -21,6 +21,7 @@ const PHI_THEME_HISTORY_PART_BY_FIELD = {
21
21
  shape: "style",
22
22
  style: "style",
23
23
  buttons: "style",
24
+ links: "style",
24
25
  fonts: "fonts",
25
26
  typography: "fonts",
26
27
  brand: "brand",
@@ -89,10 +90,13 @@ export function applyThemePreset(theme, preset) {
89
90
  presetVersion: preset.version,
90
91
  };
91
92
  }
92
- /** Back to the blocks alone: the palette, the proportions, the Button shadows and the component overrides all go. */
93
+ /**
94
+ * Back to the blocks alone: the palette, the proportions, the Button shadows, the link marks and the
95
+ * component overrides all go.
96
+ */
93
97
  export function resetThemeToPreset(theme, presets, preset = resolveThemePayloadPreset(theme, presets)) {
94
98
  return {
95
- ...omitThemeFields(theme, "palette", "style", "buttons", "components"),
99
+ ...omitThemeFields(theme, "palette", "style", "buttons", "links", "components"),
96
100
  preset: preset.key,
97
101
  presetVersion: preset.version,
98
102
  };
@@ -13,6 +13,7 @@ import { PHI_THEME_CUSTOM_COLOR_KEYS, isPhiThemePaletteModeSeedKey, mergePhiThem
13
13
  import { PHI_THEME_COLOR_DERIVED_TOKEN_KEYS, PHI_THEME_COLOR_SEED_DERIVATIONS, } from "../../../../../theme/phi-theme-seed-derivation";
14
14
  import { buildPhiThemeCustomColorPalette, buildPhiThemeCustomColorTokens, resolvePhiThemePaletteCustomColors, } from "../../../../../theme/phi-theme-palette";
15
15
  import { buildPhiThemeGradientTokens, PHI_THEME_GRADIENT_KEYS, readPhiThemeGradient, readPhiThemeGradientTextTone, readPhiThemeGradientKey, resolvePhiThemeGradients, resolvePhiThemeGradientText, resolvePhiThemeGradientContrast, resolvePhiThemeGradientAutoTextTone, resolvePhiThemeGradientInks, PHI_GRADIENT_HOVER_FILTER, } from "../../../../../theme/phi-theme-gradients";
16
+ import { buildPhiThemeLinkTokens, readPhiThemeExternalLinkMark } from "../../../../../theme/phi-link-mark";
16
17
  import { usePhiConfig } from "../../../../../components/root/phi-config-provider";
17
18
  import { usePhiThemeBlockCatalog } from "../../../../../components/root/phi-theme-block-catalog-provider";
18
19
  import { resolvePhiThemeComposition, resolvePhiThemeEffectiveLogo, resolvePhiThemeEffectiveFonts, resolvePhiThemeEffectiveRoot, } from "../../../../../theme/phi-theme-composition";
@@ -270,6 +271,16 @@ function withThemeButtons(theme, buttons) {
270
271
  const withoutButtons = omitThemeFields(theme, "buttons");
271
272
  return Object.keys(buttons).length > 0 ? { ...withoutButtons, buttons } : withoutButtons;
272
273
  }
274
+ /**
275
+ * Links to other sites with or without their mark. On is the default, so turning it back on removes the
276
+ * entry rather than storing `true`.
277
+ */
278
+ function mergeThemeExternalLinkMark(theme, shown) {
279
+ const { externalMark: _previous, ...otherLinks } = theme.links ?? {};
280
+ const links = shown ? otherLinks : { ...otherLinks, externalMark: false };
281
+ const withoutLinks = omitThemeFields(theme, "links");
282
+ return Object.keys(links).length > 0 ? { ...withoutLinks, links } : withoutLinks;
283
+ }
273
284
  /** Every primary Button filled with a Theme gradient, or handed back to its one colour. */
274
285
  function mergeThemePrimaryButtonGradient(theme, gradient) {
275
286
  const { primaryGradient: _previous, ...otherButtons } = theme.buttons ?? {};
@@ -455,6 +466,7 @@ function resolveBrandDraftAliasTokens(resolvedTheme, preset, mode, fonts = {}) {
455
466
  token: aliasTokens,
456
467
  primaryButtonGradient: readPhiThemeGradientKey(resolvedTheme.buttons?.primaryGradient),
457
468
  }),
469
+ ...buildPhiThemeLinkTokens(resolvedTheme.links),
458
470
  };
459
471
  }
460
472
  function readEffectiveTokenNumber(token, key, fallback) {
@@ -1300,6 +1312,11 @@ export function PhiBuilderBrandStyleControlsWidgetClient({ runtime, config, }) {
1300
1312
  ...PHI_THEME_GRADIENT_KEYS.map((key, index) => ({ value: key, label: `Gradient ${index + 1}` })),
1301
1313
  ], onChange: (choice) => publishDraft(mergeThemePrimaryButtonGradient(state.draft, choice === "none" ? null : choice)) })] })),
1302
1314
  },
1315
+ {
1316
+ key: "externalLinks",
1317
+ label: _jsx(PhiTypographyControl, { strong: true, children: "External Links" }),
1318
+ children: (_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: clientToken.paddingSM, wrap: "wrap", children: [_jsx(PhiTypographyControl, { type: "secondary", children: "An arrow after a link in text that leads to another site" }), _jsx(PhiSwitchControl, { checked: readPhiThemeExternalLinkMark(state.draft.links), checkedLabel: "On", uncheckedLabel: "Off", onChange: (checked) => publishDraft(mergeThemeExternalLinkMark(state.draft, checked)) })] })),
1319
+ },
1303
1320
  {
1304
1321
  key: "radius",
1305
1322
  label: _jsx(PhiTypographyControl, { strong: true, children: "Border Radius" }),
@@ -38,7 +38,11 @@ const PHI_THREAD_PAGE_LABEL_SET = definePhiRuntimeModuleLabelSet(PHI_THREADS_RUN
38
38
  column_state: "State",
39
39
  column_activity: "Last activity",
40
40
  state_unread: "New",
41
- state_open: "Open",
41
+ /*
42
+ * A conversation that is open, not the action that opens one: "Open" in this register is the
43
+ * button's, so the state names its own.
44
+ */
45
+ state_open: { text: "Open", ctx: "Web UI label, state" },
42
46
  state_archived: "Archived",
43
47
  state_locked: "Locked",
44
48
  kind_direct: "Direct",
@@ -47,7 +51,7 @@ const PHI_THREAD_PAGE_LABEL_SET = definePhiRuntimeModuleLabelSet(PHI_THREADS_RUN
47
51
  kind_support: "Support",
48
52
  filter_unread_label: "Unread only",
49
53
  filter_status_label: "Status",
50
- filter_status_open: "Open",
54
+ filter_status_open: { text: "Open", ctx: "Web UI label, state" },
51
55
  filter_status_archived: "Archived",
52
56
  archive_label: "Archive",
53
57
  reopen_label: "Reopen",
@@ -1003,3 +1003,23 @@ input.ant-input.ant-input-lg {
1003
1003
  margin-inline-start: var(--phi-markdown-float-gap);
1004
1004
  }
1005
1005
  }
1006
+
1007
+ /* --- External link mark --------------------------------------------------------------------------- */
1008
+
1009
+ /*
1010
+ * The arrow after a link in running text that leads to another site (theme/phi-link-mark.ts). `PhiLink`
1011
+ * sets the attribute where its caller asks for the mark; the Theme's `--phi-link-external-mark` is the
1012
+ * mark's `display`, `none` where the Theme turned marks off. Drawn in the link's own colour, so it follows
1013
+ * hover and press with the words.
1014
+ */
1015
+ a[data-phi-external-mark]::after {
1016
+ content: "";
1017
+ display: var(--phi-link-external-mark, inline-block);
1018
+ width: 0.7em;
1019
+ height: 0.7em;
1020
+ margin-inline-start: 0.2em;
1021
+ vertical-align: baseline;
1022
+ background-color: currentColor;
1023
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 2h8v8h-2V5.4l-8.3 8.3-1.4-1.4L10.6 4H6z'/%3E%3C/svg%3E") center / contain no-repeat;
1024
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 2h8v8h-2V5.4l-8.3 8.3-1.4-1.4L10.6 4H6z'/%3E%3C/svg%3E") center / contain no-repeat;
1025
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The mark behind a link that leaves the Site.
3
+ *
4
+ * A link in running text that goes to another site carries a small arrow after its words, so a reader
5
+ * knows before following it that it leaves this Site. The mark is drawn by CSS
6
+ * (`styles/controls.css`, `a[data-phi-external-mark]::after`) on links whose caller asks for it --
7
+ * `PhiLink` with `markExternal`, said by Markdown, Simple Text and a link cell -- and never on a link
8
+ * that is a button, a logo or a picture, where an arrow after the content would be noise.
9
+ *
10
+ * The Theme decides whether marks are shown at all (`links.externalMark`, on unless stated `false`).
11
+ * It rides as a token of this package's own, so Ant Design writes it as `--phi-link-external-mark` under
12
+ * the Theme's class like every other token, and the Theme workspace previews it the same way.
13
+ */
14
+ export type PhiThemeLinks = {
15
+ /** Whether a link to another site wears the mark; absent is on. */
16
+ externalMark?: boolean | null;
17
+ };
18
+ export declare const PHI_LINK_EXTERNAL_MARK_ATTRIBUTE = "data-phi-external-mark";
19
+ /** Whether the Theme shows the mark: on unless it says `false`. */
20
+ export declare function readPhiThemeExternalLinkMark(links: PhiThemeLinks | null | undefined): boolean;
21
+ /** The token the stylesheet reads: the mark's `display`, `none` where the Theme turned it off. */
22
+ export declare function buildPhiThemeLinkTokens(links: PhiThemeLinks | null | undefined): {
23
+ linkExternalMark: string;
24
+ };
25
+ /** Whether an address leaves the Site over the web; a mail or phone link is not marked. */
26
+ export declare function isPhiMarkableExternalHref(href: string): boolean;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The mark behind a link that leaves the Site.
3
+ *
4
+ * A link in running text that goes to another site carries a small arrow after its words, so a reader
5
+ * knows before following it that it leaves this Site. The mark is drawn by CSS
6
+ * (`styles/controls.css`, `a[data-phi-external-mark]::after`) on links whose caller asks for it --
7
+ * `PhiLink` with `markExternal`, said by Markdown, Simple Text and a link cell -- and never on a link
8
+ * that is a button, a logo or a picture, where an arrow after the content would be noise.
9
+ *
10
+ * The Theme decides whether marks are shown at all (`links.externalMark`, on unless stated `false`).
11
+ * It rides as a token of this package's own, so Ant Design writes it as `--phi-link-external-mark` under
12
+ * the Theme's class like every other token, and the Theme workspace previews it the same way.
13
+ */
14
+ export const PHI_LINK_EXTERNAL_MARK_ATTRIBUTE = "data-phi-external-mark";
15
+ /** Whether the Theme shows the mark: on unless it says `false`. */
16
+ export function readPhiThemeExternalLinkMark(links) {
17
+ return links?.externalMark !== false;
18
+ }
19
+ /** The token the stylesheet reads: the mark's `display`, `none` where the Theme turned it off. */
20
+ export function buildPhiThemeLinkTokens(links) {
21
+ return { linkExternalMark: readPhiThemeExternalLinkMark(links) ? "inline-block" : "none" };
22
+ }
23
+ /** Whether an address leaves the Site over the web; a mail or phone link is not marked. */
24
+ export function isPhiMarkableExternalHref(href) {
25
+ return /^(https?:)?\/\//i.test(href.trim());
26
+ }
@@ -41,9 +41,10 @@ export declare const PHI_THEME_TOKEN_KEYS: readonly ["colorBgContainer", "colorB
41
41
  * The `gradient*` names are the Theme's gradient slots and the primary Buttons' run
42
42
  * (theme/phi-theme-gradients.ts): tokens of this package's own, laid over the resolved ones so Ant
43
43
  * Design writes them per mode and per Surface tone like every other. The `custom*` names are the
44
- * palette's custom colours, laid over the same way (theme/phi-theme-palette.ts).
44
+ * palette's custom colours, laid over the same way (theme/phi-theme-palette.ts). `linkExternalMark` is
45
+ * the `display` of the mark behind a link that leaves the Site (theme/phi-link-mark.ts).
45
46
  */
46
- export declare const PHI_THEME_OWN_TOKEN_KEYS: readonly ["paddingXXL", "pageMax", "pagePaddingTopPhone", "pagePaddingRightPhone", "pagePaddingBottomPhone", "pagePaddingLeftPhone", "pagePaddingTopTablet", "pagePaddingRightTablet", "pagePaddingBottomTablet", "pagePaddingLeftTablet", "pagePaddingTopDesktop", "pagePaddingRightDesktop", "pagePaddingBottomDesktop", "pagePaddingLeftDesktop", "gradient1", "gradient1Text", "gradient2", "gradient2Text", "gradient3", "gradient3Text", "primaryButtonGradient", "primaryButtonGradientHover", "primaryButtonGradientActive", "primaryButtonGradientText", "custom1", "custom2", "custom3", "custom4", "custom5", "custom6", "custom7", "custom8", "custom9", "custom10"];
47
+ export declare const PHI_THEME_OWN_TOKEN_KEYS: readonly ["paddingXXL", "pageMax", "pagePaddingTopPhone", "pagePaddingRightPhone", "pagePaddingBottomPhone", "pagePaddingLeftPhone", "pagePaddingTopTablet", "pagePaddingRightTablet", "pagePaddingBottomTablet", "pagePaddingLeftTablet", "pagePaddingTopDesktop", "pagePaddingRightDesktop", "pagePaddingBottomDesktop", "pagePaddingLeftDesktop", "gradient1", "gradient1Text", "gradient2", "gradient2Text", "gradient3", "gradient3Text", "primaryButtonGradient", "primaryButtonGradientHover", "primaryButtonGradientActive", "primaryButtonGradientText", "linkExternalMark", "custom1", "custom2", "custom3", "custom4", "custom5", "custom6", "custom7", "custom8", "custom9", "custom10"];
47
48
  /** The Page inset's names, per band and side (`PHI_LAYOUT.pagePadding`, `PHI_PAGE.padding`). */
48
49
  export declare const PHI_THEME_PAGE_PADDING_BANDS: readonly ["Phone", "Tablet", "Desktop"];
49
50
  export declare const PHI_THEME_PAGE_PADDING_SIDES: readonly ["Top", "Right", "Bottom", "Left"];
@@ -173,7 +173,8 @@ export const PHI_THEME_TOKEN_KEYS = [
173
173
  * The `gradient*` names are the Theme's gradient slots and the primary Buttons' run
174
174
  * (theme/phi-theme-gradients.ts): tokens of this package's own, laid over the resolved ones so Ant
175
175
  * Design writes them per mode and per Surface tone like every other. The `custom*` names are the
176
- * palette's custom colours, laid over the same way (theme/phi-theme-palette.ts).
176
+ * palette's custom colours, laid over the same way (theme/phi-theme-palette.ts). `linkExternalMark` is
177
+ * the `display` of the mark behind a link that leaves the Site (theme/phi-link-mark.ts).
177
178
  */
178
179
  export const PHI_THEME_OWN_TOKEN_KEYS = [
179
180
  "paddingXXL",
@@ -200,6 +201,7 @@ export const PHI_THEME_OWN_TOKEN_KEYS = [
200
201
  "primaryButtonGradientHover",
201
202
  "primaryButtonGradientActive",
202
203
  "primaryButtonGradientText",
204
+ "linkExternalMark",
203
205
  "custom1",
204
206
  "custom2",
205
207
  "custom3",
@@ -143,10 +143,6 @@ export type PhiImageWidgetPlacement = PhiWidgetPlacementBase & PhiMediaImageSour
143
143
  objectPosition?: string;
144
144
  title?: string;
145
145
  imageSize?: PhiImageWidgetSize;
146
- borderTopLeftRadius?: number | string;
147
- borderTopRightRadius?: number | string;
148
- borderBottomLeftRadius?: number | string;
149
- borderBottomRightRadius?: number | string;
150
146
  mask?: PhiMaskConfig;
151
147
  /** A picture field of the page record shown instead of the Widget's own picture. */
152
148
  recordField?: string;
@@ -6,6 +6,7 @@ import type { PhiThemeBlockSelection } from "../theme/phi-theme-composition";
6
6
  import type { PhiThemeDerivation } from "../theme/phi-theme-selection";
7
7
  import type { PhiControlShapeCorners } from "../theme/phi-control-shape";
8
8
  import type { PhiThemeButtons } from "../theme/phi-button-shadow";
9
+ import type { PhiThemeLinks } from "../theme/phi-link-mark";
9
10
  import type { PhiThemeTypography } from "../theme/phi-theme-typography";
10
11
  export type PhiSiteTheme = {
11
12
  mode?: "light" | "dark" | null;
@@ -50,6 +51,8 @@ export type PhiSiteTheme = {
50
51
  } | null;
51
52
  /** The shadow under each kind of Button, as a step the root theme turns into CSS per mode. */
52
53
  buttons?: PhiThemeButtons | null;
54
+ /** Whether a link to another site wears its mark (theme/phi-link-mark.ts); absent is on. */
55
+ links?: PhiThemeLinks | null;
53
56
  /** Which font slot the page's headings take; body unless stated (theme/phi-theme-typography.ts). */
54
57
  typography?: PhiThemeTypography | null;
55
58
  /** Site-level component overrides, merged per component over the shared component defaults. */