@orangelogic/myos-gen1 1.0.0-alpha.8 → 1.0.0-alpha.9

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
@@ -53,3 +53,7 @@ Consumers own component implementations, registry publication, release manifests
53
53
  The scroll binding resolves its owning control through native display:contents wrappers and ignores nested control scrolls. Use `discoverComponents(componentProjectRoot)` with an explicit project root; standalone builds use `checkBoundaries`, while `checkLayout` remains the legacy bare-component layout checker. The emitted stylesheet is `mount.css`; Release assembly should consume `mount.css` and include it in the source-digest recipe.
54
54
 
55
55
  `buildComponent({root, project})` accepts an explicit shared dependency manifest for bare first-party components; source ownership remains confined to `root`. Standalone consumers omit `project`. The distribution includes `protocols/dotnet/*` for the registry's project reference.
56
+
57
+ Parameter textareas start at one row and use the textarea atom's content autosizing, including shrinking after a host refresh or cancel. Ordinary textareas retain the atom's four-row/manual-resize defaults; password parameters retain password input privacy. The atom owns horizontal padding so its native resize grip reaches the control edge in manual mode, while labels keep the same text inset.
58
+
59
+ Protocol 2 parameter editors may carry optional `origin` presentation metadata: `kind` (`profile`, `local-session` or `user-session`), safe hexadecimal `color`, optional `inherited` and optional profile `depth` (0..255). Cortex resolves visibility, precedence and the configured palette. The runtime draws the origin line without accepting arbitrary CSS or changing parameter actions; inherited origins use a dashed line and current origins a solid line. Older units without metadata show no line. Protocol 1 remains frozen. This restores the compact legacy parameter-text behavior and configured origin meaning without copying legacy skin classes into React.
@@ -56,6 +56,16 @@ export interface NodeBase {
56
56
  export interface ParameterEditor {
57
57
  readonly detailsLabel?: string; readonly resetLabel?: string; readonly resolveLabel?: string;
58
58
  readonly comment?: string; readonly info?: string; readonly hideInput?: boolean; readonly readOnly?: boolean;
59
+ /** Effective configured origin indicator. Absent on older units or when the legacy indicator is hidden. */
60
+ readonly origin?: ParameterOrigin;
61
+ }
62
+ export interface ParameterOrigin {
63
+ readonly kind: 'profile' | 'local-session' | 'user-session';
64
+ /** Canonical hexadecimal color; never a CSS declaration or a skin class. */
65
+ readonly color: string;
66
+ readonly inherited?: boolean;
67
+ /** Profile depth in the bounded range 0..255. */
68
+ readonly depth?: number;
59
69
  }
60
70
  export interface InputNode extends NodeBase {
61
71
  readonly required?: boolean; readonly autoFocus?: boolean; readonly warning?: string;
@@ -2,7 +2,7 @@ import {
2
2
  CREATE_ENTRY_VALUE,
3
3
  Text,
4
4
  inputAccessibility
5
- } from "./chunk-F6THHPXZ.js";
5
+ } from "./chunk-AK4GIOIA.js";
6
6
  import {
7
7
  useFire,
8
8
  useInputValue
@@ -106,7 +106,7 @@ function DeferredFamily({ registry, family, render, fallback }) {
106
106
  }
107
107
 
108
108
  // packages/gen1/src/runtime/controls.tsx
109
- import { Fragment, memo, useEffect as useEffect3, useRef as useRef3, useState as useState3 } from "react";
109
+ import { Fragment, memo, useContext as useContext3, useEffect as useEffect3, useRef as useRef3, useState as useState3 } from "react";
110
110
  import { CxAlert } from "@orangelogic/design-system-react/alert";
111
111
  import { CxBox as CxBox2 } from "@orangelogic/design-system-react/box";
112
112
  import { CxButton as CxButton2 } from "@orangelogic/design-system-react/button";
@@ -298,21 +298,46 @@ function isGroupHit(target, group, unit) {
298
298
  }
299
299
 
300
300
  // packages/gen1/src/runtime/parameter-editor.tsx
301
- import { useCallback, useSyncExternalStore } from "react";
301
+ import { useCallback, useMemo, useSyncExternalStore } from "react";
302
302
  import { CxBox } from "@orangelogic/design-system-react/box";
303
303
  import { CxButton } from "@orangelogic/design-system-react/button";
304
304
  import { CxTypography } from "@orangelogic/design-system-react/typography";
305
+
306
+ // packages/gen1/src/runtime/parameter-input-context.ts
307
+ import { createContext as createContext2 } from "react";
308
+ var ParameterInputContext = createContext2(void 0);
309
+
310
+ // packages/gen1/src/runtime/parameter-editor.tsx
305
311
  import { jsx as jsx3, jsxs } from "react/jsx-runtime";
312
+ var maximumParameterOriginDepth = 255;
313
+ function isParameterOrigin(value) {
314
+ if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
315
+ const origin = value;
316
+ return ["profile", "local-session", "user-session"].includes(origin.kind) && typeof origin.color === "string" && /^#(?:[\da-f]{6}|[\da-f]{8})$/i.test(origin.color) && (origin.inherited === void 0 || typeof origin.inherited === "boolean") && (origin.depth === void 0 || Number.isInteger(origin.depth) && origin.depth >= 0 && origin.depth <= maximumParameterOriginDepth);
317
+ }
306
318
  function ParameterEditorView({ control, unit, ctx }) {
307
319
  const subscribe = useCallback((notify) => ctx.host.subscribe(ctx.host.unitId, notify), [ctx.host]);
308
320
  const snapshot = useCallback(() => ctx.host.getParameterReset?.(unit.id, control.id) ?? false, [ctx.host, unit.id, control.id]);
309
321
  const reset = useSyncExternalStore(subscribe, snapshot);
310
322
  const parameter = control.parameter;
323
+ const inputScope = useMemo(() => ({ unitId: unit.id, controlId: control.id }), [unit.id, control.id]);
324
+ const input = { ...control, parameter: void 0, readOnly: control.readOnly || parameter.readOnly };
325
+ const origin = parameter.origin;
311
326
  const disabled = control.disabled || control.readOnly;
312
327
  const actions = unit.triggers[control.id] ?? [];
313
328
  return /* @__PURE__ */ jsxs(CxBox, { className: "uic-parameter", "data-parameter-reset": reset || void 0, children: [
314
- !parameter.hideInput && /* @__PURE__ */ jsx3(ControlView, { control: { ...control, parameter: void 0, readOnly: control.readOnly || parameter.readOnly }, unit, ctx }),
329
+ !parameter.hideInput && /* @__PURE__ */ jsx3(ParameterInputContext.Provider, { value: inputScope, children: /* @__PURE__ */ jsx3(ControlView, { control: input, unit, ctx }) }),
315
330
  parameter.hideInput && /* @__PURE__ */ jsx3(CxTypography, { children: /* @__PURE__ */ jsx3(Text, { value: control.label, html: control.html }) }),
331
+ isParameterOrigin(origin) && /* @__PURE__ */ jsx3(
332
+ CxBox,
333
+ {
334
+ className: "uic-parameter-origin",
335
+ "aria-hidden": "true",
336
+ "data-parameter-origin": origin.kind,
337
+ "data-parameter-inherited": origin.inherited || void 0,
338
+ style: { borderBlockEndColor: origin.color }
339
+ }
340
+ ),
316
341
  parameter.info && /* @__PURE__ */ jsx3(CxTypography, { children: /* @__PURE__ */ jsx3(Text, { value: parameter.info, html: true }) }),
317
342
  parameter.comment && /* @__PURE__ */ jsx3(
318
343
  CxButton,
@@ -675,6 +700,8 @@ function TextInput({ control, unit, ctx }) {
675
700
  );
676
701
  }
677
702
  function TextareaInput({ control, unit, ctx }) {
703
+ const parameterInput = useContext3(ParameterInputContext);
704
+ const autoSize = parameterInput?.unitId === unit.id && parameterInput.controlId === control.id;
678
705
  const [value, setValue] = useControlValue(ctx.host, unit.id, control.id, unit.inputs[control.id]);
679
706
  const fire = useFire(ctx.host, unit.id, unit.triggers);
680
707
  if (control.wysiwyg) return /* @__PURE__ */ jsx5(Unsupported, { control, detail: "wysiwyg" });
@@ -682,6 +709,8 @@ function TextareaInput({ control, unit, ctx }) {
682
709
  CxTextarea,
683
710
  {
684
711
  ...inputAccessibility(control),
712
+ rows: autoSize ? 1 : void 0,
713
+ resize: autoSize ? "auto" : void 0,
685
714
  maxLength: control.maxLength && control.maxLength > 0 ? control.maxLength : void 0,
686
715
  "data-control-id": control.id,
687
716
  autoFocus: control.autoFocus,
@@ -58,6 +58,16 @@ export interface ParameterEditor {
58
58
  readonly info?: string;
59
59
  readonly hideInput?: boolean;
60
60
  readonly readOnly?: boolean;
61
+ /** Effective configured origin indicator. Absent on older units or when the legacy indicator is hidden. */
62
+ readonly origin?: ParameterOrigin;
63
+ }
64
+ export interface ParameterOrigin {
65
+ readonly kind: 'profile' | 'local-session' | 'user-session';
66
+ /** Canonical hexadecimal color; never a CSS declaration or a skin class. */
67
+ readonly color: string;
68
+ readonly inherited?: boolean;
69
+ /** Profile depth in the bounded range 0..255. */
70
+ readonly depth?: number;
61
71
  }
62
72
  export interface InputNode extends NodeBase {
63
73
  readonly required?: boolean;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Text
3
- } from "./chunk-F6THHPXZ.js";
3
+ } from "./chunk-AK4GIOIA.js";
4
4
  import {
5
5
  useFire,
6
6
  useInputValue
@@ -7,7 +7,7 @@ import {
7
7
  hasExtendedEvents,
8
8
  iconName,
9
9
  isDropdownPanel
10
- } from "./chunk-F6THHPXZ.js";
10
+ } from "./chunk-AK4GIOIA.js";
11
11
  import {
12
12
  isUnit
13
13
  } from "./chunk-BTZWYDJT.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-HGWP6ELB.js";
4
4
  import {
5
5
  Text
6
- } from "./chunk-F6THHPXZ.js";
6
+ } from "./chunk-AK4GIOIA.js";
7
7
  import {
8
8
  useControlValue,
9
9
  useFire
@@ -68,3 +68,9 @@
68
68
  width: 100%;
69
69
  overflow: hidden;
70
70
  }
71
+ .uic-parameter-origin {
72
+ border-block-end: var(--cx-spacing-3x-small) solid;
73
+ }
74
+ .uic-parameter-origin[data-parameter-inherited=true] {
75
+ border-block-end-style: dashed;
76
+ }
@@ -13,7 +13,7 @@ import {
13
13
  iconName,
14
14
  rendererFamiliesOf,
15
15
  rendererFamilyNames
16
- } from "../chunk-F6THHPXZ.js";
16
+ } from "../chunk-AK4GIOIA.js";
17
17
  import {
18
18
  UnitStoreContext,
19
19
  createUnitStore,
@@ -167,16 +167,16 @@ function createRuntime(loaders) {
167
167
 
168
168
  // packages/gen1/src/runtime/renderer-loaders.ts
169
169
  var rendererLoaders = {
170
- select: () => import("../select-GAAOKMWC.js"),
171
- date: () => import("../date-MILP7DAY.js"),
172
- autocomplete: () => import("../autocomplete-TWBUFBPK.js"),
173
- "rich-text": () => import("../rich-text-EFOTPYBP.js"),
170
+ select: () => import("../select-ZHDSD2DT.js"),
171
+ date: () => import("../date-3ERTXTH6.js"),
172
+ autocomplete: () => import("../autocomplete-X6EHYE3C.js"),
173
+ "rich-text": () => import("../rich-text-WW3QDJRD.js"),
174
174
  table: () => import("../table-FELNJICP.js"),
175
175
  media: () => import("../media-IECUTXW5.js"),
176
- webcomponent: () => import("../webcomponent-GL3RN3YI.js"),
177
- widgets: () => import("../widgets-JZWFRF3E.js"),
178
- menu: () => import("../menu-DLZOBFXB.js"),
179
- "tab-menu": () => import("../tab-menu-AIXU7FUG.js")
176
+ webcomponent: () => import("../webcomponent-WSHWI6TX.js"),
177
+ widgets: () => import("../widgets-ZTPJN5LP.js"),
178
+ menu: () => import("../menu-3VTEQUFY.js"),
179
+ "tab-menu": () => import("../tab-menu-BCHQQXDF.js")
180
180
  };
181
181
 
182
182
  // packages/gen1/src/runtime/index.ts
@@ -0,0 +1,5 @@
1
+ /** Presentation scope survives metadata removal without changing control/event dispatch. */
2
+ export declare const ParameterInputContext: import("react").Context<Readonly<{
3
+ unitId: string;
4
+ controlId: string;
5
+ }> | undefined>;
@@ -114,13 +114,13 @@
114
114
  "modules": {
115
115
  "table": "table-FELNJICP.js",
116
116
  "media": "media-IECUTXW5.js",
117
- "webcomponent": "webcomponent-GL3RN3YI.js",
118
- "widgets": "widgets-JZWFRF3E.js",
119
- "menu": "menu-DLZOBFXB.js",
120
- "tab-menu": "tab-menu-AIXU7FUG.js",
121
- "select": "select-GAAOKMWC.js",
122
- "date": "date-MILP7DAY.js",
123
- "autocomplete": "autocomplete-TWBUFBPK.js",
124
- "rich-text": "rich-text-EFOTPYBP.js"
117
+ "webcomponent": "webcomponent-WSHWI6TX.js",
118
+ "widgets": "widgets-ZTPJN5LP.js",
119
+ "menu": "menu-3VTEQUFY.js",
120
+ "tab-menu": "tab-menu-BCHQQXDF.js",
121
+ "select": "select-ZHDSD2DT.js",
122
+ "date": "date-3ERTXTH6.js",
123
+ "autocomplete": "autocomplete-X6EHYE3C.js",
124
+ "rich-text": "rich-text-WW3QDJRD.js"
125
125
  }
126
126
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Text,
3
3
  inputAccessibility
4
- } from "./chunk-F6THHPXZ.js";
4
+ } from "./chunk-AK4GIOIA.js";
5
5
  import {
6
6
  useControlValue,
7
7
  useFire
@@ -3,7 +3,7 @@ import {
3
3
  Text,
4
4
  activate,
5
5
  iconName
6
- } from "./chunk-F6THHPXZ.js";
6
+ } from "./chunk-AK4GIOIA.js";
7
7
  import "./chunk-BTZWYDJT.js";
8
8
 
9
9
  // packages/gen1/src/runtime/tab-menu.tsx
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ControlView
3
- } from "./chunk-F6THHPXZ.js";
3
+ } from "./chunk-AK4GIOIA.js";
4
4
  import {
5
5
  isUnit,
6
6
  useControlValue,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Text
3
- } from "./chunk-F6THHPXZ.js";
3
+ } from "./chunk-AK4GIOIA.js";
4
4
  import {
5
5
  useControlValue,
6
6
  useFire
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orangelogic/myos-gen1",
3
- "version": "1.0.0-alpha.8",
3
+ "version": "1.0.0-alpha.9",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "files": [
@@ -45,7 +45,7 @@
45
45
  "gen1-build": "./scripts/build.mjs"
46
46
  },
47
47
  "peerDependencies": {
48
- "@orangelogic/design-system-react": "1.0.0-alpha.8",
48
+ "@orangelogic/design-system-react": "1.0.0-alpha.9",
49
49
  "react": "^19.3.0",
50
50
  "react-dom": "^19.3.0"
51
51
  },