@phis/ui 0.8.2 → 0.8.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.
Files changed (151) hide show
  1. package/components/calendar/gregory-calendar-adapter-client.js +1 -0
  2. package/components/controls/phi-accordion-control.d.ts +6 -0
  3. package/components/controls/phi-accordion-control.js +8 -13
  4. package/components/controls/phi-background-control.js +2 -5
  5. package/components/controls/phi-builder-insert-picker-control-labels.d.ts +2 -0
  6. package/components/controls/phi-builder-insert-picker-control-labels.js +1 -0
  7. package/components/controls/phi-builder-insert-picker-control.js +10 -11
  8. package/components/controls/phi-cascader-control.d.ts +9 -3
  9. package/components/controls/phi-cascader-control.js +38 -10
  10. package/components/controls/phi-checkbox-group-control.d.ts +3 -1
  11. package/components/controls/phi-checkbox-group-control.js +2 -2
  12. package/components/controls/phi-collapse-control.d.ts +9 -2
  13. package/components/controls/phi-collapse-control.js +14 -2
  14. package/components/controls/phi-color-control.d.ts +3 -1
  15. package/components/controls/phi-color-control.js +2 -2
  16. package/components/controls/phi-color-field-control.d.ts +6 -1
  17. package/components/controls/phi-color-field-control.js +2 -2
  18. package/components/controls/phi-confirm-control.d.ts +1 -1
  19. package/components/controls/phi-confirm-control.js +71 -2
  20. package/components/controls/phi-confirm-dialog.js +2 -1
  21. package/components/controls/phi-date-picker-control.js +1 -1
  22. package/components/controls/phi-dimension-control.d.ts +3 -1
  23. package/components/controls/phi-dimension-control.js +2 -2
  24. package/components/controls/phi-geometry-control.js +1 -1
  25. package/components/controls/phi-length-control.d.ts +6 -1
  26. package/components/controls/phi-length-control.js +3 -2
  27. package/components/controls/phi-multi-select-control.d.ts +6 -1
  28. package/components/controls/phi-multi-select-control.js +3 -3
  29. package/components/controls/phi-segmented-control.d.ts +6 -1
  30. package/components/controls/phi-segmented-control.js +3 -3
  31. package/components/controls/phi-switch-control.d.ts +3 -1
  32. package/components/controls/phi-switch-control.js +3 -3
  33. package/components/controls/phi-table-control.d.ts +8 -1
  34. package/components/controls/phi-table-control.js +8 -2
  35. package/components/forms/compound-form-controls.js +16 -1
  36. package/components/layouts/clients/phi-collapsible-layout-client.js +2 -6
  37. package/components/media/media-widget-labels.d.ts +2 -0
  38. package/components/media/media-widget-labels.js +2 -0
  39. package/components/media/phi-asset-inspector-section.js +19 -1
  40. package/components/regions/presets/phi-area-shell-preset-nodes.js +2 -0
  41. package/components/shell/phi-builder-icon.js +9 -1
  42. package/components/tables/phi-table-surface.d.ts +25 -0
  43. package/components/tables/phi-table-surface.js +25 -0
  44. package/components/widgets/builder/phi-static-rows-editor.js +4 -1
  45. package/components/widgets/client/shared/phi-choice-controller.d.ts +8 -1
  46. package/components/widgets/client/shared/phi-choice-controller.js +16 -1
  47. package/components/widgets/config/choice-shared.d.ts +2 -0
  48. package/components/widgets/config/choice-shared.js +1 -0
  49. package/components/widgets/config/image-variant-options.d.ts +4 -1
  50. package/components/widgets/config/image-variant-options.js +27 -14
  51. package/components/widgets/inspector-field-row.d.ts +14 -1
  52. package/components/widgets/inspector-field-row.js +21 -1
  53. package/components/widgets/label-sets/builder-chrome.js +2 -0
  54. package/components/widgets/label-sets/inspector.js +10 -0
  55. package/components/widgets/label-sets/security.js +2 -0
  56. package/components/widgets/label-types/inspector.d.ts +5 -0
  57. package/components/widgets/label-types/inspector.js +5 -0
  58. package/components/widgets/label-types/security.d.ts +2 -0
  59. package/components/widgets/signals/signal-endpoint-list.js +4 -1
  60. package/helpers/cms-inspector-drawer.d.ts +15 -0
  61. package/helpers/cms-inspector-drawer.js +37 -0
  62. package/helpers/cms-layout-defaults.js +1 -1
  63. package/helpers/preset-tree-contract-check.js +56 -0
  64. package/helpers/text-source.js +2 -0
  65. package/package.json +4 -4
  66. package/plugins/runtime-modules/accounting/definition.d.ts +1 -1
  67. package/plugins/runtime-modules/accounting/definition.js +0 -1
  68. package/plugins/runtime-modules/accounting/ids.d.ts +4 -4
  69. package/plugins/runtime-modules/accounting/ids.js +4 -2
  70. package/plugins/runtime-modules/accounting/module.d.ts +1 -1
  71. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +2 -1
  72. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +5 -4
  73. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +80 -38
  74. package/plugins/runtime-modules/admin/definition.d.ts +1 -1
  75. package/plugins/runtime-modules/admin/definition.js +0 -1
  76. package/plugins/runtime-modules/admin/module.d.ts +1 -1
  77. package/plugins/runtime-modules/app/definition.d.ts +1 -1
  78. package/plugins/runtime-modules/app/definition.js +0 -1
  79. package/plugins/runtime-modules/app/module.d.ts +1 -1
  80. package/plugins/runtime-modules/area-base-definition.d.ts +19 -1
  81. package/plugins/runtime-modules/area-base-definition.js +18 -0
  82. package/plugins/runtime-modules/area-definitions.d.ts +8 -8
  83. package/plugins/runtime-modules/area-definitions.js +4 -3
  84. package/plugins/runtime-modules/area-root-route.d.ts +8 -0
  85. package/plugins/runtime-modules/area-root-route.js +11 -1
  86. package/plugins/runtime-modules/asset/labels.js +4 -0
  87. package/plugins/runtime-modules/asset/metadata-form.d.ts +0 -28
  88. package/plugins/runtime-modules/asset/metadata-form.js +6 -10
  89. package/plugins/runtime-modules/asset/services/options.d.ts +3 -2
  90. package/plugins/runtime-modules/asset/services/options.js +4 -3
  91. package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +2 -1
  92. package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +3 -3
  93. package/plugins/runtime-modules/auth/widgets/security/client.js +2 -2
  94. package/plugins/runtime-modules/builder/addresses.d.ts +1 -1
  95. package/plugins/runtime-modules/builder/addresses.js +1 -1
  96. package/plugins/runtime-modules/builder/area-settings-form.js +1 -1
  97. package/plugins/runtime-modules/builder/clients/inspector-condition-group.d.ts +16 -0
  98. package/plugins/runtime-modules/builder/clients/inspector-condition-group.js +9 -0
  99. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +97 -10
  100. package/plugins/runtime-modules/builder/clients/pages-header.js +7 -6
  101. package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
  102. package/plugins/runtime-modules/builder/controller/workspace-controller.js +7 -4
  103. package/plugins/runtime-modules/builder/definition.d.ts +1 -1
  104. package/plugins/runtime-modules/builder/definition.js +0 -1
  105. package/plugins/runtime-modules/builder/offered-page-catalog.d.ts +10 -4
  106. package/plugins/runtime-modules/builder/offered-page-catalog.js +35 -8
  107. package/plugins/runtime-modules/builder/page-meta-form.js +5 -2
  108. package/plugins/runtime-modules/builder/plugin-meta-labels.js +8 -0
  109. package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +4 -2
  110. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +20 -13
  111. package/plugins/runtime-modules/builder/workspace-catalog-actions.js +8 -1
  112. package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.js +26 -14
  113. package/plugins/runtime-modules/core/authoring-widgets.js +2 -1
  114. package/plugins/runtime-modules/core/messaging/label-defaults.d.ts +49 -0
  115. package/plugins/runtime-modules/core/messaging/label-defaults.js +48 -0
  116. package/plugins/runtime-modules/core/messaging/labels.d.ts +2 -28
  117. package/plugins/runtime-modules/core/messaging/labels.js +52 -23
  118. package/plugins/runtime-modules/core/widgets/card/config.d.ts +14 -0
  119. package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +14 -0
  120. package/plugins/runtime-modules/core/widgets/description/config.d.ts +14 -0
  121. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +14 -0
  122. package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +14 -0
  123. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +14 -0
  124. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +14 -0
  125. package/plugins/runtime-modules/core/widgets/result/config.d.ts +14 -0
  126. package/plugins/runtime-modules/core/widgets/select-box/client.js +13 -4
  127. package/plugins/runtime-modules/core/widgets/select-box/config.js +1 -0
  128. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +14 -0
  129. package/plugins/runtime-modules/core/widgets/table/client.js +11 -4
  130. package/plugins/runtime-modules/core/widgets/table/config.d.ts +1 -1143
  131. package/plugins/runtime-modules/core/widgets/table/config.js +144 -125
  132. package/plugins/runtime-modules/core/widgets/thread-conversation/authoring.d.ts +2 -0
  133. package/plugins/runtime-modules/core/widgets/thread-conversation/authoring.js +76 -0
  134. package/plugins/runtime-modules/core/widgets/thread-conversation/client.d.ts +44 -1
  135. package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +28 -13
  136. package/plugins/runtime-modules/editor/definition.d.ts +1 -1
  137. package/plugins/runtime-modules/editor/definition.js +0 -1
  138. package/plugins/runtime-modules/editor/module.d.ts +1 -1
  139. package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +16 -8
  140. package/plugins/runtime-modules/public/definition.d.ts +1 -1
  141. package/plugins/runtime-modules/public/definition.js +0 -1
  142. package/plugins/runtime-modules/public/module.d.ts +1 -1
  143. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +109 -86
  144. package/plugins/runtime-modules/threads/controller/client.js +10 -12
  145. package/plugins/runtime-modules/threads/controller/definition.d.ts +6 -0
  146. package/plugins/runtime-modules/threads/controller/definition.js +17 -6
  147. package/styles/controls.css +49 -1
  148. package/styles/layout.css +3 -2
  149. package/types/calendar.d.ts +5 -0
  150. package/types/cms-plugins.d.ts +30 -10
  151. package/types/table-widget.d.ts +6 -0
