@elaraai/e3-ui-components 1.0.34 → 1.0.36

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.
@@ -1,7 +1,6 @@
1
- import { variant, ValueTypeOf } from '@elaraai/east';
1
+ import { ValueTypeOf } from '@elaraai/east';
2
2
  import { PlatformFunction } from '@elaraai/east/internal';
3
3
  import { DiffBindingType, DecisionHandleType, DecisionHandleRefType, CommitStateType, JudgementInputType, DecisionConstraintType, VerdictType, AnswerLiteral } from '@elaraai/e3-ui/internal';
4
- import { buildSliceHandle } from '@elaraai/east-ui-components/platform';
5
4
  import { Decision } from './types.js';
6
5
  type DiffBindingValue = ValueTypeOf<typeof DiffBindingType>;
7
6
  /** JS-side shape of a decoded {@link DecisionHandleType} value. */
@@ -23,17 +22,6 @@ export type ConstraintValue = ValueTypeOf<typeof DecisionConstraintType>;
23
22
  * it. Shared by the platform impl (reads/writes) and the React hook
24
23
  * (subscription). */
25
24
  export declare function deriveSelectionKey(decisions: readonly DiffBindingValue[]): string;
26
- /**
27
- * The canonical slice config over the fixed `DecisionType` — kind / title /
28
- * value filterable, kind + title searchable. Decoded form (plain JS
29
- * accessors); also what the queue's narrowing matches against.
30
- */
31
- export declare const DECISION_SLICE_CONFIG: {
32
- fields: Map<string, unknown>;
33
- rangeFieldId: variant<"none", null>;
34
- searchFieldIds: string[];
35
- breakdownFieldIds: never[];
36
- };
37
25
  /** The `decision_bind` implementation + its backing primitives. Registered on
38
26
  * module load. */
39
27
  export declare const DecisionBindPlatform: PlatformFunction[];
@@ -63,9 +51,6 @@ export interface UseDecisionHandleResult {
63
51
  /** Commit a verdict: judgement write + removal through the owning patch
64
52
  * + selection clear. */
65
53
  resolve: (caseId: string, verdict: Verdict) => void;
66
- /** The handle-owned slice over the queue (closures; key derived from the
67
- * bound source paths). `null` until the bindings are readable. */
68
- slice: ReturnType<typeof buildSliceHandle> | null;
69
54
  }
