@elaraai/e3-ui-components 1.0.35 → 1.0.37

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/dist/index.js CHANGED
@@ -21,7 +21,7 @@ var _focused, _cleanup, _setup, _a, _provider, _providerCalled, _b, _online, _cl
21
21
  import { variant, SortedMap, compareFor, EastError, fromEastTypeValue, East, none as none$1, some, OptionType, BooleanType, NullType, ConflictError, equalFor, toEastTypeValue, PatchType, diffFor, applyFor, encodeBeast2For, decodeBeast2For, BlobType, StructType, StringType, walkPatch, pathToString, pathDisplay, printFor, isVariant, prunePatchFor, detectConflictsFor, mergeWithResolutionsFor, validatePatchFor, ArrayType } from "@elaraai/east";
22
22
  import { EastTypeType } from "@elaraai/east/internal";
23
23
  import { DataBindModeType, DataBindPrimitives, bindPlatformFn, FuncBindPrimitives, FuncErrorType, FuncStatusType, funcBindPlatformFn, RecordBindPrimitives, recordBindPlatformFn, Diff, Ontology, FuncBindHandleType, Experiment, decisionBindPlatformFn, DecisionBindPrimitives, DecisionConstraintType, DiffBindingType, CommitStateType, VerdictType, AnswerType, judgementInputType, DecisionType, DecisionQueue, DecisionJournal, decodeManifest } from "@elaraai/e3-ui/internal";
24
- import { registerReactiveTracker, registerPlatformImplementation, getSomeorUndefined as getSomeorUndefined$1, StateRuntime, buildSliceHandle, DEFAULT_SLICE_STATE, getRegisteredPlatformImplementations } from "@elaraai/east-ui-components/platform";
24
+ import { registerReactiveTracker, registerPlatformImplementation, StateRuntime, getRegisteredPlatformImplementations, boundSliceConfig } from "@elaraai/east-ui-components/platform";
25
25
  import { TreePathType, DatasetStatusType } from "@elaraai/e3-types";
26
26
  import { workspaceStatus, datasetListAt, datasetList, dataflowExecuteLaunch, datasetSet, datasetGet, ApiError, workspaceFunctionCall, workspaceFunctionList, workspaceRecordHistory, workspaceRecordMutate, workspaceRecordDescribe, repoCreate, repoGc, repoGcStart, repoGcStatus, repoList, repoRemove, repoStatus, packageExport, packageGet, packageImport, packageList, packageRemove, workspaceCreate, workspaceDeploy, workspaceExport, workspaceGet, workspaceList, workspaceRemove, datasetGetStatus, datasetListRecursive, datasetListRecursivePaths, datasetListWithStatus, taskExecutionList, taskGet, taskList, dataflowCancel, dataflowExecute, dataflowExecutePoll, dataflowGraph, taskLogs } from "@elaraai/e3-api-client";
27
27
  import { jsx as jsx$1, Fragment, jsxs } from "react/jsx-runtime";
@@ -62090,21 +62090,6 @@ function viewFor(binding) {
62090
62090
  const patch = binding.patch.type === "some" ? binding.patch.value : void 0;
62091
62091
  return defaultBindRuntime.buildBindHandle(types.sourceType, source, patch, binding.mode.type);
62092
62092
  }
62093
- const DECISION_SLICE_CONFIG = {
62094
- fields: /* @__PURE__ */ new Map([
62095
- ["kind", variant("string", { label: "Kind", accessor: (d2) => d2.kind })],
62096
- ["title", variant("string", { label: "Title", accessor: (d2) => d2.title })],
62097
- ["value", variant("float", { label: "Value", accessor: (d2) => d2.value })]
62098
- ]),
62099
- rangeFieldId: none$1,
62100
- searchFieldIds: ["kind", "title"],
62101
- breakdownFieldIds: []
62102
- };
62103
- function deriveSliceKey(decisions, sliceInit) {
62104
- const sources = decisions.map((d2) => datasetPathToString(d2.source));
62105
- const seed = sliceInit === void 0 ? "none" : hashString2(stableStringify(sliceInit));
62106
- return ["decision.slice", ...sources, seed].join("|");
62107
- }
62108
62093
  function stableStringify(v3) {
62109
62094
  return JSON.stringify(v3, (_k, x2) => {
62110
62095
  if (typeof x2 === "bigint") return `${x2}n`;
@@ -62229,16 +62214,9 @@ function compileDecisionMethods(constraintType, decisions, judgements, selection
62229
62214
  }), platform)
62230
62215
  };
62231
62216
  }
