@arbidocs/blocks 0.5.63 → 0.5.65
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/{ConnectedDocumentViewer-7VKAM6KD.js → ConnectedDocumentViewer-HKIBNGGG.js} +10 -9
- package/dist/{ConnectedDocumentViewer-7VKAM6KD.js.map → ConnectedDocumentViewer-HKIBNGGG.js.map} +1 -1
- package/dist/{ConnectedDocumentViewer-FGQ27H4B.cjs → ConnectedDocumentViewer-YSZWOVGN.cjs} +11 -10
- package/dist/{ConnectedDocumentViewer-FGQ27H4B.cjs.map → ConnectedDocumentViewer-YSZWOVGN.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-HJ4FTVH6.cjs → ConnectedNativeDocxComparison-L3R3ROPZ.cjs} +7 -7
- package/dist/{ConnectedNativeDocxComparison-HJ4FTVH6.cjs.map → ConnectedNativeDocxComparison-L3R3ROPZ.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-FPW3BNBN.js → ConnectedNativeDocxComparison-PSAP3Q7D.js} +6 -6
- package/dist/{ConnectedNativeDocxComparison-FPW3BNBN.js.map → ConnectedNativeDocxComparison-PSAP3Q7D.js.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-S7NJMDSU.js → ConnectedNativeDocxEditor-PI6QTPXZ.js} +5 -5
- package/dist/{ConnectedNativeDocxEditor-S7NJMDSU.js.map → ConnectedNativeDocxEditor-PI6QTPXZ.js.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-PF46MU5H.cjs → ConnectedNativeDocxEditor-VDBC4XRT.cjs} +7 -7
- package/dist/{ConnectedNativeDocxEditor-PF46MU5H.cjs.map → ConnectedNativeDocxEditor-VDBC4XRT.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-5MHLV24V.js → ConnectedStreamedWordArtifact-V4MTKVNE.js} +6 -6
- package/dist/ConnectedStreamedWordArtifact-V4MTKVNE.js.map +1 -0
- package/dist/{ConnectedStreamedWordArtifact-LNGW7YGV.cjs → ConnectedStreamedWordArtifact-YSW6D7AG.cjs} +7 -7
- package/dist/ConnectedStreamedWordArtifact-YSW6D7AG.cjs.map +1 -0
- package/dist/{DocumentReviewCard-VFNMJSK7.cjs → DocumentReviewCard-BQ6ZD5MD.cjs} +6 -6
- package/dist/{DocumentReviewCard-VFNMJSK7.cjs.map → DocumentReviewCard-BQ6ZD5MD.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-5U3TGJZA.js → DocumentReviewCard-TQQADJ36.js} +6 -6
- package/dist/{DocumentReviewCard-5U3TGJZA.js.map → DocumentReviewCard-TQQADJ36.js.map} +1 -1
- package/dist/{WorkspaceTableView-DHMCJRC6.cjs → WorkspaceTableView-GKMVTECZ.cjs} +6 -6
- package/dist/{WorkspaceTableView-DHMCJRC6.cjs.map → WorkspaceTableView-GKMVTECZ.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-EH5CEB44.js → WorkspaceTableView-YFLVFRJL.js} +4 -4
- package/dist/{WorkspaceTableView-EH5CEB44.js.map → WorkspaceTableView-YFLVFRJL.js.map} +1 -1
- package/dist/agents/index.cjs +345 -344
- package/dist/agents/index.js +6 -5
- package/dist/{chunk-NDVLCOWS.js → chunk-2LUA7UDE.js} +7 -7
- package/dist/{chunk-NDVLCOWS.js.map → chunk-2LUA7UDE.js.map} +1 -1
- package/dist/{chunk-77IAOKZO.js → chunk-2VH2PT3J.js} +5 -38
- package/dist/chunk-2VH2PT3J.js.map +1 -0
- package/dist/{chunk-IC6SBDYA.js → chunk-4CI42DCG.js} +3 -3
- package/dist/{chunk-IC6SBDYA.js.map → chunk-4CI42DCG.js.map} +1 -1
- package/dist/{chunk-IFLFLP4K.js → chunk-4Q7ON335.js} +6 -5
- package/dist/chunk-4Q7ON335.js.map +1 -0
- package/dist/{chunk-IUFS3AYQ.js → chunk-5EGTGHBW.js} +7 -7
- package/dist/{chunk-IUFS3AYQ.js.map → chunk-5EGTGHBW.js.map} +1 -1
- package/dist/{chunk-OLDGMBEF.cjs → chunk-67AFX23Y.cjs} +185 -91
- package/dist/chunk-67AFX23Y.cjs.map +1 -0
- package/dist/{chunk-5CWBAINB.js → chunk-6OMIIF76.js} +3 -3
- package/dist/{chunk-5CWBAINB.js.map → chunk-6OMIIF76.js.map} +1 -1
- package/dist/chunk-6QZ35CTZ.js +594 -0
- package/dist/chunk-6QZ35CTZ.js.map +1 -0
- package/dist/{chunk-4RJPTXUQ.cjs → chunk-7MOQO6NO.cjs} +5 -5
- package/dist/{chunk-4RJPTXUQ.cjs.map → chunk-7MOQO6NO.cjs.map} +1 -1
- package/dist/chunk-AESJLGMC.cjs +1228 -0
- package/dist/chunk-AESJLGMC.cjs.map +1 -0
- package/dist/{chunk-EOIJ5JYP.cjs → chunk-B3CRSCLK.cjs} +4 -4
- package/dist/{chunk-EOIJ5JYP.cjs.map → chunk-B3CRSCLK.cjs.map} +1 -1
- package/dist/{chunk-GRDLCRNL.js → chunk-BELZ2WD2.js} +5 -5
- package/dist/{chunk-GRDLCRNL.js.map → chunk-BELZ2WD2.js.map} +1 -1
- package/dist/chunk-C2S246BV.js +1225 -0
- package/dist/chunk-C2S246BV.js.map +1 -0
- package/dist/{chunk-TAI23FCY.js → chunk-CEKOZAGO.js} +3 -3
- package/dist/{chunk-TAI23FCY.js.map → chunk-CEKOZAGO.js.map} +1 -1
- package/dist/{chunk-HVOPUYAG.cjs → chunk-CJF7B5A7.cjs} +29 -28
- package/dist/chunk-CJF7B5A7.cjs.map +1 -0
- package/dist/{chunk-LBKTTQUR.cjs → chunk-CMYJEIZB.cjs} +12 -12
- package/dist/{chunk-LBKTTQUR.cjs.map → chunk-CMYJEIZB.cjs.map} +1 -1
- package/dist/{chunk-2SLDVFOZ.js → chunk-CRHY7DBO.js} +3 -3
- package/dist/{chunk-2SLDVFOZ.js.map → chunk-CRHY7DBO.js.map} +1 -1
- package/dist/{chunk-23ACBETH.cjs → chunk-D27BBGUF.cjs} +4 -4
- package/dist/{chunk-23ACBETH.cjs.map → chunk-D27BBGUF.cjs.map} +1 -1
- package/dist/{chunk-3X37I6QE.cjs → chunk-DJE2E7YH.cjs} +29 -29
- package/dist/{chunk-3X37I6QE.cjs.map → chunk-DJE2E7YH.cjs.map} +1 -1
- package/dist/{chunk-CCSF7RI4.cjs → chunk-EG3BB32W.cjs} +3 -3
- package/dist/{chunk-CCSF7RI4.cjs.map → chunk-EG3BB32W.cjs.map} +1 -1
- package/dist/{chunk-MAKTAR7H.cjs → chunk-F777MGVA.cjs} +18 -18
- package/dist/{chunk-MAKTAR7H.cjs.map → chunk-F777MGVA.cjs.map} +1 -1
- package/dist/{chunk-TFWCREOL.js → chunk-GPYLXEZO.js} +9 -506
- package/dist/chunk-GPYLXEZO.js.map +1 -0
- package/dist/{chunk-OY3I32ZS.js → chunk-GX37C5QT.js} +4 -4
- package/dist/{chunk-OY3I32ZS.js.map → chunk-GX37C5QT.js.map} +1 -1
- package/dist/chunk-I4IS6ST6.cjs +48 -0
- package/dist/chunk-I4IS6ST6.cjs.map +1 -0
- package/dist/{chunk-OZL5ABLF.js → chunk-IRXPUQFP.js} +3 -3
- package/dist/{chunk-OZL5ABLF.js.map → chunk-IRXPUQFP.js.map} +1 -1
- package/dist/chunk-J77BACGX.js +575 -0
- package/dist/chunk-J77BACGX.js.map +1 -0
- package/dist/{chunk-X3JJTHQ4.cjs → chunk-JSHBC47B.cjs} +55 -55
- package/dist/{chunk-X3JJTHQ4.cjs.map → chunk-JSHBC47B.cjs.map} +1 -1
- package/dist/{chunk-Y6ZNWC7E.cjs → chunk-K26RLK2Y.cjs} +3 -3
- package/dist/{chunk-Y6ZNWC7E.cjs.map → chunk-K26RLK2Y.cjs.map} +1 -1
- package/dist/{chunk-PKDPQS6Z.js → chunk-KNOSLLTC.js} +3 -3
- package/dist/{chunk-PKDPQS6Z.js.map → chunk-KNOSLLTC.js.map} +1 -1
- package/dist/chunk-LFS6UWSJ.cjs +602 -0
- package/dist/chunk-LFS6UWSJ.cjs.map +1 -0
- package/dist/{chunk-YQFEN7UJ.js → chunk-LNH6NYG4.js} +6 -90
- package/dist/chunk-LNH6NYG4.js.map +1 -0
- package/dist/chunk-LRPGXNMA.js +44 -0
- package/dist/chunk-LRPGXNMA.js.map +1 -0
- package/dist/chunk-NEGFHF3V.cjs +617 -0
- package/dist/chunk-NEGFHF3V.cjs.map +1 -0
- package/dist/{chunk-NHPBONMR.js → chunk-O4FBMC6S.js} +186 -71
- package/dist/chunk-O4FBMC6S.js.map +1 -0
- package/dist/{chunk-7P24MJQN.js → chunk-PBIFISDD.js} +3 -3
- package/dist/{chunk-7P24MJQN.js.map → chunk-PBIFISDD.js.map} +1 -1
- package/dist/{chunk-OWUNCJFO.cjs → chunk-PZOX4JF6.cjs} +30 -30
- package/dist/{chunk-OWUNCJFO.cjs.map → chunk-PZOX4JF6.cjs.map} +1 -1
- package/dist/{chunk-CKNUL4LM.cjs → chunk-QK546T4C.cjs} +3 -3
- package/dist/{chunk-CKNUL4LM.cjs.map → chunk-QK546T4C.cjs.map} +1 -1
- package/dist/{chunk-QAXIVZEJ.cjs → chunk-ROWJU4SK.cjs} +13 -513
- package/dist/chunk-ROWJU4SK.cjs.map +1 -0
- package/dist/{chunk-JWRTUYLC.js → chunk-SBAM3UZX.js} +3 -3
- package/dist/{chunk-JWRTUYLC.js.map → chunk-SBAM3UZX.js.map} +1 -1
- package/dist/{chunk-COZDIUG7.cjs → chunk-TJ7QEGVP.cjs} +18 -18
- package/dist/{chunk-COZDIUG7.cjs.map → chunk-TJ7QEGVP.cjs.map} +1 -1
- package/dist/{chunk-PVPGD6QR.js → chunk-VWM3J6ES.js} +3 -3
- package/dist/{chunk-PVPGD6QR.js.map → chunk-VWM3J6ES.js.map} +1 -1
- package/dist/{chunk-UDMII47W.cjs → chunk-WBLCPCWR.cjs} +7 -7
- package/dist/{chunk-UDMII47W.cjs.map → chunk-WBLCPCWR.cjs.map} +1 -1
- package/dist/{chunk-3T3IKNGF.cjs → chunk-ZXW6WFZG.cjs} +5 -41
- package/dist/chunk-ZXW6WFZG.cjs.map +1 -0
- package/dist/{chunk-ODQK3LX5.cjs → chunk-ZZHMJXM5.cjs} +4 -93
- package/dist/chunk-ZZHMJXM5.cjs.map +1 -0
- package/dist/connect/docx.cjs +11 -11
- package/dist/connect/docx.js +7 -7
- package/dist/connect/index.cjs +496 -493
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +36 -33
- package/dist/connect/index.js.map +1 -1
- package/dist/connect/viewer.cjs +9 -8
- package/dist/connect/viewer.js +8 -7
- package/dist/dashboards/index.cjs +1 -1
- package/dist/dashboards/index.js +1 -1
- package/dist/document-tools/index.cjs +17 -17
- package/dist/document-tools/index.js +2 -2
- package/dist/embed/index.cjs +11 -10
- package/dist/embed/index.js +8 -7
- package/dist/facts/index.cjs +1 -1
- package/dist/facts/index.js +1 -1
- package/dist/files/index.cjs +1 -1
- package/dist/files/index.js +1 -1
- package/dist/index.cjs +653 -618
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +19 -16
- package/dist/index.js.map +1 -1
- package/dist/shell/index.cjs +78 -77
- package/dist/shell/index.js +3 -2
- package/dist/site/index.cjs +105 -81
- package/dist/site/index.d.ts +3 -1
- package/dist/site/index.js +4 -4
- package/dist/studio/index.cjs +60 -55
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.js +12 -7
- package/dist/studio/index.js.map +1 -1
- package/dist/theme/ThemeControls.d.ts +71 -0
- package/dist/theme/ThemeEditor.d.ts +5 -2
- package/dist/theme/ThemePreview.d.ts +20 -0
- package/dist/theme/color.d.ts +17 -1
- package/dist/theme/derive.d.ts +75 -0
- package/dist/theme/editorModel.d.ts +36 -0
- package/dist/theme/previewLabels.d.ts +38 -0
- package/dist/theme/store.d.ts +51 -13
- package/dist/theme/tokens.d.ts +2 -0
- package/dist/workflow-canvas/index.cjs +37 -36
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/dist/workflow-canvas/index.js +13 -12
- package/dist/workflow-canvas/index.js.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ConnectedStreamedWordArtifact-5MHLV24V.js.map +0 -1
- package/dist/ConnectedStreamedWordArtifact-LNGW7YGV.cjs.map +0 -1
- package/dist/chunk-3T3IKNGF.cjs.map +0 -1
- package/dist/chunk-77IAOKZO.js.map +0 -1
- package/dist/chunk-HVOPUYAG.cjs.map +0 -1
- package/dist/chunk-IFLFLP4K.js.map +0 -1
- package/dist/chunk-N5WJBQYF.cjs +0 -476
- package/dist/chunk-N5WJBQYF.cjs.map +0 -1
- package/dist/chunk-NHPBONMR.js.map +0 -1
- package/dist/chunk-ODQK3LX5.cjs.map +0 -1
- package/dist/chunk-OLDGMBEF.cjs.map +0 -1
- package/dist/chunk-QAXIVZEJ.cjs.map +0 -1
- package/dist/chunk-QCLYRNOC.js +0 -466
- package/dist/chunk-QCLYRNOC.js.map +0 -1
- package/dist/chunk-TFWCREOL.js.map +0 -1
- package/dist/chunk-YQFEN7UJ.js.map +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The theme editor's small controls. Each reports the token keys it changes through `onHint`
|
|
3
|
+
* (on hover and focus; `null` on leave and blur), which the editor turns into preview highlights.
|
|
4
|
+
*/
|
|
5
|
+
import { type ReactNode } from 'react';
|
|
6
|
+
import { type HintHandler } from './editorModel';
|
|
7
|
+
export interface ColorFieldProps {
|
|
8
|
+
label: string;
|
|
9
|
+
/** One line under the label: what it is for. */
|
|
10
|
+
hint?: string;
|
|
11
|
+
value: string;
|
|
12
|
+
onChange: (hex: string) => void;
|
|
13
|
+
keys: readonly string[];
|
|
14
|
+
onHint: HintHandler;
|
|
15
|
+
/** `data-testid`s of the swatch and the hex field. */
|
|
16
|
+
testIds: {
|
|
17
|
+
color: string;
|
|
18
|
+
hex: string;
|
|
19
|
+
};
|
|
20
|
+
/** Trailing content, e.g. an "edited" badge with a reset. */
|
|
21
|
+
trailing?: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A colour: a swatch (the native picker) and its hex. The hex field keeps what is typed and only
|
|
25
|
+
* commits a complete colour, so a half-typed value never repaints the app.
|
|
26
|
+
*/
|
|
27
|
+
export declare function ColorField({ label, hint, value, onChange, keys, onHint, testIds, trailing, }: ColorFieldProps): import("react").JSX.Element;
|
|
28
|
+
export interface SegmentedProps<T extends string> {
|
|
29
|
+
label: string;
|
|
30
|
+
value: T;
|
|
31
|
+
options: readonly {
|
|
32
|
+
value: T;
|
|
33
|
+
label: string;
|
|
34
|
+
}[];
|
|
35
|
+
onChange: (value: T) => void;
|
|
36
|
+
keys: readonly string[];
|
|
37
|
+
onHint: HintHandler;
|
|
38
|
+
testId: string;
|
|
39
|
+
}
|
|
40
|
+
/** A small single-choice group (radio semantics). */
|
|
41
|
+
export declare function Segmented<T extends string>({ label, value, options, onChange, keys, onHint, testId, }: SegmentedProps<T>): import("react").JSX.Element;
|
|
42
|
+
export interface SliderFieldProps {
|
|
43
|
+
label: string;
|
|
44
|
+
/** Shown beside the label (the current value in words). */
|
|
45
|
+
valueText: string;
|
|
46
|
+
value: number;
|
|
47
|
+
min: number;
|
|
48
|
+
max: number;
|
|
49
|
+
step: number;
|
|
50
|
+
onChange: (value: number) => void;
|
|
51
|
+
/** Words under the two ends of the track. */
|
|
52
|
+
ends?: [string, string];
|
|
53
|
+
keys: readonly string[];
|
|
54
|
+
onHint: HintHandler;
|
|
55
|
+
testId: string;
|
|
56
|
+
}
|
|
57
|
+
export declare function SliderField({ label, valueText, value, min, max, step, onChange, ends, keys, onHint, testId, }: SliderFieldProps): import("react").JSX.Element;
|
|
58
|
+
export interface SelectFieldProps {
|
|
59
|
+
label: string;
|
|
60
|
+
value: string;
|
|
61
|
+
options: readonly {
|
|
62
|
+
value: string;
|
|
63
|
+
label: string;
|
|
64
|
+
}[];
|
|
65
|
+
onChange: (value: string) => void;
|
|
66
|
+
keys: readonly string[];
|
|
67
|
+
onHint: HintHandler;
|
|
68
|
+
testId: string;
|
|
69
|
+
hint?: string;
|
|
70
|
+
}
|
|
71
|
+
export declare function SelectField({ label, value, options, onChange, keys, onHint, testId, hint, }: SelectFieldProps): import("react").JSX.Element;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import type { ThemeBundle } from './store';
|
|
2
|
+
import type { ThemePreviewLabels } from './previewLabels';
|
|
2
3
|
export interface ThemeEditorProps {
|
|
3
4
|
/** The host's theme store bundle (from createThemeStore). */
|
|
4
5
|
bundle: ThemeBundle;
|
|
5
6
|
variant?: 'panel' | 'drawer' | 'collapsed';
|
|
6
|
-
/**
|
|
7
|
+
/** Identity shown in the live preview's header. */
|
|
7
8
|
preview?: {
|
|
8
9
|
title: string;
|
|
9
10
|
subtitle?: string;
|
|
10
11
|
};
|
|
12
|
+
/** The preview's sample words, for a host that wants its own. */
|
|
13
|
+
previewLabels?: Partial<ThemePreviewLabels>;
|
|
11
14
|
/** Optional persistence side-channel (e.g. save theme to ARBI); returns a "via" label. */
|
|
12
15
|
onSave?: () => Promise<string | void>;
|
|
13
16
|
/** Stable testid namespace, e.g. "builder-theme" | "studio-theme". */
|
|
@@ -15,4 +18,4 @@ export interface ThemeEditorProps {
|
|
|
15
18
|
/** `collapsed` only: start with the controls open. */
|
|
16
19
|
defaultOpen?: boolean;
|
|
17
20
|
}
|
|
18
|
-
export declare function ThemeEditor({ bundle, variant, preview, onSave, testIdPrefix, defaultOpen, }: ThemeEditorProps): import("react").JSX.Element;
|
|
21
|
+
export declare function ThemeEditor({ bundle, variant, preview, previewLabels, onSave, testIdPrefix, defaultOpen, }: ThemeEditorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ThemeFonts } from './tokens';
|
|
2
|
+
import type { ColorScheme } from './derive';
|
|
3
|
+
import type { PreviewPart } from './editorModel';
|
|
4
|
+
import { type ThemePreviewLabels } from './previewLabels';
|
|
5
|
+
export interface ThemePreviewProps {
|
|
6
|
+
colors: Record<string, string>;
|
|
7
|
+
fonts: ThemeFonts;
|
|
8
|
+
radius: number;
|
|
9
|
+
scheme: ColorScheme;
|
|
10
|
+
/** The parts to outline; `null` when no control is hovered or focused. */
|
|
11
|
+
highlight?: ReadonlySet<PreviewPart> | null;
|
|
12
|
+
/** One column of parts (a narrow drawer) instead of a two-column grid. */
|
|
13
|
+
compact?: boolean;
|
|
14
|
+
labels?: Partial<ThemePreviewLabels>;
|
|
15
|
+
/** A heading over the parts, e.g. the host's name. */
|
|
16
|
+
title?: string;
|
|
17
|
+
subtitle?: string;
|
|
18
|
+
testId?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function ThemePreview({ colors, fonts, radius, scheme, highlight, compact, labels: labelOverrides, title, subtitle, testId, }: ThemePreviewProps): import("react").JSX.Element;
|
package/dist/theme/color.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Colour math for the theme store: parse the formats a theme value comes in (hex, `rgb()`,
|
|
3
|
-
* `hsl()`, a raw `H S% L%` triplet)
|
|
3
|
+
* `hsl()`, a raw `H S% L%` triplet), convert between them, and measure WCAG contrast.
|
|
4
4
|
*
|
|
5
5
|
* Pure functions, no DOM. A theme value is kept in whatever format the host wrote it (Clarum's
|
|
6
6
|
* `@theme` is hex, the ARBI app's stylesheet is triplets); these helpers turn it into the two
|
|
@@ -51,3 +51,19 @@ export declare function toHslTriplet(color: string): string;
|
|
|
51
51
|
* other value (hex, `rgb()`, `oklch()`) is already a colour and is kept as written.
|
|
52
52
|
*/
|
|
53
53
|
export declare function toCssColor(value: string): string;
|
|
54
|
+
/** WCAG relative luminance, 0 (black) .. 1 (white). */
|
|
55
|
+
export declare function relativeLuminance(rgb: Rgb): number;
|
|
56
|
+
/** WCAG contrast ratio of two colour values (1..21), or `null` when either cannot be parsed. */
|
|
57
|
+
export declare function contrastRatio(a: string, b: string): number | null;
|
|
58
|
+
/** WCAG AA thresholds: body text 4.5:1, large text and UI parts (borders, focus rings) 3:1. */
|
|
59
|
+
export declare const AA_TEXT = 4.5;
|
|
60
|
+
export declare const AA_UI = 3;
|
|
61
|
+
/**
|
|
62
|
+
* The colour nearest to `fg` (same hue and saturation, only lightness moved) that reaches `ratio`
|
|
63
|
+
* against `bg`. It moves away from the background first (darker on a light background, lighter on
|
|
64
|
+
* a dark one) and, if even black or white cannot reach the ratio that way, tries the other way.
|
|
65
|
+
* Returns hex; `fg` unchanged (as hex) when it already passes.
|
|
66
|
+
*/
|
|
67
|
+
export declare function ensureContrast(fg: string, bg: string, ratio: number): string;
|
|
68
|
+
/** Mix two colours in sRGB: `amount` 0 is `a`, 1 is `b`. Hex out. */
|
|
69
|
+
export declare function mix(a: string, b: string, amount: number): string;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export type ColorScheme = 'light' | 'dark';
|
|
2
|
+
/** `light`: the sidebar is a quiet surface. `brand`: a dark panel in the primary's hue. */
|
|
3
|
+
export type SidebarStyle = 'light' | 'brand';
|
|
4
|
+
/** `harmonious`: hues near the primary and accent. `distinct`: evenly spaced hues from the primary. */
|
|
5
|
+
export type ChartStyle = 'harmonious' | 'distinct';
|
|
6
|
+
export interface ThemeInputs {
|
|
7
|
+
/** The main brand colour: filled buttons, active tabs, links, focus rings. */
|
|
8
|
+
primary: string;
|
|
9
|
+
/** The second brand colour: highlights, AI actions, accent buttons, the second chart series. */
|
|
10
|
+
accent: string;
|
|
11
|
+
/** Surface tone: -1 cool grey-blue, 0 neutral, 1 warm paper. Beyond ±0.5 the page itself tints. */
|
|
12
|
+
warmth: number;
|
|
13
|
+
sidebar: SidebarStyle;
|
|
14
|
+
charts: ChartStyle;
|
|
15
|
+
danger: string;
|
|
16
|
+
success: string;
|
|
17
|
+
warning: string;
|
|
18
|
+
/**
|
|
19
|
+
* What `--secondary` is in this host: a brand accent (the blocks default, a saturated cyan) or a
|
|
20
|
+
* quiet surface (shadcn's). Inferred from the host's own value; not shown as a control.
|
|
21
|
+
*/
|
|
22
|
+
secondaryRole: 'accent' | 'surface';
|
|
23
|
+
}
|
|
24
|
+
export type ThemeInputKey = keyof ThemeInputs;
|
|
25
|
+
/** The editor's purpose groups. */
|
|
26
|
+
export type ThemeGroup = 'brand' | 'surfaces' | 'text' | 'status' | 'charts';
|
|
27
|
+
interface DerivedToken {
|
|
28
|
+
key: string;
|
|
29
|
+
group: ThemeGroup;
|
|
30
|
+
/** The inputs whose change rewrites this token. */
|
|
31
|
+
deps: readonly ThemeInputKey[];
|
|
32
|
+
}
|
|
33
|
+
/** Every token the derivation writes, with its group and the inputs it follows. */
|
|
34
|
+
export declare const DERIVED_TOKENS: readonly DerivedToken[];
|
|
35
|
+
/** The derived token `key`, or `undefined` when the derivation does not write it. */
|
|
36
|
+
export declare const derivedToken: (key: string) => DerivedToken | undefined;
|
|
37
|
+
/** The keys an input controls (what changes when it does). */
|
|
38
|
+
export declare function keysOfInput(input: ThemeInputKey): string[];
|
|
39
|
+
/** The keys a purpose group holds. */
|
|
40
|
+
export declare function keysOfGroup(group: ThemeGroup): string[];
|
|
41
|
+
/**
|
|
42
|
+
* The inputs that describe an existing set of colours (a host's defaults, a preset): the primary
|
|
43
|
+
* as is, the accent from the AI/secondary tokens, the warmth from the page and muted surfaces, the
|
|
44
|
+
* sidebar style from its lightness. A key the colours lack falls back to a neutral default.
|
|
45
|
+
*/
|
|
46
|
+
export declare function inferInputs(colors: Record<string, string>): ThemeInputs;
|
|
47
|
+
/**
|
|
48
|
+
* Every derived token's value for one scheme, as hex. Pure: the same inputs always give the same
|
|
49
|
+
* colours. Text pairs reach WCAG AA (4.5:1), ring and input 3:1 against the page, chart series 3:1
|
|
50
|
+
* against the page (graphical objects).
|
|
51
|
+
*/
|
|
52
|
+
export declare function deriveColors(inputs: ThemeInputs, scheme: ColorScheme): Record<string, string>;
|
|
53
|
+
export interface ContrastPair {
|
|
54
|
+
/** The text (or UI part) token. */
|
|
55
|
+
fg: string;
|
|
56
|
+
/** The surface it sits on. */
|
|
57
|
+
bg: string;
|
|
58
|
+
/** WCAG AA threshold: 4.5 for text, 3 for UI parts. */
|
|
59
|
+
min: number;
|
|
60
|
+
/** Plain-language name, e.g. "Text on buttons". */
|
|
61
|
+
label: string;
|
|
62
|
+
}
|
|
63
|
+
/** The pairs the editor checks, light and dark. */
|
|
64
|
+
export declare const CONTRAST_PAIRS: readonly ContrastPair[];
|
|
65
|
+
export interface ContrastIssue extends ContrastPair {
|
|
66
|
+
ratio: number;
|
|
67
|
+
/** The foreground value that passes (same hue, lightness moved). */
|
|
68
|
+
fix: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The pairs below their threshold, given a token resolver (the theme's value of a key, or
|
|
72
|
+
* `undefined` when unknown). Pairs with an unknown or unparseable side are skipped.
|
|
73
|
+
*/
|
|
74
|
+
export declare function contrastIssues(resolve: (key: string) => string | undefined, pairs?: readonly ContrastPair[]): ContrastIssue[];
|
|
75
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the theme editor knows about its own layout: the purpose sections and their plain-language
|
|
3
|
+
* "affects…" lines, which preview part reads which token (so hovering a control can outline
|
|
4
|
+
* exactly the parts it changes), and how to read a token the store does not hold from the page.
|
|
5
|
+
*/
|
|
6
|
+
import type { ColorScheme } from './derive';
|
|
7
|
+
export type ThemeSection = 'brand' | 'surfaces' | 'text' | 'status' | 'charts' | 'advanced';
|
|
8
|
+
export declare const SECTION_COPY: Record<ThemeSection, {
|
|
9
|
+
title: string;
|
|
10
|
+
affects: string;
|
|
11
|
+
}>;
|
|
12
|
+
/** The parts the live preview shows. */
|
|
13
|
+
export type PreviewPart = 'page' | 'buttons' | 'input' | 'card' | 'tabs' | 'sidebar' | 'stepbar' | 'chart' | 'toast' | 'badges' | 'alerts';
|
|
14
|
+
/** Pseudo keys for the non-colour controls. */
|
|
15
|
+
export declare const FONT_DISPLAY = "font-display";
|
|
16
|
+
export declare const FONT_SANS = "font-sans";
|
|
17
|
+
export declare const RADIUS = "radius";
|
|
18
|
+
/** The tokens each preview part paints with. */
|
|
19
|
+
export declare const PART_TOKENS: Record<PreviewPart, readonly string[]>;
|
|
20
|
+
/** The preview parts that read any of `keys` (what a control with those keys changes). */
|
|
21
|
+
export declare function partsOf(keys: readonly string[]): Set<PreviewPart>;
|
|
22
|
+
/**
|
|
23
|
+
* Read token values from the page for keys the store does not hold (a host's catalog edits only
|
|
24
|
+
* some of the contract; the rest come from its stylesheet). Values are the raw custom properties,
|
|
25
|
+
* read on a probe element; the dark set through a `.dark` probe, which works with the contract's
|
|
26
|
+
* `.dark` selector. Returns only keys that resolve to a value. Empty without a DOM.
|
|
27
|
+
*/
|
|
28
|
+
export declare function readDocumentTokens(keys: readonly string[], scheme: ColorScheme): Record<string, string>;
|
|
29
|
+
export type HintHandler = (keys: readonly string[] | null) => void;
|
|
30
|
+
/** Hover and focus handlers that report `keys` while the pointer or focus is inside. */
|
|
31
|
+
export declare function hintProps(keys: readonly string[], onHint: HintHandler): {
|
|
32
|
+
onPointerEnter: () => void;
|
|
33
|
+
onPointerLeave: () => void;
|
|
34
|
+
onFocus: () => void;
|
|
35
|
+
onBlur: () => void;
|
|
36
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The theme editor preview's sample words. Neutral defaults; a host overrides any of them (e.g. to
|
|
3
|
+
* its own vocabulary) through `ThemeEditor previewLabels` or `ThemePreview labels`.
|
|
4
|
+
*/
|
|
5
|
+
export interface ThemePreviewLabels {
|
|
6
|
+
title: string;
|
|
7
|
+
subtitle: string;
|
|
8
|
+
primaryAction: string;
|
|
9
|
+
accentAction: string;
|
|
10
|
+
secondaryAction: string;
|
|
11
|
+
outlineAction: string;
|
|
12
|
+
dangerAction: string;
|
|
13
|
+
fieldLabel: string;
|
|
14
|
+
fieldPlaceholder: string;
|
|
15
|
+
cardBody: string;
|
|
16
|
+
tabs: [string, string, string];
|
|
17
|
+
tabBody: string;
|
|
18
|
+
nav: [string, string, string];
|
|
19
|
+
steps: [string, string, string];
|
|
20
|
+
chartLabel: string;
|
|
21
|
+
chartMonths: [string, string, string, string];
|
|
22
|
+
chartSeries: [string, string];
|
|
23
|
+
toastTitle: string;
|
|
24
|
+
toastBody: string;
|
|
25
|
+
toastAction: string;
|
|
26
|
+
badges: {
|
|
27
|
+
neutral: string;
|
|
28
|
+
success: string;
|
|
29
|
+
warning: string;
|
|
30
|
+
danger: string;
|
|
31
|
+
ai: string;
|
|
32
|
+
};
|
|
33
|
+
alerts: {
|
|
34
|
+
info: string;
|
|
35
|
+
danger: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export declare const DEFAULT_THEME_PREVIEW_LABELS: ThemePreviewLabels;
|
package/dist/theme/store.d.ts
CHANGED
|
@@ -2,27 +2,64 @@
|
|
|
2
2
|
* The shared theme store factory. A host calls {@link createThemeStore} once
|
|
3
3
|
* with its token catalog, default values and presets; the returned bundle (a
|
|
4
4
|
* zustand hook + metadata) is the single source of truth consumed by every
|
|
5
|
-
* theme surface (the back-office builder panel
|
|
6
|
-
* token model, presets and apply logic live in exactly
|
|
5
|
+
* theme surface (the back-office builder panel, the studio drawer and the
|
|
6
|
+
* settings page), so the token model, presets and apply logic live in exactly
|
|
7
|
+
* one place.
|
|
8
|
+
*
|
|
9
|
+
* State is the colour values themselves (light, and dark for a host with a dark
|
|
10
|
+
* mode) plus the brand {@link ThemeInputs} that describe them. Changing an input
|
|
11
|
+
* re-derives the tokens that depend on it ({@link deriveColors}); a colour set by
|
|
12
|
+
* hand (`setColor`) is an override and stops following the inputs until it is
|
|
13
|
+
* cleared. Every edit is undoable. Nothing is derived until an input changes, so
|
|
14
|
+
* the untouched store paints the host's defaults exactly.
|
|
7
15
|
*/
|
|
8
16
|
import { type UseBoundStore, type StoreApi } from 'zustand';
|
|
9
17
|
import { type ColorToken, type ThemeEmitMode, type ThemeFonts, type ThemePreset, type ThemeTokens } from './tokens';
|
|
18
|
+
import { type ColorScheme, type ThemeInputKey, type ThemeInputs } from './derive';
|
|
19
|
+
/** Everything an undo step restores. */
|
|
20
|
+
export interface ThemeHistoryEntry {
|
|
21
|
+
colors: Record<string, string>;
|
|
22
|
+
dark: Record<string, string>;
|
|
23
|
+
fonts: ThemeFonts;
|
|
24
|
+
radius: number;
|
|
25
|
+
inputs: ThemeInputs;
|
|
26
|
+
overrides: string[];
|
|
27
|
+
activePresetId: string | null;
|
|
28
|
+
}
|
|
10
29
|
export interface ThemeState extends ThemeTokens {
|
|
30
|
+
/** Dark-variant values (used when the host has a dark mode, see `darkColors`). */
|
|
31
|
+
dark: Record<string, string>;
|
|
32
|
+
/** The brand inputs the derived tokens follow. */
|
|
33
|
+
inputs: ThemeInputs;
|
|
34
|
+
/** Keys set by hand: they keep their value when an input changes. */
|
|
35
|
+
overrides: string[];
|
|
11
36
|
activePresetId: string | null;
|
|
12
|
-
|
|
37
|
+
/** Undo stack (oldest first) and redo stack; not persisted. */
|
|
38
|
+
past: ThemeHistoryEntry[];
|
|
39
|
+
future: ThemeHistoryEntry[];
|
|
40
|
+
/** Change one brand input and re-derive the tokens that follow it (light and dark). */
|
|
41
|
+
setInput: <K extends ThemeInputKey>(key: K, value: ThemeInputs[K]) => void;
|
|
42
|
+
/** Set one colour by hand (an override), in the light set or the dark one. */
|
|
43
|
+
setColor: (key: string, value: string, scheme?: ColorScheme) => void;
|
|
44
|
+
/** Drop an override: the token follows the brand inputs again. */
|
|
45
|
+
clearOverride: (key: string) => void;
|
|
13
46
|
setFont: (which: keyof ThemeFonts, value: string) => void;
|
|
14
47
|
/** Apply a curated pairing, setting the display and body faces together. */
|
|
15
48
|
setFontPairing: (pairingId: string) => void;
|
|
16
49
|
setRadius: (radius: number) => void;
|
|
17
50
|
applyPreset: (presetId: string) => void;
|
|
18
51
|
reset: () => void;
|
|
19
|
-
|
|
52
|
+
undo: () => void;
|
|
53
|
+
redo: () => void;
|
|
54
|
+
/** Replace the theme with stored tokens (e.g. loaded from the backend); clears the history. */
|
|
55
|
+
load: (tokens: ThemeTokens) => void;
|
|
56
|
+
/** Snapshot of the editable tokens (for export / live apply / save). */
|
|
20
57
|
snapshot: () => ThemeTokens;
|
|
21
58
|
}
|
|
22
59
|
export interface ThemeStoreConfig {
|
|
23
|
-
/** The editable token catalog (keys + labels + groups). */
|
|
60
|
+
/** The editable token catalog (keys + labels + groups): the Advanced section's rows. */
|
|
24
61
|
tokens: ColorToken[];
|
|
25
|
-
/** Group id → heading, for the
|
|
62
|
+
/** Group id → heading, for the Advanced section's layout. */
|
|
26
63
|
groupLabels: Record<string, string>;
|
|
27
64
|
/** Shipped defaults (the host's brand values). */
|
|
28
65
|
defaultTheme: ThemeTokens;
|
|
@@ -31,16 +68,17 @@ export interface ThemeStoreConfig {
|
|
|
31
68
|
/** localStorage key for persistence (namespaced per host). */
|
|
32
69
|
storageKey: string;
|
|
33
70
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
71
|
+
* Where edits are written on the document. Defaults to `'flat'` (inline on
|
|
72
|
+
* `<html>`). `'cssVars'` uses an injected `<style>` with a `:root.dark` block so
|
|
73
|
+
* an app's own `.dark` variant survives. Both write the raw triplet AND the
|
|
74
|
+
* `--color-*` of every token. See {@link applyThemeVars}.
|
|
38
75
|
*/
|
|
39
76
|
mode?: ThemeEmitMode;
|
|
40
77
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
78
|
+
* The dark-variant colour values keyed by token key: the host has a dark mode.
|
|
79
|
+
* `cssVars` mode emits them under `:root.dark` (required per editable token,
|
|
80
|
+
* otherwise a light-token override leaks into dark), and the editor offers a
|
|
81
|
+
* dark preview.
|
|
44
82
|
*/
|
|
45
83
|
darkColors?: Record<string, string>;
|
|
46
84
|
}
|
package/dist/theme/tokens.d.ts
CHANGED
|
@@ -44,6 +44,8 @@ export interface ThemeTokens {
|
|
|
44
44
|
fonts: ThemeFonts;
|
|
45
45
|
/** Base radius in rem. */
|
|
46
46
|
radius: number;
|
|
47
|
+
/** Dark-variant colour values keyed by token key, for a host with a dark mode. */
|
|
48
|
+
dark?: Record<string, string>;
|
|
47
49
|
}
|
|
48
50
|
export interface ThemePreset {
|
|
49
51
|
id: string;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkJSHBC47B_cjs = require('../chunk-JSHBC47B.cjs');
|
|
5
5
|
var chunkE5625KT2_cjs = require('../chunk-E5625KT2.cjs');
|
|
6
6
|
require('../chunk-HYAYXLIZ.cjs');
|
|
7
7
|
require('../chunk-KWJW5TMH.cjs');
|
|
8
|
-
require('../chunk-
|
|
8
|
+
require('../chunk-CMYJEIZB.cjs');
|
|
9
9
|
require('../chunk-EGJ7WJ6Q.cjs');
|
|
10
|
-
require('../chunk-H32DV7XS.cjs');
|
|
11
10
|
require('../chunk-JBL4PPEE.cjs');
|
|
12
|
-
|
|
11
|
+
require('../chunk-H32DV7XS.cjs');
|
|
12
|
+
var chunkWBLCPCWR_cjs = require('../chunk-WBLCPCWR.cjs');
|
|
13
13
|
require('../chunk-464YPRAE.cjs');
|
|
14
14
|
require('../chunk-PICGTGEB.cjs');
|
|
15
15
|
var chunkT35SGVB2_cjs = require('../chunk-T35SGVB2.cjs');
|
|
16
16
|
require('../chunk-5FYU7ZIU.cjs');
|
|
17
|
-
require('../chunk-VGNCU5JJ.cjs');
|
|
18
|
-
require('../chunk-2WLXQGWC.cjs');
|
|
19
17
|
require('../chunk-324RBHCF.cjs');
|
|
18
|
+
require('../chunk-VGNCU5JJ.cjs');
|
|
20
19
|
require('../chunk-223D4727.cjs');
|
|
20
|
+
require('../chunk-2WLXQGWC.cjs');
|
|
21
21
|
require('../chunk-JH6JTI76.cjs');
|
|
22
|
-
require('../chunk-UWIILWDI.cjs');
|
|
23
22
|
require('../chunk-IRY63R4L.cjs');
|
|
23
|
+
require('../chunk-UWIILWDI.cjs');
|
|
24
24
|
require('../chunk-ZESMRGDV.cjs');
|
|
25
25
|
require('../chunk-Z3LFF3YT.cjs');
|
|
26
26
|
require('../chunk-QXNEXPUL.cjs');
|
|
@@ -32,14 +32,15 @@ require('../chunk-5Y6V7F6W.cjs');
|
|
|
32
32
|
require('../chunk-VLCY46K6.cjs');
|
|
33
33
|
var chunkNSD37OF5_cjs = require('../chunk-NSD37OF5.cjs');
|
|
34
34
|
require('../chunk-72YEEUH7.cjs');
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
35
|
+
var chunkF777MGVA_cjs = require('../chunk-F777MGVA.cjs');
|
|
36
|
+
var chunkCJF7B5A7_cjs = require('../chunk-CJF7B5A7.cjs');
|
|
37
|
+
var chunkZXW6WFZG_cjs = require('../chunk-ZXW6WFZG.cjs');
|
|
38
38
|
require('../chunk-RFIBUWLF.cjs');
|
|
39
|
-
var
|
|
39
|
+
var chunkI4IS6ST6_cjs = require('../chunk-I4IS6ST6.cjs');
|
|
40
|
+
var chunkK26RLK2Y_cjs = require('../chunk-K26RLK2Y.cjs');
|
|
40
41
|
require('../chunk-3YEXZX4H.cjs');
|
|
41
|
-
require('../chunk-ZDZY6OPL.cjs');
|
|
42
42
|
require('../chunk-AQPZ4QMV.cjs');
|
|
43
|
+
require('../chunk-ZDZY6OPL.cjs');
|
|
43
44
|
require('../chunk-SIB6C7P7.cjs');
|
|
44
45
|
require('../chunk-DVUZTGVL.cjs');
|
|
45
46
|
require('../chunk-V4ISCZJ7.cjs');
|
|
@@ -366,9 +367,9 @@ function SignalsEditor({
|
|
|
366
367
|
{
|
|
367
368
|
className: ui.cn(
|
|
368
369
|
"space-y-1.5 rounded-md border p-2",
|
|
369
|
-
|
|
370
|
+
chunkZXW6WFZG_cjs.isIncompleteSignal(signal) ? "border-destructive/50" : "border-border"
|
|
370
371
|
),
|
|
371
|
-
"data-incomplete":
|
|
372
|
+
"data-incomplete": chunkZXW6WFZG_cjs.isIncompleteSignal(signal) || void 0,
|
|
372
373
|
"data-testid": `${testId}-${i}`,
|
|
373
374
|
children: [
|
|
374
375
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -1656,7 +1657,7 @@ function triggerFields(trigger, clearOthers) {
|
|
|
1656
1657
|
return {
|
|
1657
1658
|
timezone: trigger.timezone,
|
|
1658
1659
|
rrule: trigger.start === "repeat" ? trigger.rrule.trim() : none,
|
|
1659
|
-
run_at: trigger.start === "once" ?
|
|
1660
|
+
run_at: trigger.start === "once" ? chunkCJF7B5A7_cjs.localInputToIso(trigger.runAt) : none,
|
|
1660
1661
|
event_kind: trigger.start === "event" ? trigger.eventKind.trim() : none,
|
|
1661
1662
|
// A step signal is `workflow_signal` narrowed to one signal name.
|
|
1662
1663
|
event_filter: filter ?? none,
|
|
@@ -1672,7 +1673,7 @@ function plan(value, options) {
|
|
|
1672
1673
|
criteria: [],
|
|
1673
1674
|
max_passes: 3,
|
|
1674
1675
|
documents: [],
|
|
1675
|
-
steps:
|
|
1676
|
+
steps: chunkZXW6WFZG_cjs.toPlanSteps(value.workflow, options)
|
|
1676
1677
|
};
|
|
1677
1678
|
}
|
|
1678
1679
|
function builderToWorkflowRequest(value, workspaceId, options = {}) {
|
|
@@ -1707,7 +1708,7 @@ function builderToWorkflowUpdate(value, options = {}) {
|
|
|
1707
1708
|
}
|
|
1708
1709
|
function workflowRecordToBuilder(record) {
|
|
1709
1710
|
const planned = record.plan?.steps ?? [];
|
|
1710
|
-
const steps = planned.length ?
|
|
1711
|
+
const steps = planned.length ? chunkZXW6WFZG_cjs.fromPlanSteps(planned) : record.prompt || record.skill_ref ? [
|
|
1711
1712
|
{
|
|
1712
1713
|
id: "work",
|
|
1713
1714
|
kind: "agent",
|
|
@@ -1715,7 +1716,7 @@ function workflowRecordToBuilder(record) {
|
|
|
1715
1716
|
...record.skill_ref ? { workflow: record.skill_ref } : { run: { kind: "prompt", promptTemplate: record.prompt } }
|
|
1716
1717
|
}
|
|
1717
1718
|
] : [];
|
|
1718
|
-
const when =
|
|
1719
|
+
const when = chunkCJF7B5A7_cjs.workflowWhen(record);
|
|
1719
1720
|
return {
|
|
1720
1721
|
workflow: {
|
|
1721
1722
|
id: record.external_id,
|
|
@@ -1724,12 +1725,12 @@ function workflowRecordToBuilder(record) {
|
|
|
1724
1725
|
inputs: [],
|
|
1725
1726
|
landing: "chat",
|
|
1726
1727
|
schedulable: false,
|
|
1727
|
-
run: { kind: "steps", steps, layout:
|
|
1728
|
+
run: { kind: "steps", steps, layout: chunkZXW6WFZG_cjs.layoutFromPlanSteps(planned ?? []) }
|
|
1728
1729
|
},
|
|
1729
1730
|
trigger: {
|
|
1730
1731
|
...DEFAULT_WORKFLOW_TRIGGER,
|
|
1731
1732
|
start: when === "now" ? "manual" : when,
|
|
1732
|
-
runAt:
|
|
1733
|
+
runAt: chunkCJF7B5A7_cjs.isoToLocalInput(record.run_at),
|
|
1733
1734
|
rrule: record.rrule ?? "",
|
|
1734
1735
|
timezone: record.timezone || DEFAULT_WORKFLOW_TRIGGER.timezone,
|
|
1735
1736
|
eventKind: record.event_kind ?? "",
|
|
@@ -1785,7 +1786,7 @@ function triggerSummary(trigger, options = {}) {
|
|
|
1785
1786
|
case "once":
|
|
1786
1787
|
return trigger.runAt ? new Date(trigger.runAt).toLocaleString() : l.starts.once;
|
|
1787
1788
|
case "repeat":
|
|
1788
|
-
return trigger.rrule ?
|
|
1789
|
+
return trigger.rrule ? chunkZXW6WFZG_cjs.describeRRule(trigger.rrule) : l.starts.repeat;
|
|
1789
1790
|
case "event":
|
|
1790
1791
|
if (isSignalTrigger(trigger))
|
|
1791
1792
|
return trigger.signal ? l.signalSummary.replace("{signal}", trigger.signal) : l.stepSignals;
|
|
@@ -1844,7 +1845,7 @@ function TriggerInspector({
|
|
|
1844
1845
|
}
|
|
1845
1846
|
)
|
|
1846
1847
|
] }),
|
|
1847
|
-
trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1848
|
+
trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(chunkCJF7B5A7_cjs.RecurrenceBuilder, { rrule: trigger.rrule, onChange: (rrule) => set({ rrule }) }),
|
|
1848
1849
|
trigger.start === "event" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1849
1850
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "text-xs", children: l.event }),
|
|
1850
1851
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1896,7 +1897,7 @@ function TriggerInspector({
|
|
|
1896
1897
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1897
1898
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "text-xs", children: l.agent }),
|
|
1898
1899
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1899
|
-
|
|
1900
|
+
chunkK26RLK2Y_cjs.AgentSelect,
|
|
1900
1901
|
{
|
|
1901
1902
|
agents,
|
|
1902
1903
|
value: trigger.agentId,
|
|
@@ -2070,7 +2071,7 @@ function StepNode({ data }) {
|
|
|
2070
2071
|
"data-testid": `${testId}-node-${step.id}`,
|
|
2071
2072
|
"data-phase": phase,
|
|
2072
2073
|
children: [
|
|
2073
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2074
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkI4IS6ST6_cjs.ChevronShape, {}),
|
|
2074
2075
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.Handle, { type: "target", position: react$1.Position.Left }),
|
|
2075
2076
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2.5", children: [
|
|
2076
2077
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "wf-badge flex size-8 shrink-0 items-center justify-center rounded-lg [&_svg]:size-4", children: icon ?? /* @__PURE__ */ jsxRuntime.jsx(KindIcon, {}) }),
|
|
@@ -2130,7 +2131,7 @@ function TriggerNode({ data }) {
|
|
|
2130
2131
|
className: "wf-start wf-kind-start relative w-60 px-4 py-3 text-left",
|
|
2131
2132
|
"data-testid": `${data.testId}-node-trigger`,
|
|
2132
2133
|
children: [
|
|
2133
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2134
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkI4IS6ST6_cjs.ChevronShape, {}),
|
|
2134
2135
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2.5", children: [
|
|
2135
2136
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "wf-badge flex size-8 shrink-0 items-center justify-center rounded-full", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Zap, { className: "size-4" }) }),
|
|
2136
2137
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
|
|
@@ -2735,13 +2736,13 @@ function WorkflowPreview({
|
|
|
2735
2736
|
renderIcon,
|
|
2736
2737
|
testId
|
|
2737
2738
|
}) {
|
|
2738
|
-
const run =
|
|
2739
|
+
const run = chunkF777MGVA_cjs.useWorkflowPreview(workflow, {
|
|
2739
2740
|
resolveWorkflow: (id) => workflows.find((w) => w.id === id),
|
|
2740
2741
|
compose,
|
|
2741
2742
|
answer
|
|
2742
2743
|
});
|
|
2743
2744
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2744
|
-
|
|
2745
|
+
chunkCJF7B5A7_cjs.WorkflowRunner,
|
|
2745
2746
|
{
|
|
2746
2747
|
workflow,
|
|
2747
2748
|
run,
|
|
@@ -3002,7 +3003,7 @@ function ConnectedWorkflowsPage({
|
|
|
3002
3003
|
const config = host.workflows;
|
|
3003
3004
|
const { openConversation, openFiles } = chunkT6GRWWRY_cjs.useBlocksEnvironment();
|
|
3004
3005
|
const openWorkflow = chunkT35SGVB2_cjs.useOpenWorkflow();
|
|
3005
|
-
const renderPerson =
|
|
3006
|
+
const renderPerson = chunkJSHBC47B_cjs.useRenderTaskPerson();
|
|
3006
3007
|
const refreshDocuments = react$2.useRefreshDocuments();
|
|
3007
3008
|
const invalidateTags = react$2.useInvalidateTagData();
|
|
3008
3009
|
const { data: tags = [] } = react$2.useTags();
|
|
@@ -3033,7 +3034,7 @@ function ConnectedWorkflowsPage({
|
|
|
3033
3034
|
openHistory,
|
|
3034
3035
|
closeHistoryTab,
|
|
3035
3036
|
selectHistoryTab
|
|
3036
|
-
} =
|
|
3037
|
+
} = chunkJSHBC47B_cjs.useWorkflowsPageState({
|
|
3037
3038
|
historyWorkflowId: requestedHistoryId ?? historyWorkflowId,
|
|
3038
3039
|
onHistoryWorkflowConsumed: consumeHistory
|
|
3039
3040
|
});
|
|
@@ -3091,9 +3092,9 @@ function ConnectedWorkflowsPage({
|
|
|
3091
3092
|
const renderErrorReport = config?.renderErrorReport;
|
|
3092
3093
|
const running = runningId ? config?.catalogue?.find((entry) => entry.workflow.id === runningId) : void 0;
|
|
3093
3094
|
if (running && running.runnable !== false) {
|
|
3094
|
-
const stepWorkflows = config?.stepWorkflows ??
|
|
3095
|
+
const stepWorkflows = config?.stepWorkflows ?? chunkCJF7B5A7_cjs.WEB_WORKFLOWS;
|
|
3095
3096
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3096
|
-
|
|
3097
|
+
chunkJSHBC47B_cjs.ConnectedWorkflowRunner,
|
|
3097
3098
|
{
|
|
3098
3099
|
layout: "page",
|
|
3099
3100
|
workflow: running.workflow,
|
|
@@ -3166,7 +3167,7 @@ function ConnectedWorkflowsPage({
|
|
|
3166
3167
|
{
|
|
3167
3168
|
workflowId: builder.kind === "saved" ? builder.id : void 0,
|
|
3168
3169
|
initial: template ? { workflow: template.workflow, trigger: DEFAULT_WORKFLOW_TRIGGER } : void 0,
|
|
3169
|
-
workflows: config?.stepWorkflows ??
|
|
3170
|
+
workflows: config?.stepWorkflows ?? chunkCJF7B5A7_cjs.WEB_WORKFLOWS,
|
|
3170
3171
|
renderIcon: config?.renderIcon,
|
|
3171
3172
|
onSaved: builderSaved,
|
|
3172
3173
|
testId: "workflow-builder-canvas",
|
|
@@ -3181,7 +3182,7 @@ function ConnectedWorkflowsPage({
|
|
|
3181
3182
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full min-h-0 flex-col", "data-testid": testId, children: [
|
|
3182
3183
|
pageHeader && /* @__PURE__ */ jsxRuntime.jsx(chunkNSD37OF5_cjs.PageHeader, { ...pageHeader }),
|
|
3183
3184
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3184
|
-
|
|
3185
|
+
chunkWBLCPCWR_cjs.ConnectedWorkflowsTable,
|
|
3185
3186
|
{
|
|
3186
3187
|
groupBy,
|
|
3187
3188
|
onOpenTemplate: (id) => openBuilder({ kind: "template", id }),
|
|
@@ -3212,7 +3213,7 @@ function ConnectedWorkflowsPage({
|
|
|
3212
3213
|
}
|
|
3213
3214
|
},
|
|
3214
3215
|
content: hostTab ? hostTab.content : runsFor ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3215
|
-
|
|
3216
|
+
chunkJSHBC47B_cjs.ConnectedWorkflowHistory,
|
|
3216
3217
|
{
|
|
3217
3218
|
inline: true,
|
|
3218
3219
|
hideHeader: true,
|
|
@@ -3237,7 +3238,7 @@ function ConnectedWorkflowsPage({
|
|
|
3237
3238
|
) : void 0,
|
|
3238
3239
|
automationsOnly: true,
|
|
3239
3240
|
gridId: "automations-grid-v1",
|
|
3240
|
-
describeTrigger: (workflow) => workflow.on_demand ? l.manualTrigger :
|
|
3241
|
+
describeTrigger: (workflow) => workflow.on_demand ? l.manualTrigger : chunkZXW6WFZG_cjs.describeTrigger(workflow),
|
|
3241
3242
|
formatDate: ui.formatFriendlyDate,
|
|
3242
3243
|
renderPerson,
|
|
3243
3244
|
onViewRuns: showHistory,
|
|
@@ -3276,7 +3277,7 @@ function ConnectedWorkflowsPage({
|
|
|
3276
3277
|
}
|
|
3277
3278
|
),
|
|
3278
3279
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3279
|
-
|
|
3280
|
+
chunkJSHBC47B_cjs.ConnectedTaskComposer,
|
|
3280
3281
|
{
|
|
3281
3282
|
kind: "workflow",
|
|
3282
3283
|
saveOnly: true,
|