@@ -333,6 +333,20 @@ export declare const PHI_RESULT_WIDGET_DEFINITION: {
333
333
  editorPlacement?: "inspector" | "geometry" | "toolbar";
334
334
  visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
335
335
  heading?: string;
336
+ } & {
337
+ type: "condition-group";
338
+ conditionFields: import("../../../../../types").PhiCmsConfigField[];
339
+ defaultCondition: Record<string, unknown>;
340
+ addLabel?: string;
341
+ emptyLabel?: string;
342
+ }) | ({
343
+ key: string;
344
+ label: string;
345
+ description?: string;
346
+ required?: boolean;
347
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
348
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
349
+ heading?: string;
336
350
  } & {
337
351
  type: "surface";
338
352
  tone?: false;
@@ -20,14 +20,23 @@ export function PhiSelectBoxWidget({ config, sender, signalsEnabled = true, valu
20
20
  sender,
21
21
  });
22
22
  const fill = mode === "control" || mode === "config";
23
+ /*
24
+ * As wide as the box it stands in. On a Page that box is the Widget's slot frame, which is as wide as
25
+ * its content unless the placement gives it a width (`size`) -- so an unsized select keeps its own
26
+ * width, at least four control heights, and a sized one fills what it was given, label included.
27
+ */
23
28
  const controlStyle = {
24
29
  minWidth: fill ? 0 : minWidth,
25
- width: fill ? "100%" : undefined,
30
+ width: "100%",
26
31
  };
32
+ // Cleared, the select answers nothing; the Control holds and announces that as the empty value.
27
33
  const handleChange = (nextValue) => {
28
- choice.publish(nextValue);
29
- onChange?.(nextValue);
34
+ const held = nextValue ?? "";
35
+ choice.publish(held);
36
+ onChange?.(held);
30
37
  };
31
- const control = (_jsx(PhiSelectControl, { label: resolvedConfig.label, description: resolvedConfig.description, value: choice.value, placeholder: resolvedConfig.placeholder, disabled: choice.disabled, readOnly: choice.readOnly, size: resolvedConfig.controlSize, presentation: resolvedConfig.presentation, allowCustom: resolvedConfig.allowCustom, options: choice.options, onFocus: choice.emitFocus, onBlur: choice.emitBlur, onChange: handleChange, style: controlStyle }));
38
+ const control = (_jsx(PhiSelectControl, { label: resolvedConfig.label, description: resolvedConfig.description,
39
+ // Nothing chosen shows the placeholder, not an empty choice.
40
+ value: choice.value === "" ? undefined : choice.value, placeholder: resolvedConfig.placeholder, disabled: choice.disabled, readOnly: choice.readOnly, size: resolvedConfig.controlSize, presentation: resolvedConfig.presentation, allowCustom: resolvedConfig.allowCustom, allowClear: resolvedConfig.allowClear, options: choice.options, onSearch: choice.onSearch, filterOptionsLocally: choice.filterOptionsLocally, onFocus: choice.emitFocus, onBlur: choice.emitBlur, onChange: handleChange, style: controlStyle }));
32
41
  return control;
33
42
  }
@@ -32,6 +32,7 @@ export const PHI_SELECT_BOX_WIDGET_DEFINITION = {
32
32
  ],
33
33
  },