62232
- function buildDecisionHandle(decisions, judgements, sliceInit, constraintType) {
62217
+ function buildDecisionHandle(decisions, judgements, constraintType) {
62233
62218
  const cType = constraintType ?? toEastTypeValue(DecisionConstraintType);
62234
62219
  const selectionKey = deriveSelectionKey(decisions);
62235
- const slice3 = buildSliceHandle(
62236
- deriveSliceKey(decisions, sliceInit),
62237
- DECISION_SLICE_CONFIG,
62238
- sliceInit ?? DEFAULT_SLICE_STATE,
62239
- () => hostQueue(decisions),
62240
- none$1
62241
- );
62242
62220
  const journal = () => {
62243
62221
  const entries = [...readJudgementsAt(judgements).values()].filter((j2) => j2.verdict.type === "some");
62244
62222
  const at = (j2) => j2.resolvedAt.type === "some" ? j2.resolvedAt.value.getTime() : 0;
@@ -62253,8 +62231,6 @@ function buildDecisionHandle(decisions, judgements, sliceInit, constraintType) {
62253
62231
  return {
62254
62232
  decisions,
62255
62233
  judgements,
62256
- sliceInit: sliceInit !== void 0 ? some(sliceInit) : none$1,
62257
- slice: slice3,
62258
62234
  journal,
62259
62235
  ...methods
62260
62236
  };
@@ -62262,10 +62238,9 @@ function buildDecisionHandle(decisions, judgements, sliceInit, constraintType) {
62262
62238
  const DecisionBindPlatform = [
62263
62239
  // Generic over the constraint contract — the resolver receives the contract
62264
62240
  // type value and threads it into the IR-bearing judgement / inject methods.
62265
- decisionBindPlatformFn.implement((constraintType) => (decisionsArg, judgementsArg, sliceInitArg) => buildDecisionHandle(
62241
+ decisionBindPlatformFn.implement((constraintType) => (decisionsArg, judgementsArg) => buildDecisionHandle(
62266
62242
  decisionsArg,
62267
62243
  judgementsArg,
62268
- getSomeorUndefined$1(sliceInitArg),
62269
62244
  constraintType
62270
62245
  )),
62271
62246
  // ── issue #106 primitives — host I/O backing the IR-bearing handle methods.
@@ -62359,11 +62334,7 @@ function useHandleVersion(handle) {
62359
62334
  function useDecisionHandle(ref) {
62360
62335
  const version2 = useHandleVersion(ref);
62361
62336
  const fns = useMemo(
62362
- () => ref ? buildDecisionHandle(
62363
- [...ref.decisions],
62364
- ref.judgements,
62365
- getSomeorUndefined$1(ref.slice)
62366
- ) : null,
62337
+ () => ref ? buildDecisionHandle([...ref.decisions], ref.judgements) : null,
62367
62338
  [ref]
62368
62339
  );
62369
62340
  const { decisions, selected: selected2, journal } = useMemo(() => {
@@ -62426,8 +62397,7 @@ function useDecisionHandle(ref) {
62426
62397
  answer,
62427
62398
  addKnowledge,
62428
62399
  inject,
62429
- resolve: resolve2,
62430
- slice: fns ? fns.slice : null
62400
+ resolve: resolve2
62431
62401
  };
62432
62402
  }
62433
62403
  const OP_WORDS = {
@@ -63182,8 +63152,8 @@ const EastChakraDecisionQueue = memo(function EastChakraDecisionQueue2({ value,
63182
63152
  const handle = useDecisionHandle(handleRef);
63183
63153
  const decisions = handle.decisions;
63184
63154
  const leverPayloads = useLeverPayloads(handleRef);
63185
- const railAffordances = getSomeorUndefined(value.slice);
63186
- const sliceHandle = handle.slice;
63155
+ const railAffordances = getSomeorUndefined(value.affordances);
63156
+ const sliceHandle = getSomeorUndefined(value.slice) ?? null;
63187
63157
  useSliceReactivity(sliceHandle == null ? void 0 : sliceHandle.key);
63188
63158
  const sliceState = sliceHandle !== null ? sliceHandle.read() : null;
63189
63159
  const rootRef = useRef(null);
@@ -63282,7 +63252,8 @@ const EastChakraDecisionQueue = memo(function EastChakraDecisionQueue2({ value,
63282
63252
  const { merged, active, routine, pastSla, visible } = useMemo(() => {
63283
63253
  const scoped = decisions ?? [];
63284
63254
  const now2 = /* @__PURE__ */ new Date();
63285
- const live = sliceState !== null ? scoped.filter((d2) => sliceMatches(sliceState, DECISION_SLICE_CONFIG, d2, now2)) : scoped;
63255
+ const sliceConfig = sliceHandle !== null ? boundSliceConfig(sliceHandle.key) : void 0;
63256
+ const live = sliceState !== null && sliceConfig !== void 0 ? scoped.filter((d2) => sliceMatches(sliceState, sliceConfig, d2, now2)) : scoped;
63286
63257
  const merged2 = [...live];
63287
63258
  for (const { decision } of exiting.values()) {
63288
63259
  if (!merged2.some((d2) => d2.id === decision.id)) merged2.push(decision);
@@ -63303,7 +63274,7 @@ const EastChakraDecisionQueue = memo(function EastChakraDecisionQueue2({ value,
63303
63274
  pastSla: merged2.filter((d2) => d2.urgency.type === "overdue").length,
63304
63275
  visible: live.length
63305
63276
  };
63306
- }, [decisions, exiting, sliceState]);
63277
+ }, [decisions, exiting, sliceState, sliceHandle]);
63307
63278
  const groups = useMemo(
63308
63279
  () => grouped ? buildGroups(merged, activeOption) : [],
63309
63280
  [grouped, merged, activeOption]