@walkeros/explorer 0.0.8 → 0.3.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/LICENSE +42 -0
- package/README.md +646 -374
- package/dist/chunk-P5UDSGZL.mjs +18485 -0
- package/dist/chunk-P5UDSGZL.mjs.map +1 -0
- package/dist/index.d.cts +1248 -0
- package/dist/index.d.ts +1185 -180
- package/dist/index.js +31721 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +12983 -2300
- package/dist/index.mjs.map +1 -1
- package/dist/monaco-types-T3WXA7KH.mjs +34 -0
- package/dist/monaco-types-T3WXA7KH.mjs.map +1 -0
- package/dist/styles.css +4923 -0
- package/package.json +96 -55
- package/dist/examples/destination.html +0 -143
- package/dist/examples/index.html +0 -110
- package/dist/examples/livecode-js.html +0 -396
- package/dist/explorer.js +0 -2997
- package/dist/explorer.js.map +0 -1
- package/dist/index.cjs +0 -2528
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.mts +0 -243
- package/serve.js +0 -52
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,1248 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Destination, WalkerOS, Mapping } from '@walkeros/core';
|
|
3
|
+
import { RJSFSchema, UiSchema, WidgetProps, FieldProps } from '@rjsf/utils';
|
|
4
|
+
import * as monaco_editor from 'monaco-editor';
|
|
5
|
+
import { editor } from 'monaco-editor';
|
|
6
|
+
import React, { FC, PropsWithChildren } from 'react';
|
|
7
|
+
import { ClassValue } from 'clsx';
|
|
8
|
+
import { Monaco } from '@monaco-editor/react';
|
|
9
|
+
|
|
10
|
+
interface MappingDemoProps {
|
|
11
|
+
input?: string;
|
|
12
|
+
config?: string;
|
|
13
|
+
labelInput?: string;
|
|
14
|
+
labelConfig?: string;
|
|
15
|
+
labelOutput?: string;
|
|
16
|
+
fn?: (input: string, config: string) => Promise<string>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* MappingDemo - Interactive dual-editor component with Monaco Editor
|
|
20
|
+
*
|
|
21
|
+
* A generic component with two editable JSON editors and one output display.
|
|
22
|
+
* Requires a transformation function to process input+config into output.
|
|
23
|
+
*
|
|
24
|
+
* Props:
|
|
25
|
+
* - input: Initial JSON string for left editor (default: '{}')
|
|
26
|
+
* - config: Initial JSON string for middle editor (default: '{}')
|
|
27
|
+
* - labelInput: Label for input editor (default: "Input")
|
|
28
|
+
* - labelConfig: Label for config editor (default: "Config")
|
|
29
|
+
* - labelOutput: Label for output editor (default: "Output")
|
|
30
|
+
* - fn: Transformation function (input, config) => Promise<string> (required for output)
|
|
31
|
+
*
|
|
32
|
+
* Example:
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <MappingDemo
|
|
35
|
+
* input='{ "name": "example" }'
|
|
36
|
+
* config='{ "transform": "uppercase" }'
|
|
37
|
+
* labelInput="Data"
|
|
38
|
+
* labelConfig="Rules"
|
|
39
|
+
* labelOutput="Result"
|
|
40
|
+
* fn={async (input, config) => {
|
|
41
|
+
* const data = JSON.parse(input);
|
|
42
|
+
* const rules = JSON.parse(config);
|
|
43
|
+
* // Your transformation logic
|
|
44
|
+
* return JSON.stringify(result, null, 2);
|
|
45
|
+
* }}
|
|
46
|
+
* />
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
declare function MappingDemo({ input: initialInput, config: initialConfig, labelInput, labelConfig, labelOutput, fn, }?: MappingDemoProps): react_jsx_runtime.JSX.Element;
|
|
50
|
+
|
|
51
|
+
interface MappingCodeProps {
|
|
52
|
+
input: string;
|
|
53
|
+
config?: string;
|
|
54
|
+
labelInput?: string;
|
|
55
|
+
labelOutput?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* MappingCode - Specialized component for walkerOS mapping demonstrations
|
|
59
|
+
*
|
|
60
|
+
* Similar to LiveCode but specifically for mapping transformations.
|
|
61
|
+
* Shows input code and output result side-by-side with built-in mapping logic.
|
|
62
|
+
*
|
|
63
|
+
* Props:
|
|
64
|
+
* - input: Code string to execute (can use await getMappingEvent, getMappingValue)
|
|
65
|
+
* - config: Optional mapping configuration JSON
|
|
66
|
+
* - labelInput: Label for input editor (default: "Configuration")
|
|
67
|
+
* - labelOutput: Label for output display (default: "Result")
|
|
68
|
+
*
|
|
69
|
+
* Example:
|
|
70
|
+
* ```tsx
|
|
71
|
+
* <MappingCode
|
|
72
|
+
* input={`await getMappingEvent(
|
|
73
|
+
* { name: 'product view' },
|
|
74
|
+
* {
|
|
75
|
+
* product: {
|
|
76
|
+
* view: { name: 'product_viewed' }
|
|
77
|
+
* }
|
|
78
|
+
* }
|
|
79
|
+
* );`}
|
|
80
|
+
* />
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
declare function MappingCode({ input: initialInput, config, labelInput, labelOutput, }: MappingCodeProps): react_jsx_runtime.JSX.Element;
|
|
84
|
+
|
|
85
|
+
interface DestinationDemoProps {
|
|
86
|
+
destination: Destination.Instance;
|
|
87
|
+
event: WalkerOS.PartialEvent;
|
|
88
|
+
mapping?: Mapping.Rule | string;
|
|
89
|
+
settings?: unknown;
|
|
90
|
+
generic?: boolean;
|
|
91
|
+
labelEvent?: string;
|
|
92
|
+
labelMapping?: string;
|
|
93
|
+
labelOutput?: string;
|
|
94
|
+
fn?: (event: WalkerOS.Event, context: Destination.PushContext) => Promise<string>;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* DestinationDemo - Interactive destination testing component
|
|
98
|
+
*
|
|
99
|
+
* Automatically captures destination.push() calls and displays the output.
|
|
100
|
+
* The component auto-detects the destination's env from destination.examples.env.push.
|
|
101
|
+
*
|
|
102
|
+
* Props:
|
|
103
|
+
* - destination: Destination instance with examples.env.push export
|
|
104
|
+
* - event: walkerOS event to process
|
|
105
|
+
* - mapping: Optional mapping rules
|
|
106
|
+
* - settings: Destination-specific settings
|
|
107
|
+
* - generic: If true, wraps mapping in { '*': { '*': mapping } }
|
|
108
|
+
* - labelEvent: Label for event panel (default: 'Event')
|
|
109
|
+
* - labelMapping: Label for mapping panel (default: 'Mapping')
|
|
110
|
+
* - labelOutput: Label for output panel (default: 'Result')
|
|
111
|
+
*
|
|
112
|
+
* Example:
|
|
113
|
+
* ```tsx
|
|
114
|
+
* import destinationPlausible from '@walkeros/web-destination-plausible';
|
|
115
|
+
* import { examples } from '@walkeros/web-destination-plausible';
|
|
116
|
+
* import { getEvent } from '@walkeros/core';
|
|
117
|
+
*
|
|
118
|
+
* const destination = { ...destinationPlausible, examples };
|
|
119
|
+
*
|
|
120
|
+
* <DestinationDemo
|
|
121
|
+
* destination={destination}
|
|
122
|
+
* event={getEvent('order complete')}
|
|
123
|
+
* mapping={examples.mapping.purchase}
|
|
124
|
+
* settings={{ domain: 'elbwalker.com' }}
|
|
125
|
+
* generic={true}
|
|
126
|
+
* />
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
declare function createCaptureFn(fnName: string, onCapture: (output: string) => void): (...args: unknown[]) => void;
|
|
130
|
+
declare function DestinationDemo({ destination, event: initialEvent, mapping: initialMapping, settings, generic, labelEvent, labelMapping, labelOutput, fn, }: DestinationDemoProps): react_jsx_runtime.JSX.Element;
|
|
131
|
+
|
|
132
|
+
interface DestinationInitDemoProps {
|
|
133
|
+
destination: Destination.Instance;
|
|
134
|
+
settings?: unknown;
|
|
135
|
+
labelSettings?: string;
|
|
136
|
+
labelOutput?: string;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* DestinationInitDemo - Interactive destination initialization testing component
|
|
140
|
+
*
|
|
141
|
+
* Automatically captures destination.init() calls and displays the output.
|
|
142
|
+
* The component auto-detects the destination's env from destination.examples.env.init.
|
|
143
|
+
*
|
|
144
|
+
* Props:
|
|
145
|
+
* - destination: Destination instance with examples.env.init export
|
|
146
|
+
* - settings: Initial destination-specific settings
|
|
147
|
+
* - labelSettings: Label for settings panel (default: 'Settings')
|
|
148
|
+
* - labelOutput: Label for output panel (default: 'Result')
|
|
149
|
+
*
|
|
150
|
+
* Example:
|
|
151
|
+
* ```tsx
|
|
152
|
+
* import destinationGtag from '@walkeros/web-destination-gtag';
|
|
153
|
+
* import { examples } from '@walkeros/web-destination-gtag';
|
|
154
|
+
*
|
|
155
|
+
* const destination = { ...destinationGtag, examples };
|
|
156
|
+
*
|
|
157
|
+
* <DestinationInitDemo
|
|
158
|
+
* destination={destination}
|
|
159
|
+
* settings={{ ga4: { measurementId: 'G-XXXXXXXXXX' } }}
|
|
160
|
+
* />
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
declare function DestinationInitDemo({ destination, settings: initialSettings, labelSettings, labelOutput, }: DestinationInitDemoProps): react_jsx_runtime.JSX.Element;
|
|
164
|
+
|
|
165
|
+
interface DemoEnv extends Destination.BaseEnv {
|
|
166
|
+
elb: (output: string) => void;
|
|
167
|
+
}
|
|
168
|
+
type DestinationCode = Destination.Instance<Destination.Types<unknown, unknown, DemoEnv>>;
|
|
169
|
+
/**
|
|
170
|
+
* Creates a gtag-style destination for demo purposes.
|
|
171
|
+
* Formats output as: gtag('event', 'event_name', { data })
|
|
172
|
+
*/
|
|
173
|
+
declare function createGtagDestination(): DestinationCode;
|
|
174
|
+
/**
|
|
175
|
+
* Creates a Facebook Pixel-style destination for demo purposes.
|
|
176
|
+
* Formats output as: fbq('track', 'EventName', { data })
|
|
177
|
+
*/
|
|
178
|
+
declare function createFbqDestination(): DestinationCode;
|
|
179
|
+
/**
|
|
180
|
+
* Creates a Plausible-style destination for demo purposes.
|
|
181
|
+
* Formats output as: plausible('event_name', { props: { data } })
|
|
182
|
+
*/
|
|
183
|
+
declare function createPlausibleDestination(): DestinationCode;
|
|
184
|
+
|
|
185
|
+
interface PromotionPlaygroundProps {
|
|
186
|
+
initialHtml?: string;
|
|
187
|
+
initialCss?: string;
|
|
188
|
+
initialJs?: string;
|
|
189
|
+
initialMapping?: string;
|
|
190
|
+
labelCode?: string;
|
|
191
|
+
labelPreview?: string;
|
|
192
|
+
labelEvents?: string;
|
|
193
|
+
labelMapping?: string;
|
|
194
|
+
labelResult?: string;
|
|
195
|
+
destination?: DestinationCode;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* PromotionPlayground - Full walkerOS demonstration with live code editing
|
|
199
|
+
*
|
|
200
|
+
* Shows the complete chain:
|
|
201
|
+
* 1. Code Editor - Edit HTML/CSS/JS with walkerOS data attributes
|
|
202
|
+
* 2. Preview - Live rendered output that captures real events
|
|
203
|
+
* 3. Events - Real events captured from preview interactions
|
|
204
|
+
* 4. Mapping - Apply transformations and see destination output
|
|
205
|
+
* 5. Result - Final destination function calls
|
|
206
|
+
*/
|
|
207
|
+
declare function PromotionPlayground({ initialHtml, initialCss, initialJs, initialMapping, labelCode, labelPreview, labelEvents, labelMapping, labelResult, destination, }: PromotionPlaygroundProps): react_jsx_runtime.JSX.Element;
|
|
208
|
+
|
|
209
|
+
interface LiveCodeProps {
|
|
210
|
+
input: unknown;
|
|
211
|
+
config?: unknown;
|
|
212
|
+
output?: unknown;
|
|
213
|
+
options?: WalkerOS.AnyObject;
|
|
214
|
+
fn?: (input: unknown, config: unknown, log: (...args: unknown[]) => void, options?: WalkerOS.AnyObject) => Promise<void>;
|
|
215
|
+
fnName?: string;
|
|
216
|
+
labelInput?: string;
|
|
217
|
+
labelConfig?: string;
|
|
218
|
+
labelOutput?: string;
|
|
219
|
+
emptyText?: string;
|
|
220
|
+
disableInput?: boolean;
|
|
221
|
+
disableConfig?: boolean;
|
|
222
|
+
showQuotes?: boolean;
|
|
223
|
+
className?: string;
|
|
224
|
+
}
|
|
225
|
+
declare function LiveCode({ input: initInput, config: initConfig, output: initOutput, options, fn, fnName, labelInput, labelConfig, labelOutput, emptyText, disableInput, disableConfig, showQuotes, className, }: LiveCodeProps): react_jsx_runtime.JSX.Element;
|
|
226
|
+
|
|
227
|
+
interface CollectorBoxProps {
|
|
228
|
+
event: string;
|
|
229
|
+
mapping: string;
|
|
230
|
+
destination: DestinationCode;
|
|
231
|
+
label?: string;
|
|
232
|
+
wordWrap?: boolean;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* CollectorBox - Runs a collector with destination to transform events
|
|
236
|
+
*
|
|
237
|
+
* Takes raw event and mapping config, processes through collector pipeline,
|
|
238
|
+
* and displays the formatted destination output.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* <CollectorBox
|
|
242
|
+
* event={JSON.stringify(event)}
|
|
243
|
+
* mapping={mappingConfig}
|
|
244
|
+
* destination={createGtagDestination()}
|
|
245
|
+
* label="Result"
|
|
246
|
+
* />
|
|
247
|
+
*/
|
|
248
|
+
declare function CollectorBox({ event, mapping, destination, label, wordWrap, }: CollectorBoxProps): react_jsx_runtime.JSX.Element;
|
|
249
|
+
|
|
250
|
+
interface BrowserBoxProps {
|
|
251
|
+
html?: string;
|
|
252
|
+
css?: string;
|
|
253
|
+
js?: string;
|
|
254
|
+
onHtmlChange?: (value: string) => void;
|
|
255
|
+
onCssChange?: (value: string) => void;
|
|
256
|
+
onJsChange?: (value: string) => void;
|
|
257
|
+
showPreview?: boolean;
|
|
258
|
+
label?: string;
|
|
259
|
+
className?: string;
|
|
260
|
+
initialTab?: 'preview' | 'html' | 'css' | 'js';
|
|
261
|
+
lineNumbers?: boolean;
|
|
262
|
+
wordWrap?: boolean;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* BrowserBox - Code editor with HTML/CSS/JS toggle
|
|
266
|
+
*
|
|
267
|
+
* Displays code editor with button group to switch between HTML, CSS, and JavaScript.
|
|
268
|
+
* Only shows tabs for content that is provided.
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* <BrowserBox
|
|
272
|
+
* html={htmlCode}
|
|
273
|
+
* css={cssCode}
|
|
274
|
+
* onHtmlChange={setHtml}
|
|
275
|
+
* onCssChange={setCss}
|
|
276
|
+
* label="Code"
|
|
277
|
+
* />
|
|
278
|
+
*/
|
|
279
|
+
declare function BrowserBox({ html, css, js, onHtmlChange, onCssChange, onJsChange, showPreview, label, className, initialTab, lineNumbers, wordWrap, }: BrowserBoxProps): react_jsx_runtime.JSX.Element;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Configuration Structure Definition
|
|
283
|
+
*
|
|
284
|
+
* Describes the SHAPE of a configuration object - what properties it has,
|
|
285
|
+
* how they should be edited, and how to build tree navigation.
|
|
286
|
+
*
|
|
287
|
+
* This is NOT the schema for values (that's JSON Schema).
|
|
288
|
+
* This IS the meta-schema that describes structure.
|
|
289
|
+
*
|
|
290
|
+
* Example:
|
|
291
|
+
* - DESTINATION_CONFIG_STRUCTURE describes Destination.Config shape
|
|
292
|
+
* - MAPPING_RULE_STRUCTURE describes Mapping.Rule shape
|
|
293
|
+
* - VALUE_CONFIG_MAP_STRUCTURE describes ValueConfig.map shape
|
|
294
|
+
*/
|
|
295
|
+
interface ConfigStructureDef {
|
|
296
|
+
/** Type of the root config */
|
|
297
|
+
type: 'object' | 'array' | 'primitive';
|
|
298
|
+
/** Human-readable title */
|
|
299
|
+
title?: string;
|
|
300
|
+
/** Description of this config type */
|
|
301
|
+
description?: string;
|
|
302
|
+
/** Default NodeType for overview (when path is empty) */
|
|
303
|
+
rootNodeType?: NodeType;
|
|
304
|
+
/** Property definitions */
|
|
305
|
+
properties?: Record<string, PropertyDef>;
|
|
306
|
+
/** Special structural patterns */
|
|
307
|
+
patterns?: {
|
|
308
|
+
/** Entity → Action hierarchy (e.g., mapping.{entity}.{action}) */
|
|
309
|
+
'entity-action'?: boolean;
|
|
310
|
+
/** Dynamic keys allowed (e.g., map.{any-key}) */
|
|
311
|
+
'dynamic-keys'?: boolean;
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Property Definition
|
|
316
|
+
*
|
|
317
|
+
* Describes a single property within a config structure.
|
|
318
|
+
*/
|
|
319
|
+
interface PropertyDef {
|
|
320
|
+
/** Human-readable title */
|
|
321
|
+
title?: string;
|
|
322
|
+
/** Description of this property */
|
|
323
|
+
description?: string;
|
|
324
|
+
/** Explicit NodeType for editing this property */
|
|
325
|
+
nodeType?: NodeType;
|
|
326
|
+
/** Path to schema in schemas bundle (e.g., 'settings', 'mapping', 'id') */
|
|
327
|
+
schemaPath?: string;
|
|
328
|
+
/** How to build children for this property */
|
|
329
|
+
children?: ChildrenStrategy;
|
|
330
|
+
/** Nested structure definition (for complex properties) */
|
|
331
|
+
structure?: ConfigStructureDef;
|
|
332
|
+
/** Depth of this property in entity-action pattern */
|
|
333
|
+
depth?: number;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Children Building Strategy
|
|
337
|
+
*
|
|
338
|
+
* Determines how to build tree children for a property.
|
|
339
|
+
*/
|
|
340
|
+
type ChildrenStrategy = 'entity-action' | 'schema-driven' | 'value-driven' | 'none';
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Node types for different editing contexts
|
|
344
|
+
*/
|
|
345
|
+
type NodeType = 'entity' | 'rule' | 'name' | 'batch' | 'policy' | 'consent' | 'settings' | 'options' | 'validationOverview' | 'valueConfig' | 'valueType' | 'primitive' | 'map' | 'loop' | 'set' | 'value' | 'fn' | 'validate' | 'condition' | 'enum' | 'boolean' | 'key';
|
|
346
|
+
|
|
347
|
+
interface NavigationState {
|
|
348
|
+
currentPath: string[];
|
|
349
|
+
nodeType: NodeType;
|
|
350
|
+
expandedPaths: string[][];
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Config Editor Box
|
|
355
|
+
*
|
|
356
|
+
* Wrapper component that provides Code/Visual toggle.
|
|
357
|
+
* Persists navigation state when switching between views.
|
|
358
|
+
*
|
|
359
|
+
* @example
|
|
360
|
+
* <ConfigEditorBox
|
|
361
|
+
* config={destinationConfig}
|
|
362
|
+
* onChange={setConfig}
|
|
363
|
+
* structure={DESTINATION_CONFIG_STRUCTURE}
|
|
364
|
+
* schemas={metaSchemas}
|
|
365
|
+
* label="Meta Pixel Configuration"
|
|
366
|
+
* />
|
|
367
|
+
*/
|
|
368
|
+
interface ConfigEditorBoxProps<T extends Record<string, unknown>> {
|
|
369
|
+
config: T;
|
|
370
|
+
onChange?: (config: T) => void;
|
|
371
|
+
structure: ConfigStructureDef;
|
|
372
|
+
schemas?: Record<string, RJSFSchema>;
|
|
373
|
+
sections?: Record<string, boolean>;
|
|
374
|
+
label?: string;
|
|
375
|
+
className?: string;
|
|
376
|
+
initialTab?: 'code' | 'visual';
|
|
377
|
+
resizable?: boolean;
|
|
378
|
+
showTree?: boolean;
|
|
379
|
+
showHeader?: boolean;
|
|
380
|
+
initialNavigationState?: NavigationState;
|
|
381
|
+
onNavigationStateChange?: (state: NavigationState) => void;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* ConfigEditor - Generic Visual Configuration Editor
|
|
386
|
+
*
|
|
387
|
+
* A fully generic configuration editor that works at ANY depth with ANY config type.
|
|
388
|
+
* Uses structure definitions and schemas to provide appropriate editing UI.
|
|
389
|
+
*
|
|
390
|
+
* Key Features:
|
|
391
|
+
* - Works at any depth (full config or nested object)
|
|
392
|
+
* - Structure-driven (no hardcoded assumptions)
|
|
393
|
+
* - Schema-aware (validation, type hints, metadata)
|
|
394
|
+
* - Code/Visual toggle
|
|
395
|
+
* - Tree navigation
|
|
396
|
+
* - Validation with error overview
|
|
397
|
+
* - TypeScript generic for type safety
|
|
398
|
+
*
|
|
399
|
+
* @example
|
|
400
|
+
* // Full DestinationConfig
|
|
401
|
+
* <ConfigEditor
|
|
402
|
+
* config={destinationConfig}
|
|
403
|
+
* onChange={setConfig}
|
|
404
|
+
* structure={DESTINATION_CONFIG_STRUCTURE}
|
|
405
|
+
* schemas={metaSchemas}
|
|
406
|
+
* label="Meta Pixel Configuration"
|
|
407
|
+
* />
|
|
408
|
+
*
|
|
409
|
+
* @example
|
|
410
|
+
* // Single Rule (deep nested)
|
|
411
|
+
* <ConfigEditor
|
|
412
|
+
* config={pageViewRule}
|
|
413
|
+
* onChange={setRule}
|
|
414
|
+
* structure={MAPPING_RULE_STRUCTURE}
|
|
415
|
+
* schemas={{ mapping: mappingSchema }}
|
|
416
|
+
* label="Page View Rule"
|
|
417
|
+
* showTree={false}
|
|
418
|
+
* />
|
|
419
|
+
*
|
|
420
|
+
* @example
|
|
421
|
+
* // Read-only (no onChange)
|
|
422
|
+
* <ConfigEditor
|
|
423
|
+
* config={destinationConfig}
|
|
424
|
+
* structure={DESTINATION_CONFIG_STRUCTURE}
|
|
425
|
+
* initialTab="code"
|
|
426
|
+
* />
|
|
427
|
+
*/
|
|
428
|
+
declare function ConfigEditor<T extends Record<string, unknown>>(props: ConfigEditorBoxProps<T>): react_jsx_runtime.JSX.Element;
|
|
429
|
+
|
|
430
|
+
interface CodeProps {
|
|
431
|
+
code: string;
|
|
432
|
+
language?: string;
|
|
433
|
+
onChange?: (code: string) => void;
|
|
434
|
+
disabled?: boolean;
|
|
435
|
+
lineNumbers?: boolean;
|
|
436
|
+
folding?: boolean;
|
|
437
|
+
wordWrap?: boolean;
|
|
438
|
+
className?: string;
|
|
439
|
+
beforeMount?: (monaco: typeof monaco_editor) => void;
|
|
440
|
+
onMount?: (editor: editor.IStandaloneCodeEditor) => void;
|
|
441
|
+
autoHeight?: boolean | {
|
|
442
|
+
min?: number;
|
|
443
|
+
max?: number;
|
|
444
|
+
};
|
|
445
|
+
fontSize?: number;
|
|
446
|
+
packages?: string[];
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Code - Pure Monaco editor atom
|
|
450
|
+
*
|
|
451
|
+
* Height Management:
|
|
452
|
+
* Two modes controlled by `autoHeight` prop:
|
|
453
|
+
*
|
|
454
|
+
* 1. Default (autoHeight=false): height="100%" - fills parent container
|
|
455
|
+
* - Uses flex: 1 + min-height: 0 for proper flex overflow containment
|
|
456
|
+
* - Monaco set to height="100%" to fill container
|
|
457
|
+
* - automaticLayout: true + ResizeObserver for reliable resize detection
|
|
458
|
+
* - Use in Grid (equal heights) and Flex contexts (fill parent)
|
|
459
|
+
*
|
|
460
|
+
* 2. Auto-height (autoHeight=true): Dynamically sizes to content
|
|
461
|
+
* - Uses Monaco's getContentHeight() API for accurate content measurement
|
|
462
|
+
* - Respects min/max boundaries (default: 100-600px)
|
|
463
|
+
* - Updates automatically when content changes
|
|
464
|
+
* - Use in standalone contexts (docs) to eliminate blank space
|
|
465
|
+
*
|
|
466
|
+
* @example
|
|
467
|
+
* // Grid context - use default height="100%" for equal row heights
|
|
468
|
+
* <Grid columns={3}>
|
|
469
|
+
* <CodeBox code={event} />
|
|
470
|
+
* <CodeBox code={mapping} />
|
|
471
|
+
* </Grid>
|
|
472
|
+
*
|
|
473
|
+
* @example
|
|
474
|
+
* // Standalone context - use autoHeight to fit content
|
|
475
|
+
* <CodeBox
|
|
476
|
+
* code={shortExample}
|
|
477
|
+
* autoHeight={{ min: 100, max: 600 }}
|
|
478
|
+
* />
|
|
479
|
+
*/
|
|
480
|
+
declare function Code({ code, language, onChange, disabled, lineNumbers, folding, wordWrap, className, beforeMount, onMount, autoHeight, fontSize, packages, }: CodeProps): react_jsx_runtime.JSX.Element;
|
|
481
|
+
|
|
482
|
+
interface CodeBoxProps extends CodeProps {
|
|
483
|
+
label?: string;
|
|
484
|
+
showCopy?: boolean;
|
|
485
|
+
showFormat?: boolean;
|
|
486
|
+
showHeader?: boolean;
|
|
487
|
+
height?: string | number;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* CodeBox - Monaco editor wrapped in a Box with header and actions
|
|
491
|
+
*
|
|
492
|
+
* Molecule that combines Box + Code atom + toolbar actions.
|
|
493
|
+
* Use this when you need an editor with header, copy, and format buttons.
|
|
494
|
+
* Use Code atom directly when you need an editor without Box wrapper.
|
|
495
|
+
*
|
|
496
|
+
* Height Behavior:
|
|
497
|
+
*
|
|
498
|
+
* Three height modes:
|
|
499
|
+
* 1. Grid context: Equal row heights (250-450px), fills available space
|
|
500
|
+
* 2. Explicit height prop: Fixed height (e.g., height={600} or height="50vh")
|
|
501
|
+
* 3. Auto-height prop: Dynamically sizes to content (min-max boundaries)
|
|
502
|
+
*
|
|
503
|
+
* @example
|
|
504
|
+
* // Grid context - use default (no autoHeight) for equal row heights
|
|
505
|
+
* <Grid columns={3}>
|
|
506
|
+
* <CodeBox code={event} label="Event" showCopy />
|
|
507
|
+
* <CodeBox code={mapping} label="Mapping" showFormat />
|
|
508
|
+
* <CodeBox code={output} label="Output" disabled />
|
|
509
|
+
* </Grid>
|
|
510
|
+
*
|
|
511
|
+
* @example
|
|
512
|
+
* // Standalone with auto-height - fits content, no blank space
|
|
513
|
+
* <CodeBox
|
|
514
|
+
* code={setupCode}
|
|
515
|
+
* label="Setup"
|
|
516
|
+
* autoHeight={{ min: 100, max: 600 }}
|
|
517
|
+
* disabled
|
|
518
|
+
* />
|
|
519
|
+
*
|
|
520
|
+
* @example
|
|
521
|
+
* // Explicit height override
|
|
522
|
+
* <CodeBox
|
|
523
|
+
* code={largeConfig}
|
|
524
|
+
* label="Configuration"
|
|
525
|
+
* height={600}
|
|
526
|
+
* showFormat
|
|
527
|
+
* />
|
|
528
|
+
*/
|
|
529
|
+
declare function CodeBox({ code, language, label, onChange, disabled, showCopy, showFormat, showHeader, height, className, autoHeight, ...codeProps }: CodeBoxProps): react_jsx_runtime.JSX.Element;
|
|
530
|
+
|
|
531
|
+
type CodeSnippetProps = Omit<CodeBoxProps, 'label' | 'showHeader'>;
|
|
532
|
+
/**
|
|
533
|
+
* CodeSnippet - Prominent code display for snippets
|
|
534
|
+
*
|
|
535
|
+
* Wraps CodeBox with larger font size and generous padding.
|
|
536
|
+
* Use this for showcasing code examples, one-liners, or small code blocks
|
|
537
|
+
* where you want the code to be more visually prominent than in a standard editor.
|
|
538
|
+
*
|
|
539
|
+
* Always renders without a header. Use CodeBox if you need a header.
|
|
540
|
+
*
|
|
541
|
+
* Default behavior:
|
|
542
|
+
* - Read-only (disabled=true)
|
|
543
|
+
* - Copy button enabled (showCopy=true)
|
|
544
|
+
* - Auto-height with sensible bounds (min: 20px, max: 600px)
|
|
545
|
+
*
|
|
546
|
+
* Reuses all CodeBox functionality:
|
|
547
|
+
* - Monaco Editor with syntax highlighting
|
|
548
|
+
* - Grid height management and auto-height modes
|
|
549
|
+
* - Copy button
|
|
550
|
+
* - Theme integration
|
|
551
|
+
*
|
|
552
|
+
* @example
|
|
553
|
+
* // Minimal usage - just code and language
|
|
554
|
+
* <CodeSnippet
|
|
555
|
+
* code="import { elb } from '@walkeros/core';"
|
|
556
|
+
* language="javascript"
|
|
557
|
+
* />
|
|
558
|
+
*
|
|
559
|
+
* @example
|
|
560
|
+
* // Override defaults if needed
|
|
561
|
+
* <CodeSnippet
|
|
562
|
+
* code={editableCode}
|
|
563
|
+
* language="javascript"
|
|
564
|
+
* disabled={false}
|
|
565
|
+
* showCopy={false}
|
|
566
|
+
* autoHeight={{ min: 100, max: 800 }}
|
|
567
|
+
* />
|
|
568
|
+
*/
|
|
569
|
+
declare function CodeSnippet(props: CodeSnippetProps): react_jsx_runtime.JSX.Element;
|
|
570
|
+
|
|
571
|
+
interface PropertyTableProps {
|
|
572
|
+
schema: RJSFSchema;
|
|
573
|
+
className?: string;
|
|
574
|
+
}
|
|
575
|
+
declare function PropertyTable({ schema, className }: PropertyTableProps): react_jsx_runtime.JSX.Element;
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Destination schema bundle for runtime provision
|
|
579
|
+
*
|
|
580
|
+
* Maps to Destination.Types<S, M, E> generic structure:
|
|
581
|
+
* - settings: JSON Schema for config-level Settings<T>
|
|
582
|
+
* - mapping: JSON Schema for rule-level Mapping<T> (settings inside rules)
|
|
583
|
+
* - data: JSON Schema for expected event data properties
|
|
584
|
+
*
|
|
585
|
+
* Used by ConfigEditor and related components to provide:
|
|
586
|
+
* - Type detection for editing panes
|
|
587
|
+
* - Validation for user input
|
|
588
|
+
* - Metadata (titles, descriptions, enums)
|
|
589
|
+
*/
|
|
590
|
+
interface DestinationSchemas {
|
|
591
|
+
/** Config-level settings schema (for Settings<T>) */
|
|
592
|
+
settings?: RJSFSchema;
|
|
593
|
+
/** Config-level settings UI schema */
|
|
594
|
+
settingsUi?: UiSchema;
|
|
595
|
+
/** Rule-level mapping settings schema (for Mapping<T>) */
|
|
596
|
+
mapping?: RJSFSchema;
|
|
597
|
+
/** Rule-level mapping settings UI schema */
|
|
598
|
+
mappingUi?: UiSchema;
|
|
599
|
+
/** Expected data properties schema for destination events */
|
|
600
|
+
data?: RJSFSchema;
|
|
601
|
+
/** Data properties UI schema */
|
|
602
|
+
dataUi?: UiSchema;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* Structure Definition for Destination.Config
|
|
607
|
+
*
|
|
608
|
+
* Describes the shape of a full destination configuration:
|
|
609
|
+
* - settings: Destination-specific settings
|
|
610
|
+
* - mapping: Event mapping rules (entity → action hierarchy)
|
|
611
|
+
* - data: Global data transformations
|
|
612
|
+
* - policy: Processing policy rules
|
|
613
|
+
* - consent: Consent requirements
|
|
614
|
+
* - id, loadScript, queue, verbose: Config options
|
|
615
|
+
*
|
|
616
|
+
* This structure works with DestinationBox and ConfigEditor.
|
|
617
|
+
*/
|
|
618
|
+
declare const DESTINATION_CONFIG_STRUCTURE: ConfigStructureDef;
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Structure Definition for Mapping.Rule
|
|
622
|
+
*
|
|
623
|
+
* Describes the shape of a single mapping rule (e.g., mapping.page.view):
|
|
624
|
+
* - name: Event name override
|
|
625
|
+
* - batch: Batch size
|
|
626
|
+
* - settings: Rule-level settings
|
|
627
|
+
* - data: Data transformations
|
|
628
|
+
* - consent: Consent requirements
|
|
629
|
+
* - condition: Condition function
|
|
630
|
+
* - ignore: Ignore flag
|
|
631
|
+
*
|
|
632
|
+
* This structure enables editing individual rules with ConfigEditor.
|
|
633
|
+
*/
|
|
634
|
+
declare const MAPPING_RULE_STRUCTURE: ConfigStructureDef;
|
|
635
|
+
|
|
636
|
+
interface PreviewProps {
|
|
637
|
+
html: string;
|
|
638
|
+
css?: string;
|
|
639
|
+
onEvent?: (event: WalkerOS.Event) => void;
|
|
640
|
+
label?: string;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Preview - HTML preview wrapped in a Box with highlight buttons
|
|
644
|
+
*
|
|
645
|
+
* Renders HTML in an isolated iframe with highlight buttons footer.
|
|
646
|
+
* When onEvent is provided, initializes walkerOS browser source in iframe.
|
|
647
|
+
*
|
|
648
|
+
* @example
|
|
649
|
+
* // Read-only preview
|
|
650
|
+
* <Preview html={html} css={css} label="Preview" />
|
|
651
|
+
*
|
|
652
|
+
* // Interactive preview with event capture
|
|
653
|
+
* <Preview html={html} css={css} onEvent={(event) => console.log(event)} label="Preview" />
|
|
654
|
+
*/
|
|
655
|
+
declare function Preview({ html, css, onEvent, label }: PreviewProps): react_jsx_runtime.JSX.Element;
|
|
656
|
+
|
|
657
|
+
interface BoxProps {
|
|
658
|
+
header: string;
|
|
659
|
+
headerActions?: React.ReactNode;
|
|
660
|
+
footer?: React.ReactNode;
|
|
661
|
+
children: React.ReactNode;
|
|
662
|
+
className?: string;
|
|
663
|
+
style?: React.CSSProperties;
|
|
664
|
+
minHeight?: number | string;
|
|
665
|
+
maxHeight?: number | string;
|
|
666
|
+
tiny?: boolean;
|
|
667
|
+
resizable?: boolean;
|
|
668
|
+
showHeader?: boolean;
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* Box - Container atom component
|
|
672
|
+
*
|
|
673
|
+
* Provides a consistent box container with header and content area.
|
|
674
|
+
* Used across all explorer components for consistent styling.
|
|
675
|
+
*
|
|
676
|
+
* Height behavior:
|
|
677
|
+
* - Default: minHeight 100px, grows as needed
|
|
678
|
+
* - tiny prop: sets minHeight to 100px explicitly
|
|
679
|
+
* - Custom minHeight/maxHeight: override defaults
|
|
680
|
+
* - In Grid: fills row height (equal heights per row)
|
|
681
|
+
*
|
|
682
|
+
* @example
|
|
683
|
+
* <Box header="Preview">
|
|
684
|
+
* <Preview html={html} css={css} />
|
|
685
|
+
* </Box>
|
|
686
|
+
*
|
|
687
|
+
* @example
|
|
688
|
+
* <Box header="Code" minHeight={200} maxHeight={600}>
|
|
689
|
+
* <CodeBox ... />
|
|
690
|
+
* </Box>
|
|
691
|
+
*/
|
|
692
|
+
declare function Box({ header, headerActions, footer, children, className, style, minHeight, maxHeight, tiny, resizable, showHeader, }: BoxProps): react_jsx_runtime.JSX.Element;
|
|
693
|
+
|
|
694
|
+
interface GridProps {
|
|
695
|
+
children: React.ReactNode;
|
|
696
|
+
columns?: number;
|
|
697
|
+
minBoxWidth?: number | string;
|
|
698
|
+
gap?: number | string;
|
|
699
|
+
rowHeight?: 'auto' | 'equal' | 'synced' | number;
|
|
700
|
+
maxRowHeight?: number | string | 'none';
|
|
701
|
+
showScrollButtons?: boolean;
|
|
702
|
+
className?: string;
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Grid - Horizontal scrolling layout component for arranging boxes
|
|
706
|
+
*
|
|
707
|
+
* Provides consistent grid layout for box components with horizontal
|
|
708
|
+
* scrolling when content exceeds available space. Boxes maintain minimum
|
|
709
|
+
* width and never wrap to new rows.
|
|
710
|
+
*
|
|
711
|
+
* @example
|
|
712
|
+
* // 5 boxes with default 350px minimum width
|
|
713
|
+
* <Grid columns={5}>
|
|
714
|
+
* <CodeBox ... />
|
|
715
|
+
* <CodeBox ... />
|
|
716
|
+
* <CodeBox ... />
|
|
717
|
+
* <CodeBox ... />
|
|
718
|
+
* <CodeBox ... />
|
|
719
|
+
* </Grid>
|
|
720
|
+
*
|
|
721
|
+
* @example
|
|
722
|
+
* // Custom minimum box width
|
|
723
|
+
* <Grid columns={3} minBoxWidth={400}>
|
|
724
|
+
* <BrowserBox ... />
|
|
725
|
+
* <CodeBox ... />
|
|
726
|
+
* <CodeBox ... />
|
|
727
|
+
* </Grid>
|
|
728
|
+
*
|
|
729
|
+
* @example
|
|
730
|
+
* // Custom row height
|
|
731
|
+
* <Grid columns={2} rowHeight={300}>
|
|
732
|
+
* <CodeBox ... />
|
|
733
|
+
* <CodeBox ... />
|
|
734
|
+
* </Grid>
|
|
735
|
+
*
|
|
736
|
+
* @example
|
|
737
|
+
* // Auto row height (no minimum)
|
|
738
|
+
* <Grid columns={3} rowHeight="auto">
|
|
739
|
+
* <CodeBox ... />
|
|
740
|
+
* </Grid>
|
|
741
|
+
*
|
|
742
|
+
* @example
|
|
743
|
+
* // Unlimited row height (no max constraint)
|
|
744
|
+
* <Grid columns={2} maxRowHeight="none">
|
|
745
|
+
* <PropertyTable ... />
|
|
746
|
+
* <CodeBox ... />
|
|
747
|
+
* </Grid>
|
|
748
|
+
*
|
|
749
|
+
* @example
|
|
750
|
+
* // Custom max row height
|
|
751
|
+
* <Grid columns={2} maxRowHeight={800}>
|
|
752
|
+
* <PropertyTable ... />
|
|
753
|
+
* <CodeBox ... />
|
|
754
|
+
* </Grid>
|
|
755
|
+
*/
|
|
756
|
+
declare function Grid({ children, columns, minBoxWidth, gap, rowHeight, maxRowHeight, showScrollButtons, className, }: GridProps): react_jsx_runtime.JSX.Element;
|
|
757
|
+
|
|
758
|
+
interface HeaderProps {
|
|
759
|
+
label: string;
|
|
760
|
+
children?: React.ReactNode;
|
|
761
|
+
}
|
|
762
|
+
declare function Header({ label, children }: HeaderProps): react_jsx_runtime.JSX.Element;
|
|
763
|
+
|
|
764
|
+
interface FooterProps {
|
|
765
|
+
children: React.ReactNode;
|
|
766
|
+
className?: string;
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* Footer - Footer atom component for boxes
|
|
770
|
+
*
|
|
771
|
+
* Provides a fixed-height footer area at the bottom of a box.
|
|
772
|
+
* Pairs with Header component for consistent box structure.
|
|
773
|
+
*
|
|
774
|
+
* @example
|
|
775
|
+
* <Box header="Preview">
|
|
776
|
+
* <Preview ... />
|
|
777
|
+
* <Footer>
|
|
778
|
+
* <ButtonGroup buttons={...} />
|
|
779
|
+
* </Footer>
|
|
780
|
+
* </Box>
|
|
781
|
+
*/
|
|
782
|
+
declare function Footer({ children, className }: FooterProps): react_jsx_runtime.JSX.Element;
|
|
783
|
+
|
|
784
|
+
interface ButtonProps {
|
|
785
|
+
active?: boolean;
|
|
786
|
+
onClick?: () => void;
|
|
787
|
+
children: React.ReactNode;
|
|
788
|
+
className?: string;
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* Button - Button component for headers and controls
|
|
792
|
+
*
|
|
793
|
+
* Used in button groups or standalone in headers.
|
|
794
|
+
* Follows atomic design principles as a base atom.
|
|
795
|
+
*/
|
|
796
|
+
declare function Button({ active, onClick, children, className, }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
797
|
+
|
|
798
|
+
interface ButtonGroupProps {
|
|
799
|
+
buttons: Array<{
|
|
800
|
+
label: string;
|
|
801
|
+
value: string;
|
|
802
|
+
active?: boolean;
|
|
803
|
+
}>;
|
|
804
|
+
onButtonClick: (value: string) => void;
|
|
805
|
+
className?: string;
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* ButtonGroup - Segmented control for headers
|
|
809
|
+
*
|
|
810
|
+
* Displays multiple buttons in a grouped segmented control style.
|
|
811
|
+
* Commonly used for tab switching (HTML/CSS/JS, etc.)
|
|
812
|
+
*/
|
|
813
|
+
declare function ButtonGroup({ buttons, onButtonClick, className, }: ButtonGroupProps): react_jsx_runtime.JSX.Element;
|
|
814
|
+
|
|
815
|
+
/**
|
|
816
|
+
* MappingKeyWidget - RJSF widget for key property
|
|
817
|
+
*
|
|
818
|
+
* Manages the key property of ValueConfig - a string path to extract
|
|
819
|
+
* values from events (e.g., 'data.id', 'user.email', 'globals.currency').
|
|
820
|
+
*
|
|
821
|
+
* Features:
|
|
822
|
+
* - Simple text input for path entry
|
|
823
|
+
* - Helpful examples and common path patterns
|
|
824
|
+
* - Clean, focused interface for single property editing
|
|
825
|
+
*
|
|
826
|
+
* @example
|
|
827
|
+
* // In schema:
|
|
828
|
+
* const schema = {
|
|
829
|
+
* type: 'object',
|
|
830
|
+
* properties: {
|
|
831
|
+
* key: {
|
|
832
|
+
* type: 'string',
|
|
833
|
+
* title: 'Key',
|
|
834
|
+
* description: 'Extract value from event path'
|
|
835
|
+
* }
|
|
836
|
+
* }
|
|
837
|
+
* }
|
|
838
|
+
*
|
|
839
|
+
* @example
|
|
840
|
+
* // In uiSchema:
|
|
841
|
+
* const uiSchema = {
|
|
842
|
+
* key: {
|
|
843
|
+
* 'ui:widget': 'mappingKey'
|
|
844
|
+
* }
|
|
845
|
+
* }
|
|
846
|
+
*/
|
|
847
|
+
declare function MappingKeyWidget(props: WidgetProps): react_jsx_runtime.JSX.Element;
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* MappingKeyField - RJSF field wrapper for key property
|
|
851
|
+
*
|
|
852
|
+
* Bridges RJSF FieldProps to our custom MappingKeyWidget.
|
|
853
|
+
* Required because RJSF uses fields (not widgets) for custom field rendering.
|
|
854
|
+
*
|
|
855
|
+
* @example
|
|
856
|
+
* // Register in field registry:
|
|
857
|
+
* export const mappingFields: RegistryFieldsType = {
|
|
858
|
+
* mappingKey: MappingKeyField,
|
|
859
|
+
* };
|
|
860
|
+
*
|
|
861
|
+
* @example
|
|
862
|
+
* // Use in uiSchema:
|
|
863
|
+
* const uiSchema = {
|
|
864
|
+
* key: {
|
|
865
|
+
* 'ui:field': 'mappingKey'
|
|
866
|
+
* }
|
|
867
|
+
* };
|
|
868
|
+
*/
|
|
869
|
+
declare function MappingKeyField(props: FieldProps): react_jsx_runtime.JSX.Element;
|
|
870
|
+
|
|
871
|
+
/**
|
|
872
|
+
* Hint item definition
|
|
873
|
+
*/
|
|
874
|
+
interface HintItem {
|
|
875
|
+
code: string;
|
|
876
|
+
description: string;
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* PanelHints - Reusable hints component for panel views
|
|
880
|
+
*
|
|
881
|
+
* Displays a clean, modern hints box with code examples and descriptions.
|
|
882
|
+
* Used across all property panel views for consistency.
|
|
883
|
+
*
|
|
884
|
+
* Features:
|
|
885
|
+
* - Minimal design with subtle background
|
|
886
|
+
* - Code-first presentation
|
|
887
|
+
* - Clean typography
|
|
888
|
+
* - Theme-aware styling
|
|
889
|
+
*
|
|
890
|
+
* @example
|
|
891
|
+
* <PanelHints
|
|
892
|
+
* title="Common patterns"
|
|
893
|
+
* hints={[
|
|
894
|
+
* { code: 'data.id', description: 'Product identifier' },
|
|
895
|
+
* { code: 'user.email', description: 'User email address' }
|
|
896
|
+
* ]}
|
|
897
|
+
* />
|
|
898
|
+
*/
|
|
899
|
+
interface PanelHintsProps {
|
|
900
|
+
title?: string;
|
|
901
|
+
hints: HintItem[];
|
|
902
|
+
className?: string;
|
|
903
|
+
}
|
|
904
|
+
declare function PanelHints({ title, hints, className, }: PanelHintsProps): react_jsx_runtime.JSX.Element;
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* MDXProvider - Makes components available in MDX files without explicit imports
|
|
908
|
+
*
|
|
909
|
+
* This provider wraps MDX content and injects React components for HTML elements.
|
|
910
|
+
* Components are automatically used when rendering markdown/MDX content.
|
|
911
|
+
*
|
|
912
|
+
* Key features:
|
|
913
|
+
* - No imports needed in MDX files
|
|
914
|
+
* - Consistent styling across all documentation
|
|
915
|
+
* - Theme-aware (respects data-theme attribute)
|
|
916
|
+
* - Automatic inline vs block code detection
|
|
917
|
+
*
|
|
918
|
+
* Available components (no import needed):
|
|
919
|
+
* - CodeBox: Monaco editor for code display (also auto-used for ```code blocks)
|
|
920
|
+
* - PropertyTable: Display schema-based property documentation
|
|
921
|
+
* - DestinationInitDemo: Interactive demo for destination initialization
|
|
922
|
+
* - DestinationDemo: Interactive demo for destination event processing
|
|
923
|
+
*
|
|
924
|
+
* @example
|
|
925
|
+
* // Wrap your app
|
|
926
|
+
* <MDXProvider>
|
|
927
|
+
* <App />
|
|
928
|
+
* </MDXProvider>
|
|
929
|
+
*
|
|
930
|
+
* @example
|
|
931
|
+
* // Then in any .mdx file, no imports needed:
|
|
932
|
+
* # Documentation
|
|
933
|
+
*
|
|
934
|
+
* Inline `code` and markdown blocks:
|
|
935
|
+
* ```typescript
|
|
936
|
+
* const example = "Hello";
|
|
937
|
+
* ```
|
|
938
|
+
*
|
|
939
|
+
* Or use components directly:
|
|
940
|
+
* <CodeBox code="const x = 1;" language="javascript" />
|
|
941
|
+
* <PropertyTable schema={mySchema} />
|
|
942
|
+
*/
|
|
943
|
+
declare const MDXProvider: FC<PropsWithChildren>;
|
|
944
|
+
|
|
945
|
+
interface MDXCodeProps {
|
|
946
|
+
className?: string;
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* MDXCode - Code component for MDX files
|
|
950
|
+
*
|
|
951
|
+
* Automatically detects and renders inline vs block code:
|
|
952
|
+
* - Inline code: `example` → <code className="elb-code-inline">
|
|
953
|
+
* - Block code: ```language\ncode\n``` → Uses CodeBox with Monaco editor
|
|
954
|
+
*
|
|
955
|
+
* Language detection:
|
|
956
|
+
* - Extracts language from className (e.g., "language-typescript")
|
|
957
|
+
* - Maps common MDX language names to Monaco language IDs
|
|
958
|
+
*
|
|
959
|
+
* Block code features (via CodeBox):
|
|
960
|
+
* - Full Monaco editor with syntax highlighting
|
|
961
|
+
* - Theme-aware (Palenight dark, VS Light)
|
|
962
|
+
* - Copy to clipboard button
|
|
963
|
+
* - Auto-height to fit content
|
|
964
|
+
* - Read-only mode
|
|
965
|
+
*
|
|
966
|
+
* @example
|
|
967
|
+
* // In MDX files (no import needed with MDXProvider):
|
|
968
|
+
* Inline `code` example
|
|
969
|
+
*
|
|
970
|
+
* ```typescript
|
|
971
|
+
* const block = "code";
|
|
972
|
+
* ```
|
|
973
|
+
*/
|
|
974
|
+
declare const MDXCode: FC<PropsWithChildren<MDXCodeProps>>;
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* Utility function to merge class names with Tailwind CSS classes
|
|
978
|
+
* Uses clsx for conditional classes and tailwind-merge to handle conflicts
|
|
979
|
+
*/
|
|
980
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
981
|
+
|
|
982
|
+
declare const palenightTheme: editor.IStandaloneThemeData;
|
|
983
|
+
/**
|
|
984
|
+
* Register the palenight theme with Monaco Editor
|
|
985
|
+
* Call this function before creating any editor instances
|
|
986
|
+
*/
|
|
987
|
+
declare function registerPalenightTheme(monaco: typeof monaco_editor): void;
|
|
988
|
+
|
|
989
|
+
declare const lighthouseTheme: editor.IStandaloneThemeData;
|
|
990
|
+
/**
|
|
991
|
+
* Register the lighthouse theme with Monaco Editor
|
|
992
|
+
* Call this function before creating any editor instances
|
|
993
|
+
*/
|
|
994
|
+
declare function registerLighthouseTheme(monaco: typeof monaco_editor): void;
|
|
995
|
+
|
|
996
|
+
/**
|
|
997
|
+
* TypeScript type definitions for walkerOS Explorer themes
|
|
998
|
+
*
|
|
999
|
+
* These types provide type-safe access to theme properties and enable
|
|
1000
|
+
* programmatic theme customization.
|
|
1001
|
+
*/
|
|
1002
|
+
interface ExplorerTheme {
|
|
1003
|
+
mode: 'light' | 'dark';
|
|
1004
|
+
colors: {
|
|
1005
|
+
text: string;
|
|
1006
|
+
textLabel: string;
|
|
1007
|
+
textButton: string;
|
|
1008
|
+
textButtonHover: string;
|
|
1009
|
+
textButtonActive: string;
|
|
1010
|
+
textMuted: string;
|
|
1011
|
+
textToggle: string;
|
|
1012
|
+
textInput: string;
|
|
1013
|
+
textPlaceholder: string;
|
|
1014
|
+
bgBox: string;
|
|
1015
|
+
bgHeader: string;
|
|
1016
|
+
bgFooter: string;
|
|
1017
|
+
bgButtonHover: string;
|
|
1018
|
+
bgButtonActive: string;
|
|
1019
|
+
bgButtonGroup: string;
|
|
1020
|
+
bgInput: string;
|
|
1021
|
+
bgInputHover: string;
|
|
1022
|
+
bgCodeInline: string;
|
|
1023
|
+
bgDropdown: string;
|
|
1024
|
+
bgDropdownOptionHover: string;
|
|
1025
|
+
bgDropdownOptionHighlighted: string;
|
|
1026
|
+
borderBox: string;
|
|
1027
|
+
borderHeader: string;
|
|
1028
|
+
borderFooter: string;
|
|
1029
|
+
borderButtonGroup: string;
|
|
1030
|
+
borderInput: string;
|
|
1031
|
+
borderInputFocus: string;
|
|
1032
|
+
buttonPrimary: string;
|
|
1033
|
+
buttonPrimaryHover: string;
|
|
1034
|
+
buttonPrimaryText: string;
|
|
1035
|
+
buttonDanger: string;
|
|
1036
|
+
buttonDangerHover: string;
|
|
1037
|
+
buttonDangerText: string;
|
|
1038
|
+
statusEnabled: string;
|
|
1039
|
+
statusDisabled: string;
|
|
1040
|
+
statusWarning: string;
|
|
1041
|
+
highlightPrimary: string;
|
|
1042
|
+
highlightGlobals: string;
|
|
1043
|
+
highlightContext: string;
|
|
1044
|
+
highlightEntity: string;
|
|
1045
|
+
highlightProperty: string;
|
|
1046
|
+
highlightAction: string;
|
|
1047
|
+
highlightBackground: string;
|
|
1048
|
+
highlightText: string;
|
|
1049
|
+
highlightHover: string;
|
|
1050
|
+
highlightSeparator: string;
|
|
1051
|
+
};
|
|
1052
|
+
typography: {
|
|
1053
|
+
fontFamily: string;
|
|
1054
|
+
fontMono: string;
|
|
1055
|
+
fontSize: {
|
|
1056
|
+
base: string;
|
|
1057
|
+
label: string;
|
|
1058
|
+
toggle: string;
|
|
1059
|
+
highlightButton: string;
|
|
1060
|
+
};
|
|
1061
|
+
fontWeight: {
|
|
1062
|
+
normal: number;
|
|
1063
|
+
semibold: number;
|
|
1064
|
+
};
|
|
1065
|
+
lineHeight: {
|
|
1066
|
+
base: number;
|
|
1067
|
+
};
|
|
1068
|
+
};
|
|
1069
|
+
spacing: {
|
|
1070
|
+
header: string;
|
|
1071
|
+
footer: string;
|
|
1072
|
+
button: string;
|
|
1073
|
+
buttonGroup: string;
|
|
1074
|
+
gridGap: string;
|
|
1075
|
+
};
|
|
1076
|
+
radius: {
|
|
1077
|
+
box: string;
|
|
1078
|
+
button: string;
|
|
1079
|
+
buttonGroup: string;
|
|
1080
|
+
highlightButton: string;
|
|
1081
|
+
};
|
|
1082
|
+
shadows: {
|
|
1083
|
+
buttonActive: string;
|
|
1084
|
+
dropdown: string;
|
|
1085
|
+
};
|
|
1086
|
+
grid: {
|
|
1087
|
+
minBoxWidth: string;
|
|
1088
|
+
rowMinHeight: string;
|
|
1089
|
+
rowMaxHeight: string;
|
|
1090
|
+
boxMaxHeightMobile: string;
|
|
1091
|
+
};
|
|
1092
|
+
monaco: {
|
|
1093
|
+
theme: string;
|
|
1094
|
+
fontSize: string;
|
|
1095
|
+
lineHeight: string;
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
/**
|
|
1100
|
+
* Register all Monaco themes
|
|
1101
|
+
* Convenience function for registering both themes at once
|
|
1102
|
+
*
|
|
1103
|
+
* @example
|
|
1104
|
+
* ```typescript
|
|
1105
|
+
* import { registerAllThemes } from '@walkeros/explorer';
|
|
1106
|
+
* import * as monaco from 'monaco-editor';
|
|
1107
|
+
*
|
|
1108
|
+
* registerAllThemes(monaco);
|
|
1109
|
+
* ```
|
|
1110
|
+
*/
|
|
1111
|
+
declare function registerAllThemes(monaco: typeof monaco_editor): void;
|
|
1112
|
+
|
|
1113
|
+
/**
|
|
1114
|
+
* Monaco Editor TypeScript Type Management
|
|
1115
|
+
*
|
|
1116
|
+
* This utility manages TypeScript type definitions in Monaco Editor for:
|
|
1117
|
+
* 1. Static walkerOS core types (bundled at build time via Vite ?raw import)
|
|
1118
|
+
* 2. Dynamic destination types (loaded on-the-fly when destinations are added)
|
|
1119
|
+
* 3. Context-specific function signatures (condition, fn, validate)
|
|
1120
|
+
*
|
|
1121
|
+
* Architecture:
|
|
1122
|
+
* - Uses monaco.languages.typescript.typescriptDefaults.addExtraLib()
|
|
1123
|
+
* - Each type definition gets a unique file path (e.g., 'file:///destinations/gtag.d.ts')
|
|
1124
|
+
* - Types can be added/removed dynamically without page reload
|
|
1125
|
+
* - Core types are bundled for offline support and predictable versioning
|
|
1126
|
+
*/
|
|
1127
|
+
|
|
1128
|
+
/**
|
|
1129
|
+
* Load type definitions from a URL
|
|
1130
|
+
*
|
|
1131
|
+
* @param monaco - Monaco instance
|
|
1132
|
+
* @param url - URL to .d.ts file
|
|
1133
|
+
* @param uri - Optional custom URI (defaults to URL)
|
|
1134
|
+
*/
|
|
1135
|
+
declare function loadTypeLibraryFromURL(monaco: Monaco, url: string, uri?: string): Promise<boolean>;
|
|
1136
|
+
/**
|
|
1137
|
+
* Options for loading package types dynamically
|
|
1138
|
+
*/
|
|
1139
|
+
interface LoadPackageTypesOptions {
|
|
1140
|
+
/** Package name (e.g., '@walkeros/destination-gtag') */
|
|
1141
|
+
package: string;
|
|
1142
|
+
/** Version to load (e.g., '0.1.0', 'latest') */
|
|
1143
|
+
version?: string;
|
|
1144
|
+
/** CDN to use ('unpkg' or 'jsdelivr') */
|
|
1145
|
+
cdn?: 'unpkg' | 'jsdelivr';
|
|
1146
|
+
/** Path to .d.ts file within package (defaults to '/dist/index.d.ts') */
|
|
1147
|
+
typesPath?: string;
|
|
1148
|
+
}
|
|
1149
|
+
interface LoadPackageTypesOptions {
|
|
1150
|
+
package: string;
|
|
1151
|
+
version?: string;
|
|
1152
|
+
}
|
|
1153
|
+
declare function loadPackageTypes(monaco: Monaco, options: LoadPackageTypesOptions): Promise<boolean>;
|
|
1154
|
+
/**
|
|
1155
|
+
* Simple helper to register only walkerOS core types
|
|
1156
|
+
*
|
|
1157
|
+
* Use this for basic scenarios where you just need @walkeros/core types.
|
|
1158
|
+
* For advanced usage (destinations, function contexts), use initializeMonacoTypes.
|
|
1159
|
+
*
|
|
1160
|
+
* @param monaco - Monaco editor instance
|
|
1161
|
+
*
|
|
1162
|
+
* @example
|
|
1163
|
+
* ```typescript
|
|
1164
|
+
* const handleBeforeMount = (monaco: Monaco) => {
|
|
1165
|
+
* registerWalkerOSTypes(monaco);
|
|
1166
|
+
* };
|
|
1167
|
+
* ```
|
|
1168
|
+
*/
|
|
1169
|
+
declare function registerWalkerOSTypes(monaco: Monaco): void;
|
|
1170
|
+
/**
|
|
1171
|
+
* Initialize Monaco with walkerOS types (full setup)
|
|
1172
|
+
*
|
|
1173
|
+
* Call this once in CodeBox's beforeMount handler.
|
|
1174
|
+
* Includes core types, TypeScript config, and default function context.
|
|
1175
|
+
*
|
|
1176
|
+
* @param monaco - Monaco editor instance
|
|
1177
|
+
*
|
|
1178
|
+
* @example
|
|
1179
|
+
* ```typescript
|
|
1180
|
+
* const handleBeforeMount = (monaco: Monaco) => {
|
|
1181
|
+
* initializeMonacoTypes(monaco);
|
|
1182
|
+
* };
|
|
1183
|
+
* ```
|
|
1184
|
+
*/
|
|
1185
|
+
declare function initializeMonacoTypes(monaco: Monaco): void;
|
|
1186
|
+
|
|
1187
|
+
/**
|
|
1188
|
+
* Formats captured function calls for display
|
|
1189
|
+
*
|
|
1190
|
+
* @param calls - Array of captured calls with path and args
|
|
1191
|
+
* @param defaultMessage - Message to show when no calls captured
|
|
1192
|
+
* @returns Formatted string of function calls
|
|
1193
|
+
*
|
|
1194
|
+
* @example
|
|
1195
|
+
* formatCapturedCalls([
|
|
1196
|
+
* { path: ['window', 'gtag'], args: ['config', 'G-XXX'] }
|
|
1197
|
+
* ])
|
|
1198
|
+
* // Returns: "gtag('config', 'G-XXX');"
|
|
1199
|
+
*/
|
|
1200
|
+
declare function formatCapturedCalls(calls: Array<{
|
|
1201
|
+
path: string[];
|
|
1202
|
+
args: unknown[];
|
|
1203
|
+
}>, defaultMessage?: string): string;
|
|
1204
|
+
/**
|
|
1205
|
+
* Creates a capture function for destination push method
|
|
1206
|
+
* Uses walkerOS core mockEnv to intercept function calls
|
|
1207
|
+
*
|
|
1208
|
+
* @param destination - Destination instance with push method
|
|
1209
|
+
* @param destinationEnv - Destination's exported env (usually examples.env.push)
|
|
1210
|
+
* @returns Async function that executes push and returns formatted output
|
|
1211
|
+
*
|
|
1212
|
+
* @example
|
|
1213
|
+
* import destinationGtag, { examples } from '@walkeros/web-destination-gtag';
|
|
1214
|
+
* import { getEvent } from '@walkeros/core';
|
|
1215
|
+
*
|
|
1216
|
+
* const captureFn = captureDestinationPush(destinationGtag, examples.env.push);
|
|
1217
|
+
*
|
|
1218
|
+
* // Use in DestinationDemo
|
|
1219
|
+
* <DestinationDemo
|
|
1220
|
+
* destination={destinationGtag}
|
|
1221
|
+
* event={getEvent('order complete')}
|
|
1222
|
+
* mapping={examples.mapping.purchase}
|
|
1223
|
+
* fn={captureFn}
|
|
1224
|
+
* />
|
|
1225
|
+
*/
|
|
1226
|
+
declare function captureDestinationPush(destination: Destination.Instance, destinationEnv: unknown): (event: WalkerOS.Event, context: Destination.PushContext) => Promise<string>;
|
|
1227
|
+
/**
|
|
1228
|
+
* Advanced: Creates a raw capture function that returns call data
|
|
1229
|
+
* Use this when you need custom formatting or processing of calls
|
|
1230
|
+
*
|
|
1231
|
+
* @param destinationEnv - Destination's exported env
|
|
1232
|
+
* @returns Function that returns both env and getCalls function
|
|
1233
|
+
*
|
|
1234
|
+
* @example
|
|
1235
|
+
* const { env, getCalls } = createRawCapture(examples.env.push);
|
|
1236
|
+
* await destination.init({ ...context, env });
|
|
1237
|
+
* const calls = getCalls();
|
|
1238
|
+
* // Process calls as needed
|
|
1239
|
+
*/
|
|
1240
|
+
declare function createRawCapture(destinationEnv: unknown): {
|
|
1241
|
+
env: Record<string, unknown>;
|
|
1242
|
+
getCalls: () => {
|
|
1243
|
+
path: string[];
|
|
1244
|
+
args: unknown[];
|
|
1245
|
+
}[];
|
|
1246
|
+
};
|
|
1247
|
+
|
|
1248
|
+
export { Box, type BoxProps, BrowserBox, type BrowserBoxProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Code, CodeBox, type CodeBoxProps, type CodeProps, CodeSnippet, type CodeSnippetProps, CollectorBox, type CollectorBoxProps, ConfigEditor, type ConfigEditorBoxProps, DESTINATION_CONFIG_STRUCTURE, DestinationDemo, type DestinationDemoProps, DestinationInitDemo as DestinationInit, DestinationInitDemo, type DestinationInitDemoProps, DestinationDemo as DestinationPush, type DestinationSchemas, type ExplorerTheme, Footer, type FooterProps, Grid, type GridProps, Header, type HeaderProps, type HintItem, LiveCode, type LiveCodeProps, type LoadPackageTypesOptions, MAPPING_RULE_STRUCTURE, MDXCode, MDXProvider, MappingCode, type MappingCodeProps, MappingDemo, type MappingDemoProps, MappingKeyField, MappingKeyWidget, PanelHints, type PanelHintsProps, Preview, type PreviewProps, PromotionPlayground, type PromotionPlaygroundProps, PropertyTable, type PropertyTableProps, captureDestinationPush, cn, createCaptureFn, createFbqDestination, createGtagDestination, createPlausibleDestination, createRawCapture, formatCapturedCalls, initializeMonacoTypes, lighthouseTheme, loadPackageTypes, loadTypeLibraryFromURL, palenightTheme, registerAllThemes, registerLighthouseTheme, registerPalenightTheme, registerWalkerOSTypes };
|