34
34
  { key: "allowCustom", type: "boolean", label: "Allow Custom Values" },
35
+ { key: "allowClear", type: "boolean", label: "Allow Clear" },
35
36
  ...buildPhiChoiceControlOptionFields("toolbar"),
36
37
  ...PHI_CHOICE_CONTROL_CONFIG_FIELDS,
37
38
  ],
@@ -349,6 +349,20 @@ export declare const PHI_SIMPLE_TEXT_WIDGET_DEFINITION: {
349
349
  editorPlacement?: "inspector" | "geometry" | "toolbar";
350
350
  visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
351
351
  heading?: string;
352
+ } & {
353
+ type: "condition-group";
354
+ conditionFields: import("../../../../../types").PhiCmsConfigField[];
355
+ defaultCondition: Record<string, unknown>;
356
+ addLabel?: string;
357
+ emptyLabel?: string;
358
+ }) | ({
359
+ key: string;
360
+ label: string;
361
+ description?: string;
362
+ required?: boolean;
363
+ editorPlacement?: "inspector" | "geometry" | "toolbar";
364
+ visibleWhen?: import("../../../../../types").PhiCmsConfigFieldVisibilityRule | readonly import("../../../../../types").PhiCmsConfigFieldVisibilityRule[];
365
+ heading?: string;
352
366
  } & {
353
367
  type: "surface";
354
368
  tone?: false;
@@ -944,7 +944,7 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
944
944
  afterRowIdentity: null,
945
945
  }).catch(() => undefined).finally(clearPhiDataDragPayload);