70
55
  /**
71
56
  * Resolve a {@link DecisionHandleRefType} payload value into live reads +
@@ -1 +1 @@
1
- {"version":3,"file":"handle-runtime.d.ts","sourceRoot":"","sources":["../../src/decision/handle-runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmBH,OAAO,EAUH,OAAO,EAGP,KAAK,WAAW,EAEnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAGH,eAAe,EAEf,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EAEtB,WAAW,EAEX,KAAK,aAAa,EACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAsF,gBAAgB,EAA2C,MAAM,sCAAsC,CAAC;AAarM,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,KAAK,gBAAgB,GAAG,WAAW,CAAC,OAAO,eAAe,CAAC,CAAC;AAE5D,mEAAmE;AACnE,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACzE;4DAC4D;AAC5D,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC/E,6CAA6C;AAC7C,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC/D,gDAAgD;AAChD,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,eAAe,CAAC,CAAC;AAC9D,wCAAwC;AACxC,MAAM,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,WAAW,CAAC,CAAC;AACtD;0EAC0E;AAC1E,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAQzE;;;sBAGsB;AACtB,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,gBAAgB,EAAE,GAAG,MAAM,CAEjF;AAmBD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;;;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oBxD,KAAK,kBAAkB,GAAG,WAAW,CAAC,OAAO,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAiX7E,MAAM,WAAW,4BAA4B;IACzC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,uBAAuB,oEA2S3B,CAAC;AAIH,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/decision/queue.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AA8BH,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAsBxD,KAAK,kBAAkB,GAAG,WAAW,CAAC,OAAO,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAiX7E,MAAM,WAAW,4BAA4B;IACzC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,uBAAuB,oEA+S3B,CAAC;AAIH,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
package/dist/index.cjs CHANGED
@@ -62108,21 +62108,6 @@ function viewFor(binding) {
62108
62108
  const patch = binding.patch.type === "some" ? binding.patch.value : void 0;
62109
62109
  return defaultBindRuntime.buildBindHandle(types.sourceType, source, patch, binding.mode.type);
62110
62110
  }
62111
- const DECISION_SLICE_CONFIG = {
62112
- fields: /* @__PURE__ */ new Map([
62113
- ["kind", east.variant("string", { label: "Kind", accessor: (d2) => d2.kind })],
62114
- ["title", east.variant("string", { label: "Title", accessor: (d2) => d2.title })],
62115
- ["value", east.variant("float", { label: "Value", accessor: (d2) => d2.value })]
62116
- ]),
62117
- rangeFieldId: east.none,
62118
- searchFieldIds: ["kind", "title"],
62119
- breakdownFieldIds: []
62120
- };
62121
- function deriveSliceKey(decisions, sliceInit) {
62122
- const sources = decisions.map((d2) => datasetPathToString(d2.source));
62123
- const seed = sliceInit === void 0 ? "none" : hashString2(stableStringify(sliceInit));
62124
- return ["decision.slice", ...sources, seed].join("|");
62125
- }
62126
62111
  function stableStringify(v3) {
62127
62112
  return JSON.stringify(v3, (_k, x2) => {
62128
62113
  if (typeof x2 === "bigint") return `${x2}n`;
@@ -62247,16 +62232,9 @@ function compileDecisionMethods(constraintType, decisions, judgements, selection
62247
62232
  }), platform$1)
62248
62233
  };
62249
62234
  }
