@ai-matrx/content-ir-react 0.16.0 → 0.17.0
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/CHANGELOG.md +24 -0
- package/dist/{directive-host-C4TcPpxX.d.cts → directive-host-BOML4BQ7.d.cts} +27 -1
- package/dist/{directive-host-C4TcPpxX.d.ts → directive-host-BOML4BQ7.d.ts} +27 -1
- package/dist/directives.cjs +106 -11
- package/dist/directives.cjs.map +1 -1
- package/dist/directives.d.cts +29 -4
- package/dist/directives.d.ts +29 -4
- package/dist/directives.js +106 -11
- package/dist/directives.js.map +1 -1
- package/dist/{host-types-a0XEr5b3.d.cts → host-types-Dxzs0C3f.d.cts} +1 -1
- package/dist/{host-types-CEc86R-v.d.ts → host-types-uKO1zZo3.d.ts} +1 -1
- package/dist/host.cjs.map +1 -1
- package/dist/host.d.cts +3 -3
- package/dist/host.d.ts +3 -3
- package/dist/host.js.map +1 -1
- package/dist/index.cjs +106 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -4
- package/dist/index.d.ts +29 -4
- package/dist/index.js +106 -11
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +104 -11
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +104 -11
- package/dist/react.js.map +1 -1
- package/dist/{route-De9c5YgW.d.ts → route-CfKxIEdj.d.ts} +27 -1
- package/dist/{route-YcoyR3Fj.d.cts → route-DjGv9skd.d.cts} +27 -1
- package/dist/route.d.cts +1 -1
- package/dist/route.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as ComponentResolutionSource, a as ComponentResolution, b as ContentIrErrorReporter } from './component-resolution.types-DLO2w-0n.cjs';
|
|
2
2
|
export { c as ComponentRole, d as ContentIrErrorReport, J as JsonObject, K as KindComponentRow, S as SystemComponentEntry, e as consoleErrorReporter } from './component-resolution.types-DLO2w-0n.cjs';
|
|
3
|
-
import { C as ContentIrHost, K as KindRouteEnv, a as KindDefinitionSource, D as DirectiveRecordRef } from './route-
|
|
4
|
-
export {
|
|
3
|
+
import { C as ContentIrHost, K as KindRouteEnv, a as KindDefinitionSource, D as DirectiveFailure, b as DirectiveFailureWords, c as DirectiveRecordRef } from './route-DjGv9skd.cjs';
|
|
4
|
+
export { d as ContentIrRenderSeams, e as DB_KIND_COMPONENT_KEY, f as DIRECTIVE_BLOCK_TYPE, g as DirectiveApplyResult, h as DirectiveApplyState, i as DirectiveAskRequest, j as DirectiveCopyProps, k as DirectiveHost, l as DirectiveHostProvider, m as DirectiveHostProviderProps, n as DirectiveOpenItemOptions, o as DirectiveRecordProps, p as DirectiveScope, q as DirectiveScopeProvider, r as DirectiveShell, G as GENERIC_STRUCTURED_COMPONENT_KEY, s as GenericFallbackReason, I as IR_PROVISIONAL_KEY, t as IR_ROUTE_KEY, u as IrRenderBlock, v as IrRoutableBlock, w as IrRouteMarker, x as KindRouteBinding, y as KindRouteOptions, P as PartialRenderOptions, z as ProvisionalKindRender, S as StructuredValueRenderProps, A as SupersededKindRender, B as applyIrKindRoute, E as createKindRouteBinding, F as envelopeFromPartialKind, H as isPartialReadyKind, J as isProvisionalBlock, L as kindServerDataFromStoredValue, M as markKindPartialUnsafe, N as readIrRouteMarker, O as resetPartialUnsafeKinds, Q as resetSourcelessDbRowReports, R as resolveAnnouncedKindLoading, T as resolveProvisionalKindRender, U as resolveSupersededKindRender, V as routeEnvOf, W as useDirectiveHost, X as useDirectiveScope } from './route-DjGv9skd.cjs';
|
|
5
5
|
import * as react from 'react';
|
|
6
6
|
import react__default, { ReactNode, ComponentType } from 'react';
|
|
7
7
|
export { ComponentResolver, ComponentResolverOptions } from './resolver.cjs';
|
|
@@ -310,7 +310,16 @@ declare function describeChangeValue(value: unknown): ChangeValue;
|
|
|
310
310
|
* each change also carries what it REPLACES (`before`) and whether it changes
|
|
311
311
|
* anything at all (`same`). A field the record does not carry gets no `before`.
|
|
312
312
|
*/
|
|
313
|
-
|
|
313
|
+
interface ItemChangesOptions {
|
|
314
|
+
/**
|
|
315
|
+
* The noun's title column (catalog `title_column` — `nounTitleColumn`). It is
|
|
316
|
+
* labelled "Title" whatever it is called: a note's title is stored in
|
|
317
|
+
* `label`, and the confirm said "Label" while the form said "Title"
|
|
318
|
+
* (reviewer, 2026-10-02). The same rule the directive builder's form uses.
|
|
319
|
+
*/
|
|
320
|
+
titleColumn?: string | null;
|
|
321
|
+
}
|
|
322
|
+
declare function itemChanges(item: Record<string, unknown>, current?: Record<string, unknown> | null, options?: ItemChangesOptions): ItemChange[];
|
|
314
323
|
|
|
315
324
|
interface SideEffectDirectiveCardProps {
|
|
316
325
|
directive: DecodedDirective;
|
|
@@ -368,6 +377,22 @@ interface DirectiveRenderProps {
|
|
|
368
377
|
}
|
|
369
378
|
declare function DirectiveRender({ conversationId, ...props }: DirectiveRenderProps): react.JSX.Element;
|
|
370
379
|
|
|
380
|
+
/**
|
|
381
|
+
* THE WORDS A FAILED APPLY SHOWS A PERSON.
|
|
382
|
+
*
|
|
383
|
+
* A card used to print the server's text as its sentence — e.g.
|
|
384
|
+
* "unknown / non-writable noun 'task'. Writable: [...]" (G5 review,
|
|
385
|
+
* 2026-10-02). A person needs WHAT failed and WHAT TO DO, in plain words; the
|
|
386
|
+
* technical text is for whoever debugs it, behind a Details toggle. The host
|
|
387
|
+
* may name a failure it recognises (`DirectiveHost.explainFailure`); otherwise
|
|
388
|
+
* these verb-aware defaults answer.
|
|
389
|
+
*/
|
|
390
|
+
|
|
391
|
+
/** The card's own words for a failure the host did not name. */
|
|
392
|
+
declare function defaultFailureWords(failure: DirectiveFailure): DirectiveFailureWords;
|
|
393
|
+
/** The host's words when it names this failure, else the default. */
|
|
394
|
+
declare function failureWords(failure: DirectiveFailure, explain?: (failure: DirectiveFailure) => DirectiveFailureWords | null): DirectiveFailureWords;
|
|
395
|
+
|
|
371
396
|
type RecordValuesStatus = "idle" | "loading" | "ready" | "unavailable";
|
|
372
397
|
interface RecordValues {
|
|
373
398
|
/** The record's fields now, or null until (or unless) they are read. */
|
|
@@ -640,4 +665,4 @@ declare class DbKindComponentErrorBoundary extends react.Component<DbKindCompone
|
|
|
640
665
|
render(): react.ReactNode;
|
|
641
666
|
}
|
|
642
667
|
|
|
643
|
-
export { ApplyDirectiveButton, type ApplyDirectiveButtonProps, CHANGE_VALUE_MAX, type ChangeValue, type CompiledDbKindComponent, ComponentResolution, ComponentResolutionSource, ContentIrErrorReporter, ContentIrHost, ContentIrRenderProvider, type ContentIrRenderProviderProps, type DbKindActionResult, type DbKindCompileResult, type DbKindComponentCache, type DbKindComponentCachePorts, type DbKindComponentCompiler, DbKindComponentErrorBoundary, type DbKindComponentErrorBoundaryProps, type DbKindComponentIncident, type DbKindComponentIncidentSink, type DbKindComponentIncidentType, type DbKindComponentRenderProps, DelegatedOutput, type DelegatedOutputProps, DirectiveChangeList, DirectiveFallbackCard, type DirectiveFallbackCardProps, DirectiveProvisionalCard, type DirectiveProvisionalCardProps, DirectiveRecordRef, DirectiveRender, type DirectiveRenderProps, type DirectiveRenderer, type DirectiveRendererProps, GenericStructuredView, type GenericStructuredViewProps, type ItemChange, type KindComponentUiOptions, KindDefinitionSource, KindInstanceRender, type KindInstanceRenderProps, KindRouteEnv, type KindVersionSources, NodeOutcomeView, type NodeOutcomeViewProps, ProvisionalKindBoundary, ProvisionalKindFrame, type RecordReader, type RecordValues, type RecordValuesStatus, type ResolveKindValue, type RunDbKindAction, RunResultView, type RunResultViewProps, SideEffectDirectiveCard, type SideEffectDirectiveCardProps, TARGETING_CLASSES, createDbKindComponentCache, describeChangeValue, fieldLabel, getDirectiveRenderer, isDbKindComponentBodyPending, isRecordValue, itemChanges, itemRecordId, kindIsRoutable, provisionalDirectiveSlug, recordFallbackName, registerDirectiveRenderer, resetDirectiveRenderers, useContentIrHost, useContentIrHostOrNull, useContentIrKindVersion, useKindRouteEnv, useRecordValues };
|
|
668
|
+
export { ApplyDirectiveButton, type ApplyDirectiveButtonProps, CHANGE_VALUE_MAX, type ChangeValue, type CompiledDbKindComponent, ComponentResolution, ComponentResolutionSource, ContentIrErrorReporter, ContentIrHost, ContentIrRenderProvider, type ContentIrRenderProviderProps, type DbKindActionResult, type DbKindCompileResult, type DbKindComponentCache, type DbKindComponentCachePorts, type DbKindComponentCompiler, DbKindComponentErrorBoundary, type DbKindComponentErrorBoundaryProps, type DbKindComponentIncident, type DbKindComponentIncidentSink, type DbKindComponentIncidentType, type DbKindComponentRenderProps, DelegatedOutput, type DelegatedOutputProps, DirectiveChangeList, DirectiveFailure, DirectiveFailureWords, DirectiveFallbackCard, type DirectiveFallbackCardProps, DirectiveProvisionalCard, type DirectiveProvisionalCardProps, DirectiveRecordRef, DirectiveRender, type DirectiveRenderProps, type DirectiveRenderer, type DirectiveRendererProps, GenericStructuredView, type GenericStructuredViewProps, type ItemChange, type ItemChangesOptions, type KindComponentUiOptions, KindDefinitionSource, KindInstanceRender, type KindInstanceRenderProps, KindRouteEnv, type KindVersionSources, NodeOutcomeView, type NodeOutcomeViewProps, ProvisionalKindBoundary, ProvisionalKindFrame, type RecordReader, type RecordValues, type RecordValuesStatus, type ResolveKindValue, type RunDbKindAction, RunResultView, type RunResultViewProps, SideEffectDirectiveCard, type SideEffectDirectiveCardProps, TARGETING_CLASSES, createDbKindComponentCache, defaultFailureWords, describeChangeValue, failureWords, fieldLabel, getDirectiveRenderer, isDbKindComponentBodyPending, isRecordValue, itemChanges, itemRecordId, kindIsRoutable, provisionalDirectiveSlug, recordFallbackName, registerDirectiveRenderer, resetDirectiveRenderers, useContentIrHost, useContentIrHostOrNull, useContentIrKindVersion, useKindRouteEnv, useRecordValues };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as ComponentResolutionSource, a as ComponentResolution, b as ContentIrErrorReporter } from './component-resolution.types-DLO2w-0n.js';
|
|
2
2
|
export { c as ComponentRole, d as ContentIrErrorReport, J as JsonObject, K as KindComponentRow, S as SystemComponentEntry, e as consoleErrorReporter } from './component-resolution.types-DLO2w-0n.js';
|
|
3
|
-
import { C as ContentIrHost, K as KindRouteEnv, a as KindDefinitionSource, D as DirectiveRecordRef } from './route-
|
|
4
|
-
export {
|
|
3
|
+
import { C as ContentIrHost, K as KindRouteEnv, a as KindDefinitionSource, D as DirectiveFailure, b as DirectiveFailureWords, c as DirectiveRecordRef } from './route-CfKxIEdj.js';
|
|
4
|
+
export { d as ContentIrRenderSeams, e as DB_KIND_COMPONENT_KEY, f as DIRECTIVE_BLOCK_TYPE, g as DirectiveApplyResult, h as DirectiveApplyState, i as DirectiveAskRequest, j as DirectiveCopyProps, k as DirectiveHost, l as DirectiveHostProvider, m as DirectiveHostProviderProps, n as DirectiveOpenItemOptions, o as DirectiveRecordProps, p as DirectiveScope, q as DirectiveScopeProvider, r as DirectiveShell, G as GENERIC_STRUCTURED_COMPONENT_KEY, s as GenericFallbackReason, I as IR_PROVISIONAL_KEY, t as IR_ROUTE_KEY, u as IrRenderBlock, v as IrRoutableBlock, w as IrRouteMarker, x as KindRouteBinding, y as KindRouteOptions, P as PartialRenderOptions, z as ProvisionalKindRender, S as StructuredValueRenderProps, A as SupersededKindRender, B as applyIrKindRoute, E as createKindRouteBinding, F as envelopeFromPartialKind, H as isPartialReadyKind, J as isProvisionalBlock, L as kindServerDataFromStoredValue, M as markKindPartialUnsafe, N as readIrRouteMarker, O as resetPartialUnsafeKinds, Q as resetSourcelessDbRowReports, R as resolveAnnouncedKindLoading, T as resolveProvisionalKindRender, U as resolveSupersededKindRender, V as routeEnvOf, W as useDirectiveHost, X as useDirectiveScope } from './route-CfKxIEdj.js';
|
|
5
5
|
import * as react from 'react';
|
|
6
6
|
import react__default, { ReactNode, ComponentType } from 'react';
|
|
7
7
|
export { ComponentResolver, ComponentResolverOptions } from './resolver.js';
|
|
@@ -310,7 +310,16 @@ declare function describeChangeValue(value: unknown): ChangeValue;
|
|
|
310
310
|
* each change also carries what it REPLACES (`before`) and whether it changes
|
|
311
311
|
* anything at all (`same`). A field the record does not carry gets no `before`.
|
|
312
312
|
*/
|
|
313
|
-
|
|
313
|
+
interface ItemChangesOptions {
|
|
314
|
+
/**
|
|
315
|
+
* The noun's title column (catalog `title_column` — `nounTitleColumn`). It is
|
|
316
|
+
* labelled "Title" whatever it is called: a note's title is stored in
|
|
317
|
+
* `label`, and the confirm said "Label" while the form said "Title"
|
|
318
|
+
* (reviewer, 2026-10-02). The same rule the directive builder's form uses.
|
|
319
|
+
*/
|
|
320
|
+
titleColumn?: string | null;
|
|
321
|
+
}
|
|
322
|
+
declare function itemChanges(item: Record<string, unknown>, current?: Record<string, unknown> | null, options?: ItemChangesOptions): ItemChange[];
|
|
314
323
|
|
|
315
324
|
interface SideEffectDirectiveCardProps {
|
|
316
325
|
directive: DecodedDirective;
|
|
@@ -368,6 +377,22 @@ interface DirectiveRenderProps {
|
|
|
368
377
|
}
|
|
369
378
|
declare function DirectiveRender({ conversationId, ...props }: DirectiveRenderProps): react.JSX.Element;
|
|
370
379
|
|
|
380
|
+
/**
|
|
381
|
+
* THE WORDS A FAILED APPLY SHOWS A PERSON.
|
|
382
|
+
*
|
|
383
|
+
* A card used to print the server's text as its sentence — e.g.
|
|
384
|
+
* "unknown / non-writable noun 'task'. Writable: [...]" (G5 review,
|
|
385
|
+
* 2026-10-02). A person needs WHAT failed and WHAT TO DO, in plain words; the
|
|
386
|
+
* technical text is for whoever debugs it, behind a Details toggle. The host
|
|
387
|
+
* may name a failure it recognises (`DirectiveHost.explainFailure`); otherwise
|
|
388
|
+
* these verb-aware defaults answer.
|
|
389
|
+
*/
|
|
390
|
+
|
|
391
|
+
/** The card's own words for a failure the host did not name. */
|
|
392
|
+
declare function defaultFailureWords(failure: DirectiveFailure): DirectiveFailureWords;
|
|
393
|
+
/** The host's words when it names this failure, else the default. */
|
|
394
|
+
declare function failureWords(failure: DirectiveFailure, explain?: (failure: DirectiveFailure) => DirectiveFailureWords | null): DirectiveFailureWords;
|
|
395
|
+
|
|
371
396
|
type RecordValuesStatus = "idle" | "loading" | "ready" | "unavailable";
|
|
372
397
|
interface RecordValues {
|
|
373
398
|
/** The record's fields now, or null until (or unless) they are read. */
|
|
@@ -640,4 +665,4 @@ declare class DbKindComponentErrorBoundary extends react.Component<DbKindCompone
|
|
|
640
665
|
render(): react.ReactNode;
|
|
641
666
|
}
|
|
642
667
|
|
|
643
|
-
export { ApplyDirectiveButton, type ApplyDirectiveButtonProps, CHANGE_VALUE_MAX, type ChangeValue, type CompiledDbKindComponent, ComponentResolution, ComponentResolutionSource, ContentIrErrorReporter, ContentIrHost, ContentIrRenderProvider, type ContentIrRenderProviderProps, type DbKindActionResult, type DbKindCompileResult, type DbKindComponentCache, type DbKindComponentCachePorts, type DbKindComponentCompiler, DbKindComponentErrorBoundary, type DbKindComponentErrorBoundaryProps, type DbKindComponentIncident, type DbKindComponentIncidentSink, type DbKindComponentIncidentType, type DbKindComponentRenderProps, DelegatedOutput, type DelegatedOutputProps, DirectiveChangeList, DirectiveFallbackCard, type DirectiveFallbackCardProps, DirectiveProvisionalCard, type DirectiveProvisionalCardProps, DirectiveRecordRef, DirectiveRender, type DirectiveRenderProps, type DirectiveRenderer, type DirectiveRendererProps, GenericStructuredView, type GenericStructuredViewProps, type ItemChange, type KindComponentUiOptions, KindDefinitionSource, KindInstanceRender, type KindInstanceRenderProps, KindRouteEnv, type KindVersionSources, NodeOutcomeView, type NodeOutcomeViewProps, ProvisionalKindBoundary, ProvisionalKindFrame, type RecordReader, type RecordValues, type RecordValuesStatus, type ResolveKindValue, type RunDbKindAction, RunResultView, type RunResultViewProps, SideEffectDirectiveCard, type SideEffectDirectiveCardProps, TARGETING_CLASSES, createDbKindComponentCache, describeChangeValue, fieldLabel, getDirectiveRenderer, isDbKindComponentBodyPending, isRecordValue, itemChanges, itemRecordId, kindIsRoutable, provisionalDirectiveSlug, recordFallbackName, registerDirectiveRenderer, resetDirectiveRenderers, useContentIrHost, useContentIrHostOrNull, useContentIrKindVersion, useKindRouteEnv, useRecordValues };
|
|
668
|
+
export { ApplyDirectiveButton, type ApplyDirectiveButtonProps, CHANGE_VALUE_MAX, type ChangeValue, type CompiledDbKindComponent, ComponentResolution, ComponentResolutionSource, ContentIrErrorReporter, ContentIrHost, ContentIrRenderProvider, type ContentIrRenderProviderProps, type DbKindActionResult, type DbKindCompileResult, type DbKindComponentCache, type DbKindComponentCachePorts, type DbKindComponentCompiler, DbKindComponentErrorBoundary, type DbKindComponentErrorBoundaryProps, type DbKindComponentIncident, type DbKindComponentIncidentSink, type DbKindComponentIncidentType, type DbKindComponentRenderProps, DelegatedOutput, type DelegatedOutputProps, DirectiveChangeList, DirectiveFailure, DirectiveFailureWords, DirectiveFallbackCard, type DirectiveFallbackCardProps, DirectiveProvisionalCard, type DirectiveProvisionalCardProps, DirectiveRecordRef, DirectiveRender, type DirectiveRenderProps, type DirectiveRenderer, type DirectiveRendererProps, GenericStructuredView, type GenericStructuredViewProps, type ItemChange, type ItemChangesOptions, type KindComponentUiOptions, KindDefinitionSource, KindInstanceRender, type KindInstanceRenderProps, KindRouteEnv, type KindVersionSources, NodeOutcomeView, type NodeOutcomeViewProps, ProvisionalKindBoundary, ProvisionalKindFrame, type RecordReader, type RecordValues, type RecordValuesStatus, type ResolveKindValue, type RunDbKindAction, RunResultView, type RunResultViewProps, SideEffectDirectiveCard, type SideEffectDirectiveCardProps, TARGETING_CLASSES, createDbKindComponentCache, defaultFailureWords, describeChangeValue, failureWords, fieldLabel, getDirectiveRenderer, isDbKindComponentBodyPending, isRecordValue, itemChanges, itemRecordId, kindIsRoutable, provisionalDirectiveSlug, recordFallbackName, registerDirectiveRenderer, resetDirectiveRenderers, useContentIrHost, useContentIrHostOrNull, useContentIrKindVersion, useKindRouteEnv, useRecordValues };
|
package/dist/index.js
CHANGED
|
@@ -816,11 +816,13 @@ function sameValue(a, b) {
|
|
|
816
816
|
if (typeof a === "object" || typeof b === "object") return safeJson(a) === safeJson(b);
|
|
817
817
|
return false;
|
|
818
818
|
}
|
|
819
|
-
function itemChanges(item, current) {
|
|
819
|
+
function itemChanges(item, current, options = {}) {
|
|
820
820
|
const out = [];
|
|
821
|
+
const titleColumn = options.titleColumn ?? null;
|
|
821
822
|
for (const [key, raw] of Object.entries(item)) {
|
|
822
823
|
if (NOT_A_CHANGE.has(key)) continue;
|
|
823
|
-
const
|
|
824
|
+
const label = key === titleColumn ? "Title" : fieldLabel(key);
|
|
825
|
+
const change = { key, label, ...describeValue(raw) };
|
|
824
826
|
if (current && Object.prototype.hasOwnProperty.call(current, key)) {
|
|
825
827
|
change.before = describeValue(current[key]);
|
|
826
828
|
change.same = sameValue(current[key], raw);
|
|
@@ -830,6 +832,30 @@ function itemChanges(item, current) {
|
|
|
830
832
|
return out;
|
|
831
833
|
}
|
|
832
834
|
|
|
835
|
+
// directives/failure-words.ts
|
|
836
|
+
var PAST = {
|
|
837
|
+
create: "created",
|
|
838
|
+
update: "updated",
|
|
839
|
+
delete: "deleted"
|
|
840
|
+
};
|
|
841
|
+
function defaultFailureWords(failure) {
|
|
842
|
+
const verbed = PAST[failure.directiveClass] ?? "applied";
|
|
843
|
+
const noun = failure.nounLabel.trim().toLowerCase() || "item";
|
|
844
|
+
if (failure.failed && failure.total && failure.total > 1) {
|
|
845
|
+
return {
|
|
846
|
+
what: `${failure.failed} of ${failure.total} weren't ${verbed}.`,
|
|
847
|
+
next: "Retry to try those again."
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
return {
|
|
851
|
+
what: `The ${noun} wasn't ${verbed}.`,
|
|
852
|
+
next: "Try again in a moment."
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
function failureWords(failure, explain) {
|
|
856
|
+
return explain?.(failure) ?? defaultFailureWords(failure);
|
|
857
|
+
}
|
|
858
|
+
|
|
833
859
|
// directives/icons.tsx
|
|
834
860
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
835
861
|
function Svg({ children, ...props }) {
|
|
@@ -1087,10 +1113,23 @@ function ApplyDirectiveButton({
|
|
|
1087
1113
|
children: [
|
|
1088
1114
|
/* @__PURE__ */ jsxs2("span", { className: "inline-flex min-w-0 items-start gap-1", children: [
|
|
1089
1115
|
bad ? /* @__PURE__ */ jsx4(AlertIcon, { className: "mt-px h-3.5 w-3.5 shrink-0" }) : /* @__PURE__ */ jsx4(CheckCircleIcon, { className: "mt-px h-3.5 w-3.5 shrink-0" }),
|
|
1090
|
-
/* @__PURE__ */
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1116
|
+
bad ? /* @__PURE__ */ jsx4(
|
|
1117
|
+
FailureNotice,
|
|
1118
|
+
{
|
|
1119
|
+
words: failureWords(
|
|
1120
|
+
{
|
|
1121
|
+
raw: state.message ?? `${state.failed} failed`,
|
|
1122
|
+
directiveClass: directive.directiveClass,
|
|
1123
|
+
noun: directive.noun,
|
|
1124
|
+
nounLabel: nounText,
|
|
1125
|
+
failed: state.failed,
|
|
1126
|
+
total: state.applied + state.failed
|
|
1127
|
+
},
|
|
1128
|
+
host.explainFailure
|
|
1129
|
+
),
|
|
1130
|
+
raw: state.message
|
|
1131
|
+
}
|
|
1132
|
+
) : /* @__PURE__ */ jsx4("span", { className: "min-w-0", children: state.message ?? `Applied ${state.applied}` })
|
|
1094
1133
|
] }),
|
|
1095
1134
|
state.copies > 1 ? /* @__PURE__ */ jsx4(
|
|
1096
1135
|
"span",
|
|
@@ -1167,10 +1206,64 @@ function ApplyDirectiveButton({
|
|
|
1167
1206
|
]
|
|
1168
1207
|
}
|
|
1169
1208
|
),
|
|
1170
|
-
state.status === "error" ? /* @__PURE__ */ jsxs2(
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1209
|
+
state.status === "error" ? /* @__PURE__ */ jsxs2(
|
|
1210
|
+
"span",
|
|
1211
|
+
{
|
|
1212
|
+
className: "inline-flex max-w-sm items-start gap-1 text-xs text-destructive",
|
|
1213
|
+
"data-apply-state": "error",
|
|
1214
|
+
children: [
|
|
1215
|
+
/* @__PURE__ */ jsx4(AlertIcon, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
|
|
1216
|
+
/* @__PURE__ */ jsx4(
|
|
1217
|
+
FailureNotice,
|
|
1218
|
+
{
|
|
1219
|
+
words: failureWords(
|
|
1220
|
+
{
|
|
1221
|
+
raw: state.message,
|
|
1222
|
+
directiveClass: directive.directiveClass,
|
|
1223
|
+
noun: directive.noun,
|
|
1224
|
+
nounLabel: nounText
|
|
1225
|
+
},
|
|
1226
|
+
host.explainFailure
|
|
1227
|
+
),
|
|
1228
|
+
raw: state.message
|
|
1229
|
+
}
|
|
1230
|
+
)
|
|
1231
|
+
]
|
|
1232
|
+
}
|
|
1233
|
+
) : null
|
|
1234
|
+
] });
|
|
1235
|
+
}
|
|
1236
|
+
function FailureNotice({
|
|
1237
|
+
words,
|
|
1238
|
+
raw
|
|
1239
|
+
}) {
|
|
1240
|
+
const [open, setOpen] = useState(false);
|
|
1241
|
+
const detail = raw?.trim() ?? "";
|
|
1242
|
+
return /* @__PURE__ */ jsxs2("span", { className: "flex min-w-0 flex-col gap-0.5", "data-apply-failure": true, children: [
|
|
1243
|
+
/* @__PURE__ */ jsxs2("span", { className: "min-w-0", children: [
|
|
1244
|
+
words.what,
|
|
1245
|
+
" ",
|
|
1246
|
+
words.next,
|
|
1247
|
+
detail ? /* @__PURE__ */ jsx4(
|
|
1248
|
+
"button",
|
|
1249
|
+
{
|
|
1250
|
+
type: "button",
|
|
1251
|
+
onClick: () => setOpen((v) => !v),
|
|
1252
|
+
"aria-expanded": open,
|
|
1253
|
+
className: "ml-1 underline underline-offset-2 hover:no-underline",
|
|
1254
|
+
"data-apply-failure-details-toggle": true,
|
|
1255
|
+
children: open ? "Hide details" : "Details"
|
|
1256
|
+
}
|
|
1257
|
+
) : null
|
|
1258
|
+
] }),
|
|
1259
|
+
open && detail ? /* @__PURE__ */ jsx4(
|
|
1260
|
+
"span",
|
|
1261
|
+
{
|
|
1262
|
+
className: "block max-w-sm select-text break-words font-mono text-[11px] text-muted-foreground",
|
|
1263
|
+
"data-apply-failure-details": true,
|
|
1264
|
+
children: detail
|
|
1265
|
+
}
|
|
1266
|
+
) : null
|
|
1174
1267
|
] });
|
|
1175
1268
|
}
|
|
1176
1269
|
|
|
@@ -1413,7 +1506,7 @@ function TargetRow({
|
|
|
1413
1506
|
isUpdate ? host.readRecord : void 0,
|
|
1414
1507
|
isUpdate ? { noun: directive.noun, id: recordId } : null
|
|
1415
1508
|
);
|
|
1416
|
-
const changes = isUpdate ? itemChanges(item, current.values) : [];
|
|
1509
|
+
const changes = isUpdate ? itemChanges(item, current.values, { titleColumn: nounTitleColumn(directive.noun, host.nouns) }) : [];
|
|
1417
1510
|
const name = host.renderRecord ? host.renderRecord({ noun: directive.noun, id: recordId, fallback, context: "row" }) : /* @__PURE__ */ jsx7("span", { className: "truncate font-medium text-foreground", children: fallback });
|
|
1418
1511
|
return /* @__PURE__ */ jsxs5("div", { className: "py-1 text-xs", "data-directive-target": recordId, children: [
|
|
1419
1512
|
/* @__PURE__ */ jsxs5("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
@@ -1961,8 +2054,10 @@ export {
|
|
|
1961
2054
|
consoleErrorReporter,
|
|
1962
2055
|
createDbKindComponentCache,
|
|
1963
2056
|
createKindRouteBinding,
|
|
2057
|
+
defaultFailureWords,
|
|
1964
2058
|
describeChangeValue,
|
|
1965
2059
|
envelopeFromPartialKind,
|
|
2060
|
+
failureWords,
|
|
1966
2061
|
fieldLabel,
|
|
1967
2062
|
getDirectiveRenderer,
|
|
1968
2063
|
isDbKindComponentBodyPending,
|