946
946
  }
947
- : undefined, loading: effectiveLoading, loadingRows: presentation.loadingRows, bordered: presentation.borders, striped: presentation.row?.striped, showHeader: presentation.header, stickyHeader: presentation.stickyHeader !== false, size: resolvedControlSize, emptyText: (_jsxs(PhiFlexControl, { vertical: true, gap: "small", children: [_jsx(PhiTypographyControl, { strong: true, children: refusal?.message ?? presentation.emptyState?.title ?? labels.emptyTitle }), emptyDescription && !refusal ? _jsx(PhiTypographyControl, { type: "secondary", children: emptyDescription }) : null] })), layout: presentation.layout, footer: footer, summary: tableSummary })] }));
947
+ : undefined, loading: effectiveLoading, loadingRows: presentation.loadingRows, bordered: presentation.borders, surface: presentation.surface, striped: presentation.row?.striped, showHeader: presentation.header, stickyHeader: presentation.stickyHeader !== false, size: resolvedControlSize, emptyText: (_jsxs(PhiFlexControl, { vertical: true, gap: "small", children: [_jsx(PhiTypographyControl, { strong: true, children: refusal?.message ?? presentation.emptyState?.title ?? labels.emptyTitle }), emptyDescription && !refusal ? _jsx(PhiTypographyControl, { type: "secondary", children: emptyDescription }) : null] })), layout: presentation.layout, footer: footer, summary: tableSummary })] }));
948
948
  }
