@walkeros/explorer 4.8.0-next-1791441510508 → 4.8.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/dist/index.d.cts CHANGED
@@ -1,9 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { Destination, WalkerOS, Flow, Elb } from '@walkeros/core';
3
- import React, { ReactNode } from 'react';
2
+ import { Destination, WalkerOS, Flow, Collector } from '@walkeros/core';
3
+ import React, { ReactNode, AriaAttributes, ReactElement, ButtonHTMLAttributes } from 'react';
4
4
  import * as monaco_editor from 'monaco-editor';
5
5
  import { editor } from 'monaco-editor';
6
6
  import { RJSFSchema } from '@rjsf/utils';
7
+ import { SourceBrowser } from '@walkeros/web-source-browser';
7
8
  import { Monaco } from '@monaco-editor/react';
8
9
  export { Monaco } from '@monaco-editor/react';
9
10
  export { Icon } from '@iconify/react';
@@ -18,7 +19,6 @@ interface PromotionPlaygroundProps {
18
19
  initialCss?: string;
19
20
  initialJs?: string;
20
21
  initialMapping?: string;
21
- labelCode?: string;
22
22
  labelPreview?: string;
23
23
  labelEvents?: string;
24
24
  labelMapping?: string;
@@ -28,19 +28,33 @@ interface PromotionPlaygroundProps {
28
28
  /**
29
29
  * PromotionPlayground - Full walkerOS demonstration with live code editing
30
30
  *
31
- * Shows the complete chain:
32
- * 1. Code Editor - Edit HTML/CSS/JS with walkerOS data attributes
33
- * 2. Preview - Live rendered output that captures real events
34
- * 3. Events - Real events captured from preview interactions
35
- * 4. Mapping - Apply transformations and see destination output
36
- * 5. Result - Final destination function calls
37
- *
38
- * Uses a single unified collector flow:
39
- * - PromotionPlayground owns the collector with destinations
40
- * - Preview initializes browser source using parent's elb
41
- * - Events flow through one collector to all destinations
31
+ * Shows the complete chain, one box each:
32
+ * 1. Preview - the live page, with HTML/CSS/JS tabs to edit it; captures real events
33
+ * 2. Events - the events the preview sent
34
+ * 3. Mapping - editable rules for the destination
35
+ * 4. Result - the destination call each event becomes
36
+ *
37
+ * One collector runs the flow: Preview binds a browser source to it, and its
38
+ * destinations fill the Events and Result boxes. Whatever fails says so in
39
+ * the box it concerns.
40
+ */
41
+ declare function PromotionPlayground({ initialHtml, initialCss, initialJs, initialMapping, labelPreview, labelEvents, labelMapping, labelResult, destination: destinationProp, }: PromotionPlaygroundProps): react_jsx_runtime.JSX.Element;
42
+
43
+ interface PlaygroundProps {
44
+ eyebrow?: ReactNode;
45
+ title?: ReactNode;
46
+ lead?: ReactNode;
47
+ }
48
+ /**
49
+ * The walkerOS playground: a tagged component, the event it sends, the
50
+ * mapping and the vendor call it becomes, live.
51
+ *
52
+ * One real flow runs the chain. `startFlow` starts a collector with the
53
+ * browser source scoped to the preview's shadow root and the gtag destination
54
+ * with the editor's mapping. The destination's `window` is a stub that hands
55
+ * each gtag call to the Result panel instead of sending it to GA4.
42
56
  */
43
- declare function PromotionPlayground({ initialHtml, initialCss, initialJs, initialMapping, labelCode, labelPreview, labelEvents, labelMapping, labelResult, destination: destinationProp, }: PromotionPlaygroundProps): react_jsx_runtime.JSX.Element;
57
+ declare function Playground({ eyebrow, title, lead, }: PlaygroundProps): react_jsx_runtime.JSX.Element;
44
58
 
45
59
  interface LiveCodeProps {
46
60
  input: unknown;
@@ -52,6 +66,7 @@ interface LiveCodeProps {
52
66
  labelInput?: string;
53
67
  labelConfig?: string;
54
68
  labelOutput?: string;
69
+ /** Plain words in the empty Result box, such as why a run returns nothing. */
55
70
  emptyText?: string;
56
71
  disableInput?: boolean;
57
72
  disableConfig?: boolean;
@@ -61,7 +76,7 @@ interface LiveCodeProps {
61
76
  format?: boolean;
62
77
  rowHeight?: 'auto' | 'equal' | 'synced' | number;
63
78
  /** Language for the Result panel. Defaults to json (the typical output
64
- * shape). Set to `javascript` when emptyText includes `//` comments. */
79
+ * shape). */
65
80
  outputLanguage?: string;
66
81
  /** Language for the Config panel. Defaults to `json`. Override when the
67
82
  * Config panel content is not JSON. */
@@ -291,6 +306,12 @@ interface CodeBoxProps extends Omit<CodeProps, 'code'> {
291
306
  errors: number;
292
307
  warnings: number;
293
308
  }) => void;
309
+ /** Plain words shown over the editor while `code` is empty, such as what fills it. */
310
+ placeholder?: string;
311
+ /** What failed for this box, shown above the editor with an icon and the word Error. */
312
+ error?: string;
313
+ /** `status` for input validation the reader is typing through; `alert` (default) otherwise. */
314
+ errorRole?: 'alert' | 'status';
294
315
  footer?: React.ReactNode;
295
316
  height?: string | number;
296
317
  style?: React.CSSProperties;
@@ -335,7 +356,7 @@ interface CodeBoxProps extends Omit<CodeProps, 'code'> {
335
356
  * showFormat
336
357
  * />
337
358
  */
338
- declare function CodeBox({ code, language, onChange, disabled, autoHeight, label, header, showHeader, tabs, activeTab: controlledActiveTab, onTabChange, defaultTab, showTrafficLights, showCopy, showFormat, showSettings, onValidationIssues, footer, height, style, className, ...codeProps }: CodeBoxProps): react_jsx_runtime.JSX.Element;
359
+ declare function CodeBox({ code, language, onChange, disabled, autoHeight, label, header, showHeader, tabs, activeTab: controlledActiveTab, onTabChange, defaultTab, showTrafficLights, showCopy, showFormat, showSettings, onValidationIssues, placeholder, error, errorRole, footer, height, style, className, ...codeProps }: CodeBoxProps): react_jsx_runtime.JSX.Element;
339
360
 
340
361
  interface CodeDiffBoxProps {
341
362
  original: string;
@@ -553,7 +574,16 @@ interface PreviewProps {
553
574
  html?: string;
554
575
  css?: string;
555
576
  js?: string;
556
- elb?: Elb.Fn;
577
+ /**
578
+ * The collector that captures the preview's events. Preview binds a browser
579
+ * source to its document through the collector's own source wiring, so
580
+ * every click and load event runs the collector's pipeline. Without it the
581
+ * preview only renders. The source is the preview's own, not one of the
582
+ * collector's `sources`: `walker consent` and `walker user` do not reach
583
+ * it, and the collector's status does not list it.
584
+ */
585
+ collector?: Collector.Instance;
586
+ /** The box's name; with `editable`, the name of its first tab. */
557
587
  label?: string;
558
588
  /**
559
589
  * Opt-in editor tabs. When true, the header shows a `tabs` ButtonGroup to
@@ -574,8 +604,8 @@ interface PreviewProps {
574
604
  * Preview - HTML preview wrapped in a Box with highlight buttons
575
605
  *
576
606
  * Renders HTML in an isolated iframe with highlight buttons footer.
577
- * When elb is provided, initializes walkerOS browser source in iframe
578
- * that pushes events to the parent collector.
607
+ * With a collector, a walkerOS browser source captures the iframe's events
608
+ * into it; a source that fails to start says so in the box.
579
609
  *
580
610
  * Load semantics mirror a real browser: `load` triggers (and pageview) fire
581
611
  * once on the initial load and again only when the user clicks Reload. Editing
@@ -586,10 +616,62 @@ interface PreviewProps {
586
616
  * // Read-only preview
587
617
  * <Preview html={html} css={css} label="Preview" />
588
618
  *
589
- * // Interactive preview with event capture (elb from parent collector)
590
- * <Preview html={html} css={css} elb={elb} label="Preview" />
619
+ * // Interactive preview that captures events into a collector
620
+ * <Preview html={html} css={css} collector={collector} label="Preview" />
621
+ */
622
+ declare function Preview({ html, css, js, collector, label, editable, initialTab, onHtmlChange, onCssChange, onJsChange, lineNumbers, wordWrap, }: PreviewProps): react_jsx_runtime.JSX.Element;
623
+
624
+ interface ViewSourceProps extends AriaAttributes {
625
+ /** Exactly one element: the component whose HTML is shown. */
626
+ children: ReactElement;
627
+ /**
628
+ * The page's elb (the browser source's push). After an edit is applied, and
629
+ * after Reset brings the original back, ViewSource calls
630
+ * `elb('walker init', element)` so the new nodes get their triggers.
631
+ */
632
+ elb?: SourceBrowser.Push;
633
+ /**
634
+ * Lets the wrapped element fill a stretched grid or flex cell as it does
635
+ * unwrapped (cards in a grid row). The root and its content become
636
+ * one-column grids: an auto-height element fills the cell, its margins,
637
+ * own self-alignment and explicit height still apply, and its vertical
638
+ * margins stay inside the wrapper. Leave it off for an element centered
639
+ * with auto margins (a section with `mx-auto`), which a grid shrinks to
640
+ * fit.
641
+ */
642
+ stretch?: boolean;
643
+ className?: string;
644
+ id?: string;
645
+ [dataAttribute: `data-${string}`]: string | undefined;
646
+ }
647
+ /**
648
+ * ViewSource - shows a component's live HTML in place and lets you edit it.
649
+ *
650
+ * Wraps exactly one element and adds no frame of its own. A toggle at the
651
+ * top right switches between Visual and Code. Code shows the element's live
652
+ * HTML, formatted and editable, on a dark code surface; the code covers the
653
+ * element's visible box (its border box when it paints a background or
654
+ * border, else its content box inside the padding), and the toggle sits at
655
+ * that box's top right. Escape leaves the editor for the toggle.
656
+ * Back in Visual, a changed edit replaces the element as plain HTML (React
657
+ * handlers inside it are inactive) and `elb('walker init', element)`
658
+ * registers its triggers. Reset, an icon beside the toggle, mounts the
659
+ * original children again and registers theirs the same way.
660
+ *
661
+ * ViewSources nest: an outer snapshot shows the inner wrapped elements
662
+ * without their wrappers, and only the innermost hovered toolbar shows. An
663
+ * applied outer edit is plain HTML, so it has no inner wrappers until Reset.
664
+ *
665
+ * Wrap the outermost tagged element of a section, never an element inside one
666
+ * with a click action: a click on the toolbar bubbles to the wrapper's
667
+ * ancestors.
668
+ *
669
+ * @example
670
+ * <ViewSource elb={elb}>
671
+ * <PromotionHero />
672
+ * </ViewSource>
591
673
  */
592
- declare function Preview({ html, css, js, elb, label, editable, initialTab, onHtmlChange, onCssChange, onJsChange, lineNumbers, wordWrap, }: PreviewProps): react_jsx_runtime.JSX.Element;
674
+ declare function ViewSource({ children, elb, stretch, className, ...rest }: ViewSourceProps): react_jsx_runtime.JSX.Element;
593
675
 
594
676
  interface CodeDiffSummary {
595
677
  /** Count of hunks that exist only in modified (pure additions). */
@@ -659,8 +741,15 @@ interface BoxProps {
659
741
  showTrafficLights?: boolean;
660
742
  /** Pins the box to one theme, whatever the page theme (a dark island). */
661
743
  theme?: Theme;
744
+ /** What failed in this box, shown above its content with an icon and the word Error. */
745
+ error?: string;
746
+ /**
747
+ * How the error is announced: `alert` (default) interrupts, for a failure;
748
+ * `status` waits, for input validation that changes as the reader types.
749
+ */
750
+ errorRole?: 'alert' | 'status';
662
751
  }
663
- declare function Box({ header, headerActions, footer, children, className, style, height, minHeight, maxHeight, tiny, resizable, showHeader, tabs, activeTab: controlledActiveTab, onTabChange, defaultTab, showTrafficLights, theme, }: BoxProps): react_jsx_runtime.JSX.Element;
752
+ declare function Box({ header, headerActions, footer, children, className, style, height, minHeight, maxHeight, tiny, resizable, showHeader, tabs, activeTab: controlledActiveTab, onTabChange, defaultTab, showTrafficLights, theme, error, errorRole, }: BoxProps): react_jsx_runtime.JSX.Element;
664
753
 
665
754
  interface GridProps {
666
755
  children: React.ReactNode;
@@ -670,6 +759,13 @@ interface GridProps {
670
759
  */
671
760
  columns?: number;
672
761
  minBoxWidth?: number | string;
762
+ /**
763
+ * Fixed box width in px: one row at every container width, scrolled
764
+ * sideways and snapping to each box. A box never grows past the row, so a
765
+ * narrow container still shows the edge of the next one. Overrides
766
+ * `columns` and `minBoxWidth`.
767
+ */
768
+ boxWidth?: number;
673
769
  gap?: number | string;
674
770
  rowHeight?: 'auto' | 'equal' | 'synced' | number;
675
771
  maxRowHeight?: number | string | 'none';
@@ -682,7 +778,8 @@ interface GridProps {
682
778
  * Provides consistent grid layout for box components with horizontal
683
779
  * scrolling when content exceeds available space. Boxes keep a minimum width.
684
780
  * By default all boxes share one row; `columns` sets the boxes per row and
685
- * wraps the rest. Narrow containers stack the boxes.
781
+ * wraps the rest. Narrow containers stack the boxes. `boxWidth` keeps one
782
+ * row of fixed-width boxes at every width instead.
686
783
  *
687
784
  * @example
688
785
  * // 5 boxes with default 350px minimum width
@@ -703,6 +800,15 @@ interface GridProps {
703
800
  * </Grid>
704
801
  *
705
802
  * @example
803
+ * // One row of 350px boxes, scrolled sideways on any screen
804
+ * <Grid boxWidth={350}>
805
+ * <Preview ... />
806
+ * <CodeBox ... />
807
+ * <CodeBox ... />
808
+ * <CodeBox ... />
809
+ * </Grid>
810
+ *
811
+ * @example
706
812
  * // Custom row height
707
813
  * <Grid columns={2} rowHeight={300}>
708
814
  * <CodeBox ... />
@@ -729,7 +835,7 @@ interface GridProps {
729
835
  * <CodeBox ... />
730
836
  * </Grid>
731
837
  */
732
- declare function Grid({ children, columns, minBoxWidth, gap, rowHeight, maxRowHeight, showScrollButtons, className, }: GridProps): react_jsx_runtime.JSX.Element;
838
+ declare function Grid({ children, columns, minBoxWidth, boxWidth, gap, rowHeight, maxRowHeight, showScrollButtons, className, }: GridProps): react_jsx_runtime.JSX.Element;
733
839
 
734
840
  interface HeaderProps {
735
841
  label: string;
@@ -774,6 +880,33 @@ interface ButtonGroupProps {
774
880
  */
775
881
  declare function ButtonGroup({ buttons, onButtonClick, className, variant, }: ButtonGroupProps): react_jsx_runtime.JSX.Element;
776
882
 
883
+ interface ToggleButtonOption {
884
+ label: string;
885
+ value: string;
886
+ }
887
+ interface ToggleButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange' | 'onClick' | 'type' | 'value'> {
888
+ options: ToggleButtonOption[];
889
+ value: string;
890
+ onChange: (value: string) => void;
891
+ /**
892
+ * Which label the button shows: the option a click switches to (`next`,
893
+ * the default, so the label names the action) or the selected one
894
+ * (`current`, so the label names the state).
895
+ */
896
+ shows?: 'next' | 'current';
897
+ }
898
+ /**
899
+ * ToggleButton - one button that switches between options. A click selects
900
+ * the next option after `value` (after the last, the first). By default it
901
+ * shows that next option, so its label names the action; with
902
+ * `shows="current"` it shows the selected one.
903
+ *
904
+ * Every label sits in the same grid cell and only one is visible, so the
905
+ * button always takes the longest label's width and never changes size. An
906
+ * `aria-label` should contain the shown word ("Show code" for "Code").
907
+ */
908
+ declare function ToggleButton({ options, value, onChange, shows, className, ...rest }: ToggleButtonProps): react_jsx_runtime.JSX.Element;
909
+
777
910
  /**
778
911
  * Detect `@monaco-editor/loader`'s cancelation rejection.
779
912
  *
@@ -1072,4 +1205,4 @@ declare function validateWalkerOSReferences(text: string, context: Partial<Intel
1072
1205
  */
1073
1206
  declare function extractFlowIntelliSenseContext(json: string): Partial<IntelliSenseContext>;
1074
1207
 
1075
- export { ArchitectureFlow, type ArchitectureFlowProps, Box, type BoxProps, type BoxTab, BrowserBox, type BrowserBoxProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Code, CodeBox, type CodeBoxProps, type CodeBoxTab, CodeDiff, CodeDiffBox, type CodeDiffBoxProps, type CodeDiffProps, type CodeDiffSummary, type CodeProps, CodeSnippet, type CodeSnippetProps, CodeStatic, type CodeStaticProps, CodeView, type CodeViewProps, type CodeViewTab, type CompletionEntry, ELB_THEME_DARK, type FlowColumn, type FlowItem, FlowMap, type FlowMapProps, type FlowSection, type FlowStageConfig, Grid, type GridProps, Header, type HeaderProps, type IntelliSenseContext, LiveCode, type LiveCodeProps, type LoadPackageTypesOptions, type MonacoSchemaExtension, type PackageInfo, Preview, type PreviewProps, PromotionPlayground, type PromotionPlaygroundProps, PropertyTable, type PropertyTableProps, REFERENCE_PATTERNS, type RefKind, StepExample, type StepExampleProps, allowedRefKinds, applyWalkerOSDecorations, disposeWalkerOSProviders, enrichFlowConfigSchema, enrichSchema, extractFlowIntelliSenseContext, findWalkerOSReferences, generateModelPath, getContractCompletions, getEnrichedContractSchema, getEnvCompletions, getFlowCompletions, getJsonPathAtOffset, getMappingPathCompletions, getSecretCompletions, getStoreCompletions, getVariableCompletions, getVariablesSchema, initializeMonacoTypes, isMonacoCancellation, loadPackageTypes, loadTypeLibraryFromURL, registerJsonSchema, registerTheme, registerWalkerOSDecorationStyles, registerWalkerOSProviders, registerWalkerOSTypes, removeIntelliSenseContext, resolveTypesUrl, setIntelliSenseContext, setPackageTypesBaseUrl, unregisterJsonSchema, validateWalkerOSReferences };
1208
+ export { ArchitectureFlow, type ArchitectureFlowProps, Box, type BoxProps, type BoxTab, BrowserBox, type BrowserBoxProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Code, CodeBox, type CodeBoxProps, type CodeBoxTab, CodeDiff, CodeDiffBox, type CodeDiffBoxProps, type CodeDiffProps, type CodeDiffSummary, type CodeProps, CodeSnippet, type CodeSnippetProps, CodeStatic, type CodeStaticProps, CodeView, type CodeViewProps, type CodeViewTab, type CompletionEntry, ELB_THEME_DARK, type FlowColumn, type FlowItem, FlowMap, type FlowMapProps, type FlowSection, type FlowStageConfig, Grid, type GridProps, Header, type HeaderProps, type IntelliSenseContext, LiveCode, type LiveCodeProps, type LoadPackageTypesOptions, type MonacoSchemaExtension, type PackageInfo, Playground, type PlaygroundProps, Preview, type PreviewProps, PromotionPlayground, type PromotionPlaygroundProps, PropertyTable, type PropertyTableProps, REFERENCE_PATTERNS, type RefKind, StepExample, type StepExampleProps, ToggleButton, type ToggleButtonProps, ViewSource, type ViewSourceProps, allowedRefKinds, applyWalkerOSDecorations, disposeWalkerOSProviders, enrichFlowConfigSchema, enrichSchema, extractFlowIntelliSenseContext, findWalkerOSReferences, generateModelPath, getContractCompletions, getEnrichedContractSchema, getEnvCompletions, getFlowCompletions, getJsonPathAtOffset, getMappingPathCompletions, getSecretCompletions, getStoreCompletions, getVariableCompletions, getVariablesSchema, initializeMonacoTypes, isMonacoCancellation, loadPackageTypes, loadTypeLibraryFromURL, registerJsonSchema, registerTheme, registerWalkerOSDecorationStyles, registerWalkerOSProviders, registerWalkerOSTypes, removeIntelliSenseContext, resolveTypesUrl, setIntelliSenseContext, setPackageTypesBaseUrl, unregisterJsonSchema, validateWalkerOSReferences };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { Destination, WalkerOS, Flow, Elb } from '@walkeros/core';
3
- import React, { ReactNode } from 'react';
2
+ import { Destination, WalkerOS, Flow, Collector } from '@walkeros/core';
3
+ import React, { ReactNode, AriaAttributes, ReactElement, ButtonHTMLAttributes } from 'react';
4
4
  import * as monaco_editor from 'monaco-editor';
5
5
  import { editor } from 'monaco-editor';
6
6
  import { RJSFSchema } from '@rjsf/utils';
7
+ import { SourceBrowser } from '@walkeros/web-source-browser';
7
8
  import { Monaco } from '@monaco-editor/react';
8
9
  export { Monaco } from '@monaco-editor/react';
9
10
  export { Icon } from '@iconify/react';
@@ -18,7 +19,6 @@ interface PromotionPlaygroundProps {
18
19
  initialCss?: string;
19
20
  initialJs?: string;
20
21
  initialMapping?: string;
21
- labelCode?: string;
22
22
  labelPreview?: string;
23
23
  labelEvents?: string;
24
24
  labelMapping?: string;
@@ -28,19 +28,33 @@ interface PromotionPlaygroundProps {
28
28
  /**
29
29
  * PromotionPlayground - Full walkerOS demonstration with live code editing
30
30
  *
31
- * Shows the complete chain:
32
- * 1. Code Editor - Edit HTML/CSS/JS with walkerOS data attributes
33
- * 2. Preview - Live rendered output that captures real events
34
- * 3. Events - Real events captured from preview interactions
35
- * 4. Mapping - Apply transformations and see destination output
36
- * 5. Result - Final destination function calls
37
- *
38
- * Uses a single unified collector flow:
39
- * - PromotionPlayground owns the collector with destinations
40
- * - Preview initializes browser source using parent's elb
41
- * - Events flow through one collector to all destinations
31
+ * Shows the complete chain, one box each:
32
+ * 1. Preview - the live page, with HTML/CSS/JS tabs to edit it; captures real events
33
+ * 2. Events - the events the preview sent
34
+ * 3. Mapping - editable rules for the destination
35
+ * 4. Result - the destination call each event becomes
36
+ *
37
+ * One collector runs the flow: Preview binds a browser source to it, and its
38
+ * destinations fill the Events and Result boxes. Whatever fails says so in
39
+ * the box it concerns.
40
+ */
41
+ declare function PromotionPlayground({ initialHtml, initialCss, initialJs, initialMapping, labelPreview, labelEvents, labelMapping, labelResult, destination: destinationProp, }: PromotionPlaygroundProps): react_jsx_runtime.JSX.Element;
42
+
43
+ interface PlaygroundProps {
44
+ eyebrow?: ReactNode;
45
+ title?: ReactNode;
46
+ lead?: ReactNode;
47
+ }
48
+ /**
49
+ * The walkerOS playground: a tagged component, the event it sends, the
50
+ * mapping and the vendor call it becomes, live.
51
+ *
52
+ * One real flow runs the chain. `startFlow` starts a collector with the
53
+ * browser source scoped to the preview's shadow root and the gtag destination
54
+ * with the editor's mapping. The destination's `window` is a stub that hands
55
+ * each gtag call to the Result panel instead of sending it to GA4.
42
56
  */
43
- declare function PromotionPlayground({ initialHtml, initialCss, initialJs, initialMapping, labelCode, labelPreview, labelEvents, labelMapping, labelResult, destination: destinationProp, }: PromotionPlaygroundProps): react_jsx_runtime.JSX.Element;
57
+ declare function Playground({ eyebrow, title, lead, }: PlaygroundProps): react_jsx_runtime.JSX.Element;
44
58
 
45
59
  interface LiveCodeProps {
46
60
  input: unknown;
@@ -52,6 +66,7 @@ interface LiveCodeProps {
52
66
  labelInput?: string;
53
67
  labelConfig?: string;
54
68
  labelOutput?: string;
69
+ /** Plain words in the empty Result box, such as why a run returns nothing. */
55
70
  emptyText?: string;
56
71
  disableInput?: boolean;
57
72
  disableConfig?: boolean;
@@ -61,7 +76,7 @@ interface LiveCodeProps {
61
76
  format?: boolean;
62
77
  rowHeight?: 'auto' | 'equal' | 'synced' | number;
63
78
  /** Language for the Result panel. Defaults to json (the typical output
64
- * shape). Set to `javascript` when emptyText includes `//` comments. */
79
+ * shape). */
65
80
  outputLanguage?: string;
66
81
  /** Language for the Config panel. Defaults to `json`. Override when the
67
82
  * Config panel content is not JSON. */
@@ -291,6 +306,12 @@ interface CodeBoxProps extends Omit<CodeProps, 'code'> {
291
306
  errors: number;
292
307
  warnings: number;
293
308
  }) => void;
309
+ /** Plain words shown over the editor while `code` is empty, such as what fills it. */
310
+ placeholder?: string;
311
+ /** What failed for this box, shown above the editor with an icon and the word Error. */
312
+ error?: string;
313
+ /** `status` for input validation the reader is typing through; `alert` (default) otherwise. */
314
+ errorRole?: 'alert' | 'status';
294
315
  footer?: React.ReactNode;
295
316
  height?: string | number;
296
317
  style?: React.CSSProperties;
@@ -335,7 +356,7 @@ interface CodeBoxProps extends Omit<CodeProps, 'code'> {
335
356
  * showFormat
336
357
  * />
337
358
  */
338
- declare function CodeBox({ code, language, onChange, disabled, autoHeight, label, header, showHeader, tabs, activeTab: controlledActiveTab, onTabChange, defaultTab, showTrafficLights, showCopy, showFormat, showSettings, onValidationIssues, footer, height, style, className, ...codeProps }: CodeBoxProps): react_jsx_runtime.JSX.Element;
359
+ declare function CodeBox({ code, language, onChange, disabled, autoHeight, label, header, showHeader, tabs, activeTab: controlledActiveTab, onTabChange, defaultTab, showTrafficLights, showCopy, showFormat, showSettings, onValidationIssues, placeholder, error, errorRole, footer, height, style, className, ...codeProps }: CodeBoxProps): react_jsx_runtime.JSX.Element;
339
360
 
340
361
  interface CodeDiffBoxProps {
341
362
  original: string;
@@ -553,7 +574,16 @@ interface PreviewProps {
553
574
  html?: string;
554
575
  css?: string;
555
576
  js?: string;
556
- elb?: Elb.Fn;
577
+ /**
578
+ * The collector that captures the preview's events. Preview binds a browser
579
+ * source to its document through the collector's own source wiring, so
580
+ * every click and load event runs the collector's pipeline. Without it the
581
+ * preview only renders. The source is the preview's own, not one of the
582
+ * collector's `sources`: `walker consent` and `walker user` do not reach
583
+ * it, and the collector's status does not list it.
584
+ */
585
+ collector?: Collector.Instance;
586
+ /** The box's name; with `editable`, the name of its first tab. */
557
587
  label?: string;
558
588
  /**
559
589
  * Opt-in editor tabs. When true, the header shows a `tabs` ButtonGroup to
@@ -574,8 +604,8 @@ interface PreviewProps {
574
604
  * Preview - HTML preview wrapped in a Box with highlight buttons
575
605
  *
576
606
  * Renders HTML in an isolated iframe with highlight buttons footer.
577
- * When elb is provided, initializes walkerOS browser source in iframe
578
- * that pushes events to the parent collector.
607
+ * With a collector, a walkerOS browser source captures the iframe's events
608
+ * into it; a source that fails to start says so in the box.
579
609
  *
580
610
  * Load semantics mirror a real browser: `load` triggers (and pageview) fire
581
611
  * once on the initial load and again only when the user clicks Reload. Editing
@@ -586,10 +616,62 @@ interface PreviewProps {
586
616
  * // Read-only preview
587
617
  * <Preview html={html} css={css} label="Preview" />
588
618
  *
589
- * // Interactive preview with event capture (elb from parent collector)
590
- * <Preview html={html} css={css} elb={elb} label="Preview" />
619
+ * // Interactive preview that captures events into a collector
620
+ * <Preview html={html} css={css} collector={collector} label="Preview" />
621
+ */
622
+ declare function Preview({ html, css, js, collector, label, editable, initialTab, onHtmlChange, onCssChange, onJsChange, lineNumbers, wordWrap, }: PreviewProps): react_jsx_runtime.JSX.Element;
623
+
624
+ interface ViewSourceProps extends AriaAttributes {
625
+ /** Exactly one element: the component whose HTML is shown. */
626
+ children: ReactElement;
627
+ /**
628
+ * The page's elb (the browser source's push). After an edit is applied, and
629
+ * after Reset brings the original back, ViewSource calls
630
+ * `elb('walker init', element)` so the new nodes get their triggers.
631
+ */
632
+ elb?: SourceBrowser.Push;
633
+ /**
634
+ * Lets the wrapped element fill a stretched grid or flex cell as it does
635
+ * unwrapped (cards in a grid row). The root and its content become
636
+ * one-column grids: an auto-height element fills the cell, its margins,
637
+ * own self-alignment and explicit height still apply, and its vertical
638
+ * margins stay inside the wrapper. Leave it off for an element centered
639
+ * with auto margins (a section with `mx-auto`), which a grid shrinks to
640
+ * fit.
641
+ */
642
+ stretch?: boolean;
643
+ className?: string;
644
+ id?: string;
645
+ [dataAttribute: `data-${string}`]: string | undefined;
646
+ }
647
+ /**
648
+ * ViewSource - shows a component's live HTML in place and lets you edit it.
649
+ *
650
+ * Wraps exactly one element and adds no frame of its own. A toggle at the
651
+ * top right switches between Visual and Code. Code shows the element's live
652
+ * HTML, formatted and editable, on a dark code surface; the code covers the
653
+ * element's visible box (its border box when it paints a background or
654
+ * border, else its content box inside the padding), and the toggle sits at
655
+ * that box's top right. Escape leaves the editor for the toggle.
656
+ * Back in Visual, a changed edit replaces the element as plain HTML (React
657
+ * handlers inside it are inactive) and `elb('walker init', element)`
658
+ * registers its triggers. Reset, an icon beside the toggle, mounts the
659
+ * original children again and registers theirs the same way.
660
+ *
661
+ * ViewSources nest: an outer snapshot shows the inner wrapped elements
662
+ * without their wrappers, and only the innermost hovered toolbar shows. An
663
+ * applied outer edit is plain HTML, so it has no inner wrappers until Reset.
664
+ *
665
+ * Wrap the outermost tagged element of a section, never an element inside one
666
+ * with a click action: a click on the toolbar bubbles to the wrapper's
667
+ * ancestors.
668
+ *
669
+ * @example
670
+ * <ViewSource elb={elb}>
671
+ * <PromotionHero />
672
+ * </ViewSource>
591
673
  */
592
- declare function Preview({ html, css, js, elb, label, editable, initialTab, onHtmlChange, onCssChange, onJsChange, lineNumbers, wordWrap, }: PreviewProps): react_jsx_runtime.JSX.Element;
674
+ declare function ViewSource({ children, elb, stretch, className, ...rest }: ViewSourceProps): react_jsx_runtime.JSX.Element;
593
675
 
594
676
  interface CodeDiffSummary {
595
677
  /** Count of hunks that exist only in modified (pure additions). */
@@ -659,8 +741,15 @@ interface BoxProps {
659
741
  showTrafficLights?: boolean;
660
742
  /** Pins the box to one theme, whatever the page theme (a dark island). */
661
743
  theme?: Theme;
744
+ /** What failed in this box, shown above its content with an icon and the word Error. */
745
+ error?: string;
746
+ /**
747
+ * How the error is announced: `alert` (default) interrupts, for a failure;
748
+ * `status` waits, for input validation that changes as the reader types.
749
+ */
750
+ errorRole?: 'alert' | 'status';
662
751
  }
663
- declare function Box({ header, headerActions, footer, children, className, style, height, minHeight, maxHeight, tiny, resizable, showHeader, tabs, activeTab: controlledActiveTab, onTabChange, defaultTab, showTrafficLights, theme, }: BoxProps): react_jsx_runtime.JSX.Element;
752
+ declare function Box({ header, headerActions, footer, children, className, style, height, minHeight, maxHeight, tiny, resizable, showHeader, tabs, activeTab: controlledActiveTab, onTabChange, defaultTab, showTrafficLights, theme, error, errorRole, }: BoxProps): react_jsx_runtime.JSX.Element;
664
753
 
665
754
  interface GridProps {
666
755
  children: React.ReactNode;
@@ -670,6 +759,13 @@ interface GridProps {
670
759
  */
671
760
  columns?: number;
672
761
  minBoxWidth?: number | string;
762
+ /**
763
+ * Fixed box width in px: one row at every container width, scrolled
764
+ * sideways and snapping to each box. A box never grows past the row, so a
765
+ * narrow container still shows the edge of the next one. Overrides
766
+ * `columns` and `minBoxWidth`.
767
+ */
768
+ boxWidth?: number;
673
769
  gap?: number | string;
674
770
  rowHeight?: 'auto' | 'equal' | 'synced' | number;
675
771
  maxRowHeight?: number | string | 'none';
@@ -682,7 +778,8 @@ interface GridProps {
682
778
  * Provides consistent grid layout for box components with horizontal
683
779
  * scrolling when content exceeds available space. Boxes keep a minimum width.
684
780
  * By default all boxes share one row; `columns` sets the boxes per row and
685
- * wraps the rest. Narrow containers stack the boxes.
781
+ * wraps the rest. Narrow containers stack the boxes. `boxWidth` keeps one
782
+ * row of fixed-width boxes at every width instead.
686
783
  *
687
784
  * @example
688
785
  * // 5 boxes with default 350px minimum width
@@ -703,6 +800,15 @@ interface GridProps {
703
800
  * </Grid>
704
801
  *
705
802
  * @example
803
+ * // One row of 350px boxes, scrolled sideways on any screen
804
+ * <Grid boxWidth={350}>
805
+ * <Preview ... />
806
+ * <CodeBox ... />
807
+ * <CodeBox ... />
808
+ * <CodeBox ... />
809
+ * </Grid>
810
+ *
811
+ * @example
706
812
  * // Custom row height
707
813
  * <Grid columns={2} rowHeight={300}>
708
814
  * <CodeBox ... />
@@ -729,7 +835,7 @@ interface GridProps {
729
835
  * <CodeBox ... />
730
836
  * </Grid>
731
837
  */
732
- declare function Grid({ children, columns, minBoxWidth, gap, rowHeight, maxRowHeight, showScrollButtons, className, }: GridProps): react_jsx_runtime.JSX.Element;
838
+ declare function Grid({ children, columns, minBoxWidth, boxWidth, gap, rowHeight, maxRowHeight, showScrollButtons, className, }: GridProps): react_jsx_runtime.JSX.Element;
733
839
 
734
840
  interface HeaderProps {
735
841
  label: string;
@@ -774,6 +880,33 @@ interface ButtonGroupProps {
774
880
  */
775
881
  declare function ButtonGroup({ buttons, onButtonClick, className, variant, }: ButtonGroupProps): react_jsx_runtime.JSX.Element;
776
882
 
883
+ interface ToggleButtonOption {
884
+ label: string;
885
+ value: string;
886
+ }
887
+ interface ToggleButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange' | 'onClick' | 'type' | 'value'> {
888
+ options: ToggleButtonOption[];
889
+ value: string;
890
+ onChange: (value: string) => void;
891
+ /**
892
+ * Which label the button shows: the option a click switches to (`next`,
893
+ * the default, so the label names the action) or the selected one
894
+ * (`current`, so the label names the state).
895
+ */
896
+ shows?: 'next' | 'current';
897
+ }
898
+ /**
899
+ * ToggleButton - one button that switches between options. A click selects
900
+ * the next option after `value` (after the last, the first). By default it
901
+ * shows that next option, so its label names the action; with
902
+ * `shows="current"` it shows the selected one.
903
+ *
904
+ * Every label sits in the same grid cell and only one is visible, so the
905
+ * button always takes the longest label's width and never changes size. An
906
+ * `aria-label` should contain the shown word ("Show code" for "Code").
907
+ */
908
+ declare function ToggleButton({ options, value, onChange, shows, className, ...rest }: ToggleButtonProps): react_jsx_runtime.JSX.Element;
909
+
777
910
  /**
778
911
  * Detect `@monaco-editor/loader`'s cancelation rejection.
779
912
  *
@@ -1072,4 +1205,4 @@ declare function validateWalkerOSReferences(text: string, context: Partial<Intel
1072
1205
  */
1073
1206
  declare function extractFlowIntelliSenseContext(json: string): Partial<IntelliSenseContext>;
1074
1207
 
1075
- export { ArchitectureFlow, type ArchitectureFlowProps, Box, type BoxProps, type BoxTab, BrowserBox, type BrowserBoxProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Code, CodeBox, type CodeBoxProps, type CodeBoxTab, CodeDiff, CodeDiffBox, type CodeDiffBoxProps, type CodeDiffProps, type CodeDiffSummary, type CodeProps, CodeSnippet, type CodeSnippetProps, CodeStatic, type CodeStaticProps, CodeView, type CodeViewProps, type CodeViewTab, type CompletionEntry, ELB_THEME_DARK, type FlowColumn, type FlowItem, FlowMap, type FlowMapProps, type FlowSection, type FlowStageConfig, Grid, type GridProps, Header, type HeaderProps, type IntelliSenseContext, LiveCode, type LiveCodeProps, type LoadPackageTypesOptions, type MonacoSchemaExtension, type PackageInfo, Preview, type PreviewProps, PromotionPlayground, type PromotionPlaygroundProps, PropertyTable, type PropertyTableProps, REFERENCE_PATTERNS, type RefKind, StepExample, type StepExampleProps, allowedRefKinds, applyWalkerOSDecorations, disposeWalkerOSProviders, enrichFlowConfigSchema, enrichSchema, extractFlowIntelliSenseContext, findWalkerOSReferences, generateModelPath, getContractCompletions, getEnrichedContractSchema, getEnvCompletions, getFlowCompletions, getJsonPathAtOffset, getMappingPathCompletions, getSecretCompletions, getStoreCompletions, getVariableCompletions, getVariablesSchema, initializeMonacoTypes, isMonacoCancellation, loadPackageTypes, loadTypeLibraryFromURL, registerJsonSchema, registerTheme, registerWalkerOSDecorationStyles, registerWalkerOSProviders, registerWalkerOSTypes, removeIntelliSenseContext, resolveTypesUrl, setIntelliSenseContext, setPackageTypesBaseUrl, unregisterJsonSchema, validateWalkerOSReferences };
1208
+ export { ArchitectureFlow, type ArchitectureFlowProps, Box, type BoxProps, type BoxTab, BrowserBox, type BrowserBoxProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Code, CodeBox, type CodeBoxProps, type CodeBoxTab, CodeDiff, CodeDiffBox, type CodeDiffBoxProps, type CodeDiffProps, type CodeDiffSummary, type CodeProps, CodeSnippet, type CodeSnippetProps, CodeStatic, type CodeStaticProps, CodeView, type CodeViewProps, type CodeViewTab, type CompletionEntry, ELB_THEME_DARK, type FlowColumn, type FlowItem, FlowMap, type FlowMapProps, type FlowSection, type FlowStageConfig, Grid, type GridProps, Header, type HeaderProps, type IntelliSenseContext, LiveCode, type LiveCodeProps, type LoadPackageTypesOptions, type MonacoSchemaExtension, type PackageInfo, Playground, type PlaygroundProps, Preview, type PreviewProps, PromotionPlayground, type PromotionPlaygroundProps, PropertyTable, type PropertyTableProps, REFERENCE_PATTERNS, type RefKind, StepExample, type StepExampleProps, ToggleButton, type ToggleButtonProps, ViewSource, type ViewSourceProps, allowedRefKinds, applyWalkerOSDecorations, disposeWalkerOSProviders, enrichFlowConfigSchema, enrichSchema, extractFlowIntelliSenseContext, findWalkerOSReferences, generateModelPath, getContractCompletions, getEnrichedContractSchema, getEnvCompletions, getFlowCompletions, getJsonPathAtOffset, getMappingPathCompletions, getSecretCompletions, getStoreCompletions, getVariableCompletions, getVariablesSchema, initializeMonacoTypes, isMonacoCancellation, loadPackageTypes, loadTypeLibraryFromURL, registerJsonSchema, registerTheme, registerWalkerOSDecorationStyles, registerWalkerOSProviders, registerWalkerOSTypes, removeIntelliSenseContext, resolveTypesUrl, setIntelliSenseContext, setPackageTypesBaseUrl, unregisterJsonSchema, validateWalkerOSReferences };