62250
- function buildDecisionHandle(decisions, judgements, sliceInit, constraintType) {
62235
+ function buildDecisionHandle(decisions, judgements, constraintType) {
62251
62236
  const cType = constraintType ?? east.toEastTypeValue(internal$1.DecisionConstraintType);
62252
62237
  const selectionKey = deriveSelectionKey(decisions);
62253
- const slice3 = platform.buildSliceHandle(
62254
- deriveSliceKey(decisions, sliceInit),
62255
- DECISION_SLICE_CONFIG,
62256
- sliceInit ?? platform.DEFAULT_SLICE_STATE,
62257
- () => hostQueue(decisions),
62258
- east.none
62259
- );
62260
62238
  const journal = () => {
62261
62239
  const entries = [...readJudgementsAt(judgements).values()].filter((j2) => j2.verdict.type === "some");
62262
62240
  const at = (j2) => j2.resolvedAt.type === "some" ? j2.resolvedAt.value.getTime() : 0;
@@ -62271,8 +62249,6 @@ function buildDecisionHandle(decisions, judgements, sliceInit, constraintType) {
62271
62249
  return {
62272
62250
  decisions,
62273
62251
  judgements,
62274
- sliceInit: sliceInit !== void 0 ? east.some(sliceInit) : east.none,
62275
- slice: slice3,
62276
62252
  journal,
62277
62253
  ...methods
62278
62254
  };
@@ -62280,10 +62256,9 @@ function buildDecisionHandle(decisions, judgements, sliceInit, constraintType) {
62280
62256
  const DecisionBindPlatform = [
62281
62257
  // Generic over the constraint contract — the resolver receives the contract
62282
62258
  // type value and threads it into the IR-bearing judgement / inject methods.
62283
- internal$1.decisionBindPlatformFn.implement((constraintType) => (decisionsArg, judgementsArg, sliceInitArg) => buildDecisionHandle(
62259
+ internal$1.decisionBindPlatformFn.implement((constraintType) => (decisionsArg, judgementsArg) => buildDecisionHandle(
62284
62260
  decisionsArg,
62285
62261
  judgementsArg,
62286
- platform.getSomeorUndefined(sliceInitArg),
62287
62262
  constraintType
62288
62263
  )),
62289
62264
  // ── issue #106 primitives — host I/O backing the IR-bearing handle methods.
@@ -62377,11 +62352,7 @@ function useHandleVersion(handle) {
62377
62352
  function useDecisionHandle(ref) {
62378
62353
  const version2 = useHandleVersion(ref);
62379
62354
  const fns = React.useMemo(
62380
- () => ref ? buildDecisionHandle(
62381
- [...ref.decisions],
62382
- ref.judgements,
62383
- platform.getSomeorUndefined(ref.slice)
62384
- ) : null,
62355
+ () => ref ? buildDecisionHandle([...ref.decisions], ref.judgements) : null,
62385
62356
  [ref]
62386
62357
  );
62387
62358
  const { decisions, selected: selected2, journal } = React.useMemo(() => {
@@ -62444,8 +62415,7 @@ function useDecisionHandle(ref) {
62444
62415
  answer,
62445
62416
  addKnowledge,
62446
62417
  inject,
62447
- resolve: resolve2,
62448
- slice: fns ? fns.slice : null
62418
+ resolve: resolve2
62449
62419
  };
62450
62420
  }
62451
62421
  const OP_WORDS = {
@@ -63200,8 +63170,8 @@ const EastChakraDecisionQueue = React.memo(function EastChakraDecisionQueue2({ v
63200
63170
  const handle = useDecisionHandle(handleRef);
63201
63171
  const decisions = handle.decisions;
63202
63172
  const leverPayloads = useLeverPayloads(handleRef);
63203
- const railAffordances = eastUiComponents.getSomeorUndefined(value.slice);
63204
- const sliceHandle = handle.slice;
63173
+ const railAffordances = eastUiComponents.getSomeorUndefined(value.affordances);
63174
+ const sliceHandle = eastUiComponents.getSomeorUndefined(value.slice) ?? null;
63205
63175
  eastUiComponents.useSliceReactivity(sliceHandle == null ? void 0 : sliceHandle.key);
63206
63176
  const sliceState = sliceHandle !== null ? sliceHandle.read() : null;
63207
63177
  const rootRef = React.useRef(null);
@@ -63300,7 +63270,8 @@ const EastChakraDecisionQueue = React.memo(function EastChakraDecisionQueue2({ v
63300
63270
  const { merged, active, routine, pastSla, visible } = React.useMemo(() => {
63301
63271
  const scoped = decisions ?? [];
63302
63272
  const now2 = /* @__PURE__ */ new Date();
63303
- const live = sliceState !== null ? scoped.filter((d2) => internal$2.sliceMatches(sliceState, DECISION_SLICE_CONFIG, d2, now2)) : scoped;
63273
+ const sliceConfig = sliceHandle !== null ? platform.boundSliceConfig(sliceHandle.key) : void 0;
63274
+ const live = sliceState !== null && sliceConfig !== void 0 ? scoped.filter((d2) => internal$2.sliceMatches(sliceState, sliceConfig, d2, now2)) : scoped;
63304
63275
  const merged2 = [...live];
63305
63276
  for (const { decision } of exiting.values()) {
63306
63277
  if (!merged2.some((d2) => d2.id === decision.id)) merged2.push(decision);
@@ -63321,7 +63292,7 @@ const EastChakraDecisionQueue = React.memo(function EastChakraDecisionQueue2({ v
63321
63292
  pastSla: merged2.filter((d2) => d2.urgency.type === "overdue").length,
63322
63293
  visible: live.length
63323
63294
  };
63324
- }, [decisions, exiting, sliceState]);
63295
+ }, [decisions, exiting, sliceState, sliceHandle]);
63325
63296
  const groups = React.useMemo(
63326
63297
  () => grouped ? buildGroups(merged, activeOption) : [],
63327
63298
  [grouped, merged, activeOption]