949
949
  function TableAction({ action, disabled = false, disabledReason, templateValue, size, onActivate }) {
950
950
  const icon = action.icon ? resolvePhiButtonIcon(action.icon) : null;
@@ -971,7 +971,13 @@ function TableAction({ action, disabled = false, disabledReason, templateValue,
971
971
  if (action.execution === "link" && action.link) {
972
972
  return disabled ? content : _jsx(PhiLink, { href: action.link.href, external: action.link.external, newTab: action.link.newTab, children: content });
973
973
  }
974
- return action.confirm && !disabled ? (_jsx(PhiConfirmControl, { title: formatTableActionTemplate(action.confirm.title, templateValue), description: action.confirm.alert ? (_jsxs(PhiFlexControl, { vertical: true, gap: "small", children: [action.confirm.description ? (_jsx("span", { children: formatTableActionTemplate(action.confirm.description, templateValue) })) : null, _jsx(PhiAlertControl, { level: action.confirm.alert.level, title: formatTableActionTemplate(action.confirm.alert.title, templateValue), description: formatTableActionTemplate(action.confirm.alert.description, templateValue) })] })) : formatTableActionTemplate(action.confirm.description, templateValue), confirmLabel: action.confirm.okText, cancelLabel: action.confirm.cancelText, danger: danger, placement: "left", onConfirm: onActivate, children: content })) : content;
974
+ /*
975
+ * Below the button, its right edge on the button's: the actions stand at a Table's right end, and a
976
+ * confirmation beside them had nowhere to go on a phone -- placed to the left it ran past the window's
977
+ * left edge, and Ant Design neither moves such a box sideways nor finds room for it on the right. Above
978
+ * or below, it is flipped to where there is room and shifted along the edge into the window.
979
+ */
980
+ return action.confirm && !disabled ? (_jsx(PhiConfirmControl, { title: formatTableActionTemplate(action.confirm.title, templateValue), description: action.confirm.alert ? (_jsxs(PhiFlexControl, { vertical: true, gap: "small", children: [action.confirm.description ? (_jsx("span", { children: formatTableActionTemplate(action.confirm.description, templateValue) })) : null, _jsx(PhiAlertControl, { level: action.confirm.alert.level, title: formatTableActionTemplate(action.confirm.alert.title, templateValue), description: formatTableActionTemplate(action.confirm.alert.description, templateValue) })] })) : formatTableActionTemplate(action.confirm.description, templateValue), confirmLabel: action.confirm.okText, cancelLabel: action.confirm.cancelText, danger: danger, placement: "bottomRight", onConfirm: onActivate, children: content })) : content;
975
981
  }
976
982
  function TableBindingTool({ field, tool, sourceConfig, value, size, onChange, onCreate }) {
977
983
  const [popoverOpen, setPopoverOpen] = useState(false);
@@ -1039,8 +1045,9 @@ function TableFilter({ filter, field, sourceConfig, value, size, onChange, label
1039
1045
  }
1040
1046
  if (filter.type === "boolean") {
1041
1047
  if (filter.control === "switch") {
1042
- // A switch answers yes or no and nothing else, so an absent value reads as off.
1043
- return _jsx(PhiSwitchControl, { checked: value === true, size: size === "large" ? undefined : size, onChange: (next) => onChange(next) });
1048
+ // A switch answers yes or no and nothing else, so an absent value reads as off. Its label stands
1049
+ // beside it as text, not as its name -- so the filter's label is also its accessible name.
1050
+ return _jsx(PhiSwitchControl, { checked: value === true, size: size === "large" ? undefined : size, ariaLabel: filter.label, onChange: (next) => onChange(next) });
1044
1051
  }
1045
1052
  return _jsx(PhiSelectControl, { allowClear: true, value: typeof value === "boolean" ? String(value) : undefined, options: [{ value: "true", label: labels.yes }, { value: "false", label: labels.no }], size: size, placeholder: hiddenLabelPlaceholder, onChange: (next) => onChange(next === undefined ? undefined : next === "true"), style: { minWidth: 140 } });
1046
1053
  }