@inf-monkeys-tech/monkeys 1.1.72 → 1.1.74
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/lib/contracts/bento-block.d.ts +14 -0
- package/lib/contracts/bento-block.d.ts.map +1 -1
- package/lib/contracts/bento-block.js +16 -0
- package/lib/contracts/bento-block.js.map +1 -1
- package/lib/contracts/render.d.ts +4 -0
- package/lib/contracts/render.d.ts.map +1 -1
- package/lib/contracts/render.js +4 -0
- package/lib/contracts/render.js.map +1 -1
- package/lib/esm/{chunk-DOQFYTAY.mjs → chunk-ES3EYSBV.mjs} +2 -2
- package/lib/esm/{chunk-HFNPLMKA.mjs → chunk-FNYVI3AY.mjs} +20 -2
- package/lib/esm/chunk-FNYVI3AY.mjs.map +1 -0
- package/lib/esm/{chunk-EMRIN6FD.mjs → chunk-UVLLWRYL.mjs} +2 -2
- package/lib/esm/{chunk-GAAD4RFK.mjs → chunk-WIGX4I2M.mjs} +178 -273
- package/lib/esm/chunk-WIGX4I2M.mjs.map +1 -0
- package/lib/esm/contracts/index.mjs +2 -2
- package/lib/esm/index.mjs +4 -6
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/runtime/index.mjs +3 -5
- package/lib/esm/schemas/index.mjs +2 -2
- package/lib/json-schema/bento-node.schema.json +37 -0
- package/lib/json-schema/overlay-node.schema.json +18 -0
- package/lib/json-schema/page-runtime-bundle.schema.json +18 -0
- package/lib/json-schema/page.schema.json +18 -0
- package/lib/json-schema/render-node.schema.json +18 -0
- package/lib/json-schema/render-tree.schema.json +18 -0
- package/lib/json-schema/view-ontology-record.schema.json +37 -0
- package/lib/runtime/artifact-session.d.ts +0 -8
- package/lib/runtime/artifact-session.d.ts.map +1 -1
- package/lib/runtime/artifact-session.js +10 -114
- package/lib/runtime/artifact-session.js.map +1 -1
- package/lib/runtime/bento-render-tree.d.ts.map +1 -1
- package/lib/runtime/bento-render-tree.js +2 -1
- package/lib/runtime/bento-render-tree.js.map +1 -1
- package/package.json +2 -2
- package/lib/esm/chunk-GAAD4RFK.mjs.map +0 -1
- package/lib/esm/chunk-HFNPLMKA.mjs.map +0 -1
- /package/lib/esm/{chunk-DOQFYTAY.mjs.map → chunk-ES3EYSBV.mjs.map} +0 -0
- /package/lib/esm/{chunk-EMRIN6FD.mjs.map → chunk-UVLLWRYL.mjs.map} +0 -0
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
ManagedFileUriSchema,
|
|
16
16
|
RevisionRefSchema,
|
|
17
17
|
Sha256Schema
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-FNYVI3AY.mjs";
|
|
19
19
|
|
|
20
20
|
// src/contracts/agent-data.ts
|
|
21
21
|
import { z } from "zod";
|
|
@@ -688,4 +688,4 @@ export {
|
|
|
688
688
|
PlatformNotificationSnapshotSchema,
|
|
689
689
|
platformNotificationRoutes
|
|
690
690
|
};
|
|
691
|
-
//# sourceMappingURL=chunk-
|
|
691
|
+
//# sourceMappingURL=chunk-UVLLWRYL.mjs.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
PAGE_STREAM_MAX_FRAME_BYTES,
|
|
5
5
|
PageStreamDescriptorSchema,
|
|
6
6
|
PageStreamEventSchema
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UVLLWRYL.mjs";
|
|
8
8
|
import {
|
|
9
9
|
AccessPolicySchema,
|
|
10
10
|
ActionProgramArtifactSchema,
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
AgentSessionViewModelSchema,
|
|
14
14
|
ApplicationHandoffSchema,
|
|
15
15
|
ArtifactProfileSchema,
|
|
16
|
-
ArtifactViewSchema,
|
|
17
16
|
BENTO_GRID_COLUMNS,
|
|
18
17
|
CapabilityManifestSchema,
|
|
19
18
|
CapabilityRegistryDocumentSchema,
|
|
@@ -126,7 +125,7 @@ import {
|
|
|
126
125
|
require_validation,
|
|
127
126
|
require_validation_error,
|
|
128
127
|
resolveThemeTokens
|
|
129
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-FNYVI3AY.mjs";
|
|
130
129
|
import {
|
|
131
130
|
__commonJS,
|
|
132
131
|
__toESM
|
|
@@ -1084,109 +1083,195 @@ var compileCapabilityRegistry = (sources) => {
|
|
|
1084
1083
|
});
|
|
1085
1084
|
};
|
|
1086
1085
|
|
|
1087
|
-
// src/runtime/
|
|
1088
|
-
function
|
|
1089
|
-
const
|
|
1090
|
-
|
|
1086
|
+
// src/runtime/bento-render-tree.ts
|
|
1087
|
+
function mapContainerLayout(node) {
|
|
1088
|
+
const gap = typeof node.gap === "number" ? node.gap : void 0;
|
|
1089
|
+
if (node.layout === "grid") {
|
|
1090
|
+
return {
|
|
1091
|
+
mode: "grid",
|
|
1092
|
+
columns: node.columns ?? BENTO_GRID_COLUMNS,
|
|
1093
|
+
...typeof node.rowHeight === "number" ? { rowHeight: node.rowHeight } : {},
|
|
1094
|
+
...gap !== void 0 ? { gap } : {}
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
if (node.layout === "split") {
|
|
1098
|
+
return {
|
|
1099
|
+
mode: "split",
|
|
1100
|
+
direction: node.direction === "vertical" ? "column" : "row",
|
|
1101
|
+
...gap !== void 0 ? { gap } : {}
|
|
1102
|
+
};
|
|
1103
|
+
}
|
|
1104
|
+
if (node.layout === "tabs") {
|
|
1105
|
+
return {
|
|
1106
|
+
mode: "tabs",
|
|
1107
|
+
...gap !== void 0 ? { gap } : {}
|
|
1108
|
+
};
|
|
1109
|
+
}
|
|
1110
|
+
if (node.layout === "floating") {
|
|
1111
|
+
return {
|
|
1112
|
+
mode: "floating",
|
|
1113
|
+
...node.floating ? { floating: node.floating } : {},
|
|
1114
|
+
...gap !== void 0 ? { gap } : {}
|
|
1115
|
+
};
|
|
1116
|
+
}
|
|
1117
|
+
return {
|
|
1118
|
+
mode: "flex",
|
|
1119
|
+
direction: node.direction === "horizontal" ? "row" : "column",
|
|
1120
|
+
...gap !== void 0 ? { gap } : {}
|
|
1121
|
+
};
|
|
1091
1122
|
}
|
|
1092
|
-
function
|
|
1093
|
-
const
|
|
1123
|
+
function buildPlacementStyle(node) {
|
|
1124
|
+
const style = {};
|
|
1125
|
+
const grid = node.placement?.grid;
|
|
1126
|
+
if (grid) {
|
|
1127
|
+
style.gridColumn = `${grid.x + 1} / span ${grid.w}`;
|
|
1128
|
+
style.gridRow = `${grid.y + 1} / span ${grid.h}`;
|
|
1129
|
+
}
|
|
1130
|
+
const split = node.placement?.split;
|
|
1131
|
+
if (split?.size !== void 0) {
|
|
1132
|
+
style.flex = typeof split.size === "number" ? `0 0 ${split.size}%` : `0 0 ${split.size}`;
|
|
1133
|
+
}
|
|
1134
|
+
if (split?.minSize !== void 0) {
|
|
1135
|
+
style.minWidth = typeof split.minSize === "number" ? `${split.minSize}px` : split.minSize;
|
|
1136
|
+
}
|
|
1137
|
+
if (split?.maxSize !== void 0) {
|
|
1138
|
+
style.maxWidth = typeof split.maxSize === "number" ? `${split.maxSize}px` : split.maxSize;
|
|
1139
|
+
}
|
|
1140
|
+
return Object.keys(style).length > 0 ? style : void 0;
|
|
1141
|
+
}
|
|
1142
|
+
function mapLeafDataBinding(node, data) {
|
|
1143
|
+
const source = node.block.dataSource;
|
|
1144
|
+
if (!source || source.kind === "static") return void 0;
|
|
1145
|
+
if (source.kind === "statement") {
|
|
1146
|
+
const inlineStatement = data?.statements?.[source.statementId];
|
|
1147
|
+
return inlineStatement ?? { kind: "statement", statementId: source.statementId };
|
|
1148
|
+
}
|
|
1149
|
+
if (source.kind === "ontology-view" || source.kind === "ontology-relation" || source.kind === "ontology-action" || source.kind === "artifact.body" || source.kind === "record.fields" || source.kind === "navigation" || source.kind === "workflow" || source.kind === "command") {
|
|
1150
|
+
return source;
|
|
1151
|
+
}
|
|
1152
|
+
return void 0;
|
|
1153
|
+
}
|
|
1154
|
+
function compileBentoNodeToRenderTree(root, options) {
|
|
1094
1155
|
const product = options.product ?? "studio";
|
|
1095
|
-
const ownerRepo = options.ownerRepo ?? "monkeys-
|
|
1096
|
-
const
|
|
1097
|
-
const pageRef = { kind: "page", id: rootPrefix, ownerRepo };
|
|
1098
|
-
const defaultSurface = { frameOwner: "host", density: "default" };
|
|
1099
|
-
const defaultScroll = { owner: "surface", axis: "y", virtualizationBoundary: false };
|
|
1100
|
-
const defaultLifecycle = {
|
|
1101
|
-
mountPolicy: "when-active",
|
|
1102
|
-
queryPolicy: "when-active",
|
|
1103
|
-
retainOnDeactivate: true,
|
|
1104
|
-
deepLink: true,
|
|
1105
|
-
focusReturn: false
|
|
1106
|
-
};
|
|
1156
|
+
const ownerRepo = options.ownerRepo ?? "monkeys-sdk";
|
|
1157
|
+
const pageId = options.pageId ?? options.treeId;
|
|
1107
1158
|
const nodes = [];
|
|
1108
|
-
const
|
|
1109
|
-
const
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
contract: "RenderNode",
|
|
1114
|
-
nodeId,
|
|
1115
|
-
kind: dsKind === "artifact.body" ? "professional-provider" : dsKind === "record.fields" ? "record" : "view",
|
|
1116
|
-
version: 1,
|
|
1117
|
-
ownerRepo,
|
|
1118
|
-
...parentNodeId ? { parentNodeId } : {},
|
|
1119
|
-
children: [],
|
|
1120
|
-
slot: node.id,
|
|
1121
|
-
pageRef,
|
|
1122
|
-
capabilityRef: {
|
|
1123
|
-
kind: "capability",
|
|
1124
|
-
id: `monkeys.block.${node.block.customType ?? node.block.type}`,
|
|
1125
|
-
version: 1,
|
|
1126
|
-
ownerRepo
|
|
1127
|
-
},
|
|
1128
|
-
surface: defaultSurface,
|
|
1129
|
-
scroll: dsKind === "artifact.body" ? { owner: "provider", axis: "none", virtualizationBoundary: false } : defaultScroll,
|
|
1130
|
-
activation: { activationId: `${nodeId}.activate`, mode: "inline" },
|
|
1131
|
-
lifecycle: defaultLifecycle,
|
|
1132
|
-
layout: { mode: "flex", direction: "column" },
|
|
1133
|
-
responsive: [],
|
|
1134
|
-
state: "idle",
|
|
1135
|
-
renderModel: {
|
|
1136
|
-
bentoId: node.id,
|
|
1137
|
-
chrome: node.chrome ?? "panel",
|
|
1138
|
-
...node.placement ? { placement: node.placement } : {},
|
|
1139
|
-
block: node.block
|
|
1140
|
-
}
|
|
1141
|
-
});
|
|
1142
|
-
return nodeId;
|
|
1143
|
-
}
|
|
1144
|
-
const childIds = node.children.map((child) => lowerNode(child, nodeId));
|
|
1145
|
-
const isHorizontal = node.layout === "split" && (node.direction ?? "horizontal") === "horizontal";
|
|
1146
|
-
nodes.unshift({
|
|
1159
|
+
const visit = (node, parentNodeId, inheritedData) => {
|
|
1160
|
+
const effectiveData = node.kind === "container" && node.data ? node.data : inheritedData;
|
|
1161
|
+
const chrome = node.chrome ?? (node.kind === "leaf" ? "panel" : "none");
|
|
1162
|
+
const style = buildPlacementStyle(node);
|
|
1163
|
+
const common = {
|
|
1147
1164
|
contract: "RenderNode",
|
|
1148
|
-
nodeId,
|
|
1149
|
-
kind: "view",
|
|
1165
|
+
nodeId: node.id,
|
|
1150
1166
|
version: 1,
|
|
1151
1167
|
ownerRepo,
|
|
1152
1168
|
...parentNodeId ? { parentNodeId } : {},
|
|
1153
|
-
|
|
1154
|
-
pageRef,
|
|
1169
|
+
pageRef: { kind: "page", id: pageId },
|
|
1155
1170
|
capabilityRef: {
|
|
1156
1171
|
kind: "capability",
|
|
1157
|
-
id: `monkeys.bento.${node.layout}`,
|
|
1172
|
+
id: node.kind === "leaf" ? `monkeys.bento.block.${node.block.customType ?? node.block.type}` : `monkeys.bento.container.${node.layout}`,
|
|
1158
1173
|
version: 1,
|
|
1159
1174
|
ownerRepo
|
|
1160
1175
|
},
|
|
1161
|
-
surface:
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1176
|
+
surface: {
|
|
1177
|
+
frameOwner: chrome === "none" ? "none" : "host",
|
|
1178
|
+
density: "default",
|
|
1179
|
+
...chrome !== "none" ? { bento: { chrome } } : {}
|
|
1180
|
+
},
|
|
1181
|
+
scroll: {
|
|
1182
|
+
owner: "surface",
|
|
1183
|
+
axis: "none",
|
|
1184
|
+
virtualizationBoundary: false
|
|
1185
|
+
},
|
|
1186
|
+
activation: {
|
|
1187
|
+
activationId: node.id,
|
|
1188
|
+
mode: "inline"
|
|
1189
|
+
},
|
|
1190
|
+
lifecycle: {
|
|
1191
|
+
mountPolicy: "always",
|
|
1192
|
+
queryPolicy: "always",
|
|
1193
|
+
retainOnDeactivate: true,
|
|
1194
|
+
deepLink: false,
|
|
1195
|
+
focusReturn: false
|
|
1196
|
+
},
|
|
1197
|
+
...node.placement ? { placement: node.placement } : {},
|
|
1198
|
+
...node.dynamicLayout ? { dynamicLayout: node.dynamicLayout } : {},
|
|
1199
|
+
...style ? { style } : {},
|
|
1166
1200
|
responsive: [],
|
|
1167
|
-
state: "idle"
|
|
1201
|
+
state: "idle"
|
|
1202
|
+
};
|
|
1203
|
+
if (node.kind === "container") {
|
|
1204
|
+
nodes.push({
|
|
1205
|
+
...common,
|
|
1206
|
+
kind: parentNodeId ? "view" : "page",
|
|
1207
|
+
children: node.children.map((child) => child.id),
|
|
1208
|
+
layout: mapContainerLayout(node),
|
|
1209
|
+
...node.wiring ? { wiring: node.wiring } : {},
|
|
1210
|
+
renderModel: {
|
|
1211
|
+
bentoKind: "container",
|
|
1212
|
+
layout: node.layout,
|
|
1213
|
+
...node.direction ? { direction: node.direction } : {},
|
|
1214
|
+
...node.floating ? { floating: node.floating } : {},
|
|
1215
|
+
...node.title ? { title: node.title } : {},
|
|
1216
|
+
...node.description ? { description: node.description } : {},
|
|
1217
|
+
...node.wiring ? { wiring: node.wiring } : {}
|
|
1218
|
+
}
|
|
1219
|
+
});
|
|
1220
|
+
for (const child of node.children) {
|
|
1221
|
+
visit(child, node.id, effectiveData);
|
|
1222
|
+
}
|
|
1223
|
+
return;
|
|
1224
|
+
}
|
|
1225
|
+
const dataBinding = mapLeafDataBinding(node, effectiveData);
|
|
1226
|
+
const moduleId = node.block.customType ?? node.block.type;
|
|
1227
|
+
nodes.push({
|
|
1228
|
+
...common,
|
|
1229
|
+
kind: "view",
|
|
1230
|
+
children: [],
|
|
1231
|
+
layout: { mode: "block" },
|
|
1232
|
+
...dataBinding ? { dataBinding } : {},
|
|
1233
|
+
module: {
|
|
1234
|
+
id: moduleId,
|
|
1235
|
+
granularity: "atomic",
|
|
1236
|
+
...node.block.title ? { title: node.block.title } : {},
|
|
1237
|
+
...node.block.config ? { props: node.block.config } : {}
|
|
1238
|
+
},
|
|
1168
1239
|
renderModel: {
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
...node.
|
|
1172
|
-
...node.
|
|
1173
|
-
...node.
|
|
1174
|
-
...node.
|
|
1175
|
-
...node.
|
|
1176
|
-
...node.wiring ? { wiring: node.wiring } : {}
|
|
1240
|
+
bentoKind: "leaf",
|
|
1241
|
+
blockType: node.block.type,
|
|
1242
|
+
...node.block.customType ? { customType: node.block.customType } : {},
|
|
1243
|
+
...node.block.title ? { title: node.block.title } : {},
|
|
1244
|
+
...node.block.dataSource ? { dataSource: node.block.dataSource } : {},
|
|
1245
|
+
...node.block.actionStatementIds ? { actionStatementIds: node.block.actionStatementIds } : {},
|
|
1246
|
+
...node.block.config ? { config: node.block.config } : {}
|
|
1177
1247
|
}
|
|
1178
1248
|
});
|
|
1179
|
-
return nodeId;
|
|
1180
1249
|
};
|
|
1181
|
-
|
|
1250
|
+
visit(root, void 0, options.data);
|
|
1182
1251
|
return RenderTreeSchema.parse({
|
|
1183
1252
|
contract: "RenderTree",
|
|
1184
|
-
treeId:
|
|
1253
|
+
treeId: options.treeId,
|
|
1185
1254
|
product,
|
|
1186
|
-
rootNodeId,
|
|
1255
|
+
rootNodeId: root.id,
|
|
1256
|
+
...options.data ? { data: options.data } : {},
|
|
1187
1257
|
nodes
|
|
1188
1258
|
});
|
|
1189
1259
|
}
|
|
1260
|
+
function compileViewRecordToRenderTree(record2, options) {
|
|
1261
|
+
return compileBentoNodeToRenderTree(record2.root, {
|
|
1262
|
+
treeId: record2.viewId,
|
|
1263
|
+
pageId: record2.viewId,
|
|
1264
|
+
product: options?.product ?? "studio",
|
|
1265
|
+
ownerRepo: options?.ownerRepo ?? "monkeys-sdk",
|
|
1266
|
+
data: record2.data
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
// src/runtime/artifact-session.ts
|
|
1271
|
+
function buildArtifactCollabRoomId(key) {
|
|
1272
|
+
const tenant = key.tenantId ? `${key.tenantId}:` : "";
|
|
1273
|
+
return `artifact:${tenant}${key.teamId}:${key.ontologyId}:${key.artifactKind}:${key.recordId}`;
|
|
1274
|
+
}
|
|
1190
1275
|
function createArtifactRegistry(initialProfiles = []) {
|
|
1191
1276
|
const profiles = /* @__PURE__ */ new Map();
|
|
1192
1277
|
const registerProfile = (profileInput, options = {}) => {
|
|
@@ -1217,7 +1302,12 @@ function createArtifactRegistry(initialProfiles = []) {
|
|
|
1217
1302
|
resolveView,
|
|
1218
1303
|
compileView: (artifactKind, viewId, options) => {
|
|
1219
1304
|
const view = resolveView(artifactKind, viewId);
|
|
1220
|
-
return view ?
|
|
1305
|
+
return view ? compileBentoNodeToRenderTree(view.root, {
|
|
1306
|
+
treeId: view.viewId,
|
|
1307
|
+
pageId: view.viewId,
|
|
1308
|
+
product: options?.product ?? "studio",
|
|
1309
|
+
ownerRepo: options?.ownerRepo ?? "monkeys-studio"
|
|
1310
|
+
}) : void 0;
|
|
1221
1311
|
}
|
|
1222
1312
|
});
|
|
1223
1313
|
}
|
|
@@ -8299,198 +8389,15 @@ function attenuateViewCapabilities(parentCapabilities, requestedCapabilities) {
|
|
|
8299
8389
|
);
|
|
8300
8390
|
}
|
|
8301
8391
|
|
|
8302
|
-
// src/runtime/bento-render-tree.ts
|
|
8303
|
-
function mapContainerLayout(node) {
|
|
8304
|
-
const gap = typeof node.gap === "number" ? node.gap : void 0;
|
|
8305
|
-
if (node.layout === "grid") {
|
|
8306
|
-
return {
|
|
8307
|
-
mode: "grid",
|
|
8308
|
-
columns: node.columns ?? BENTO_GRID_COLUMNS,
|
|
8309
|
-
...typeof node.rowHeight === "number" ? { rowHeight: node.rowHeight } : {},
|
|
8310
|
-
...gap !== void 0 ? { gap } : {}
|
|
8311
|
-
};
|
|
8312
|
-
}
|
|
8313
|
-
if (node.layout === "split") {
|
|
8314
|
-
return {
|
|
8315
|
-
mode: "split",
|
|
8316
|
-
direction: node.direction === "vertical" ? "column" : "row",
|
|
8317
|
-
...gap !== void 0 ? { gap } : {}
|
|
8318
|
-
};
|
|
8319
|
-
}
|
|
8320
|
-
if (node.layout === "tabs") {
|
|
8321
|
-
return {
|
|
8322
|
-
mode: "tabs",
|
|
8323
|
-
...gap !== void 0 ? { gap } : {}
|
|
8324
|
-
};
|
|
8325
|
-
}
|
|
8326
|
-
if (node.layout === "floating") {
|
|
8327
|
-
return {
|
|
8328
|
-
mode: "floating",
|
|
8329
|
-
...node.floating ? { floating: node.floating } : {},
|
|
8330
|
-
...gap !== void 0 ? { gap } : {}
|
|
8331
|
-
};
|
|
8332
|
-
}
|
|
8333
|
-
return {
|
|
8334
|
-
mode: "flex",
|
|
8335
|
-
direction: node.direction === "horizontal" ? "row" : "column",
|
|
8336
|
-
...gap !== void 0 ? { gap } : {}
|
|
8337
|
-
};
|
|
8338
|
-
}
|
|
8339
|
-
function buildPlacementStyle(node) {
|
|
8340
|
-
const style = {};
|
|
8341
|
-
const grid = node.placement?.grid;
|
|
8342
|
-
if (grid) {
|
|
8343
|
-
style.gridColumn = `${grid.x + 1} / span ${grid.w}`;
|
|
8344
|
-
style.gridRow = `${grid.y + 1} / span ${grid.h}`;
|
|
8345
|
-
}
|
|
8346
|
-
const split = node.placement?.split;
|
|
8347
|
-
if (split?.size !== void 0) {
|
|
8348
|
-
style.flex = typeof split.size === "number" ? `0 0 ${split.size}%` : `0 0 ${split.size}`;
|
|
8349
|
-
}
|
|
8350
|
-
if (split?.minSize !== void 0) {
|
|
8351
|
-
style.minWidth = typeof split.minSize === "number" ? `${split.minSize}px` : split.minSize;
|
|
8352
|
-
}
|
|
8353
|
-
if (split?.maxSize !== void 0) {
|
|
8354
|
-
style.maxWidth = typeof split.maxSize === "number" ? `${split.maxSize}px` : split.maxSize;
|
|
8355
|
-
}
|
|
8356
|
-
return Object.keys(style).length > 0 ? style : void 0;
|
|
8357
|
-
}
|
|
8358
|
-
function mapLeafDataBinding(node, data) {
|
|
8359
|
-
const source = node.block.dataSource;
|
|
8360
|
-
if (!source || source.kind === "static") return void 0;
|
|
8361
|
-
if (source.kind === "statement") {
|
|
8362
|
-
const inlineStatement = data?.statements?.[source.statementId];
|
|
8363
|
-
return inlineStatement ?? { kind: "statement", statementId: source.statementId };
|
|
8364
|
-
}
|
|
8365
|
-
if (source.kind === "ontology-relation" || source.kind === "ontology-action" || source.kind === "artifact.body" || source.kind === "record.fields" || source.kind === "navigation" || source.kind === "workflow" || source.kind === "command") {
|
|
8366
|
-
return source;
|
|
8367
|
-
}
|
|
8368
|
-
return void 0;
|
|
8369
|
-
}
|
|
8370
|
-
function compileBentoNodeToRenderTree(root, options) {
|
|
8371
|
-
const product = options.product ?? "studio";
|
|
8372
|
-
const ownerRepo = options.ownerRepo ?? "monkeys-sdk";
|
|
8373
|
-
const pageId = options.pageId ?? options.treeId;
|
|
8374
|
-
const nodes = [];
|
|
8375
|
-
const visit = (node, parentNodeId, inheritedData) => {
|
|
8376
|
-
const effectiveData = node.kind === "container" && node.data ? node.data : inheritedData;
|
|
8377
|
-
const chrome = node.chrome ?? (node.kind === "leaf" ? "panel" : "none");
|
|
8378
|
-
const style = buildPlacementStyle(node);
|
|
8379
|
-
const common = {
|
|
8380
|
-
contract: "RenderNode",
|
|
8381
|
-
nodeId: node.id,
|
|
8382
|
-
version: 1,
|
|
8383
|
-
ownerRepo,
|
|
8384
|
-
...parentNodeId ? { parentNodeId } : {},
|
|
8385
|
-
pageRef: { kind: "page", id: pageId },
|
|
8386
|
-
capabilityRef: {
|
|
8387
|
-
kind: "capability",
|
|
8388
|
-
id: node.kind === "leaf" ? `monkeys.bento.block.${node.block.customType ?? node.block.type}` : `monkeys.bento.container.${node.layout}`,
|
|
8389
|
-
version: 1,
|
|
8390
|
-
ownerRepo
|
|
8391
|
-
},
|
|
8392
|
-
surface: {
|
|
8393
|
-
frameOwner: chrome === "none" ? "none" : "host",
|
|
8394
|
-
density: "default",
|
|
8395
|
-
...chrome !== "none" ? { bento: { chrome } } : {}
|
|
8396
|
-
},
|
|
8397
|
-
scroll: {
|
|
8398
|
-
owner: "surface",
|
|
8399
|
-
axis: "none",
|
|
8400
|
-
virtualizationBoundary: false
|
|
8401
|
-
},
|
|
8402
|
-
activation: {
|
|
8403
|
-
activationId: node.id,
|
|
8404
|
-
mode: "inline"
|
|
8405
|
-
},
|
|
8406
|
-
lifecycle: {
|
|
8407
|
-
mountPolicy: "always",
|
|
8408
|
-
queryPolicy: "always",
|
|
8409
|
-
retainOnDeactivate: true,
|
|
8410
|
-
deepLink: false,
|
|
8411
|
-
focusReturn: false
|
|
8412
|
-
},
|
|
8413
|
-
...node.placement ? { placement: node.placement } : {},
|
|
8414
|
-
...node.dynamicLayout ? { dynamicLayout: node.dynamicLayout } : {},
|
|
8415
|
-
...style ? { style } : {},
|
|
8416
|
-
responsive: [],
|
|
8417
|
-
state: "idle"
|
|
8418
|
-
};
|
|
8419
|
-
if (node.kind === "container") {
|
|
8420
|
-
nodes.push({
|
|
8421
|
-
...common,
|
|
8422
|
-
kind: parentNodeId ? "view" : "page",
|
|
8423
|
-
children: node.children.map((child) => child.id),
|
|
8424
|
-
layout: mapContainerLayout(node),
|
|
8425
|
-
...node.wiring ? { wiring: node.wiring } : {},
|
|
8426
|
-
renderModel: {
|
|
8427
|
-
bentoKind: "container",
|
|
8428
|
-
layout: node.layout,
|
|
8429
|
-
...node.direction ? { direction: node.direction } : {},
|
|
8430
|
-
...node.floating ? { floating: node.floating } : {},
|
|
8431
|
-
...node.title ? { title: node.title } : {},
|
|
8432
|
-
...node.description ? { description: node.description } : {},
|
|
8433
|
-
...node.wiring ? { wiring: node.wiring } : {}
|
|
8434
|
-
}
|
|
8435
|
-
});
|
|
8436
|
-
for (const child of node.children) {
|
|
8437
|
-
visit(child, node.id, effectiveData);
|
|
8438
|
-
}
|
|
8439
|
-
return;
|
|
8440
|
-
}
|
|
8441
|
-
const dataBinding = mapLeafDataBinding(node, effectiveData);
|
|
8442
|
-
const moduleId = node.block.customType ?? node.block.type;
|
|
8443
|
-
nodes.push({
|
|
8444
|
-
...common,
|
|
8445
|
-
kind: "view",
|
|
8446
|
-
children: [],
|
|
8447
|
-
layout: { mode: "block" },
|
|
8448
|
-
...dataBinding ? { dataBinding } : {},
|
|
8449
|
-
module: {
|
|
8450
|
-
id: moduleId,
|
|
8451
|
-
granularity: "atomic",
|
|
8452
|
-
...node.block.title ? { title: node.block.title } : {},
|
|
8453
|
-
...node.block.config ? { props: node.block.config } : {}
|
|
8454
|
-
},
|
|
8455
|
-
renderModel: {
|
|
8456
|
-
bentoKind: "leaf",
|
|
8457
|
-
blockType: node.block.type,
|
|
8458
|
-
...node.block.customType ? { customType: node.block.customType } : {},
|
|
8459
|
-
...node.block.title ? { title: node.block.title } : {},
|
|
8460
|
-
...node.block.dataSource ? { dataSource: node.block.dataSource } : {},
|
|
8461
|
-
...node.block.actionStatementIds ? { actionStatementIds: node.block.actionStatementIds } : {},
|
|
8462
|
-
...node.block.config ? { config: node.block.config } : {}
|
|
8463
|
-
}
|
|
8464
|
-
});
|
|
8465
|
-
};
|
|
8466
|
-
visit(root, void 0, options.data);
|
|
8467
|
-
return RenderTreeSchema.parse({
|
|
8468
|
-
contract: "RenderTree",
|
|
8469
|
-
treeId: options.treeId,
|
|
8470
|
-
product,
|
|
8471
|
-
rootNodeId: root.id,
|
|
8472
|
-
...options.data ? { data: options.data } : {},
|
|
8473
|
-
nodes
|
|
8474
|
-
});
|
|
8475
|
-
}
|
|
8476
|
-
function compileViewRecordToRenderTree(record2, options) {
|
|
8477
|
-
return compileBentoNodeToRenderTree(record2.root, {
|
|
8478
|
-
treeId: record2.viewId,
|
|
8479
|
-
pageId: record2.viewId,
|
|
8480
|
-
product: options?.product ?? "studio",
|
|
8481
|
-
ownerRepo: options?.ownerRepo ?? "monkeys-sdk",
|
|
8482
|
-
data: record2.data
|
|
8483
|
-
});
|
|
8484
|
-
}
|
|
8485
|
-
|
|
8486
8392
|
export {
|
|
8487
8393
|
extractOpenApiCapabilityManifests,
|
|
8488
8394
|
createCapabilityRegistrySource,
|
|
8489
8395
|
createOpenApiCapabilityRegistrySource,
|
|
8490
8396
|
createWorkflowCapabilityManifest,
|
|
8491
8397
|
compileCapabilityRegistry,
|
|
8398
|
+
compileBentoNodeToRenderTree,
|
|
8399
|
+
compileViewRecordToRenderTree,
|
|
8492
8400
|
buildArtifactCollabRoomId,
|
|
8493
|
-
compileBentoTreeToRenderTree,
|
|
8494
8401
|
createArtifactRegistry,
|
|
8495
8402
|
createAgentSessionEventProjection,
|
|
8496
8403
|
projectAgentSessionEvents,
|
|
@@ -8635,8 +8542,6 @@ export {
|
|
|
8635
8542
|
createSingleBlockViewRecord,
|
|
8636
8543
|
createSelectionShareViewRecord,
|
|
8637
8544
|
createWorkflowViewRecord,
|
|
8638
|
-
attenuateViewCapabilities
|
|
8639
|
-
compileBentoNodeToRenderTree,
|
|
8640
|
-
compileViewRecordToRenderTree
|
|
8545
|
+
attenuateViewCapabilities
|
|
8641
8546
|
};
|
|
8642
|
-
//# sourceMappingURL=chunk-
|
|
8547
|
+
//# sourceMappingURL=chunk-WIGX4I2M.mjs.map
|