@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 +4 -0
- package/contracts/unit/2/unit.ts +10 -0
- package/dist/{autocomplete-TWBUFBPK.js → autocomplete-X6EHYE3C.js} +1 -1
- package/dist/{chunk-F6THHPXZ.js → chunk-AK4GIOIA.js} +32 -3
- package/dist/contracts/unit.d.ts +10 -0
- package/dist/{date-MILP7DAY.js → date-3ERTXTH6.js} +1 -1
- package/dist/{menu-DLZOBFXB.js → menu-3VTEQUFY.js} +1 -1
- package/dist/{rich-text-EFOTPYBP.js → rich-text-WW3QDJRD.js} +1 -1
- package/dist/runtime/index.css +6 -0
- package/dist/runtime/index.js +9 -9
- package/dist/runtime/parameter-input-context.d.ts +5 -0
- package/dist/runtime/renderer-families.json +8 -8
- package/dist/{select-GAAOKMWC.js → select-ZHDSD2DT.js} +1 -1
- package/dist/{tab-menu-AIXU7FUG.js → tab-menu-BCHQQXDF.js} +1 -1
- package/dist/{webcomponent-GL3RN3YI.js → webcomponent-WSHWI6TX.js} +1 -1
- package/dist/{widgets-JZWFRF3E.js → widgets-ZTPJN5LP.js} +1 -1
- package/package.json +2 -2
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.
|
package/contracts/unit/2/unit.ts
CHANGED
|
@@ -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;
|
|
@@ -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(
|
|
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,
|
package/dist/contracts/unit.d.ts
CHANGED
|
@@ -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;
|
package/dist/runtime/index.css
CHANGED
package/dist/runtime/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
iconName,
|
|
14
14
|
rendererFamiliesOf,
|
|
15
15
|
rendererFamilyNames
|
|
16
|
-
} from "../chunk-
|
|
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-
|
|
171
|
-
date: () => import("../date-
|
|
172
|
-
autocomplete: () => import("../autocomplete-
|
|
173
|
-
"rich-text": () => import("../rich-text-
|
|
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-
|
|
177
|
-
widgets: () => import("../widgets-
|
|
178
|
-
menu: () => import("../menu-
|
|
179
|
-
"tab-menu": () => import("../tab-menu-
|
|
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
|
|
@@ -114,13 +114,13 @@
|
|
|
114
114
|
"modules": {
|
|
115
115
|
"table": "table-FELNJICP.js",
|
|
116
116
|
"media": "media-IECUTXW5.js",
|
|
117
|
-
"webcomponent": "webcomponent-
|
|
118
|
-
"widgets": "widgets-
|
|
119
|
-
"menu": "menu-
|
|
120
|
-
"tab-menu": "tab-menu-
|
|
121
|
-
"select": "select-
|
|
122
|
-
"date": "date-
|
|
123
|
-
"autocomplete": "autocomplete-
|
|
124
|
-
"rich-text": "rich-text-
|
|
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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orangelogic/myos-gen1",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
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.
|
|
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
|
},
|