@wallarm-org/design-system 1.30.0 → 1.31.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/components/CodeEditor/CodeEditorContent.d.ts +17 -0
- package/dist/components/CodeEditor/CodeEditorContent.js +197 -0
- package/dist/components/CodeEditor/CodeEditorContext.d.ts +17 -0
- package/dist/components/CodeEditor/CodeEditorContext.js +8 -0
- package/dist/components/CodeEditor/CodeEditorRoot.d.ts +77 -0
- package/dist/components/CodeEditor/CodeEditorRoot.js +203 -0
- package/dist/components/CodeEditor/classes.d.ts +21 -0
- package/dist/components/CodeEditor/classes.js +41 -0
- package/dist/components/CodeEditor/engine/SearchPanel.d.ts +13 -0
- package/dist/components/CodeEditor/engine/SearchPanel.js +201 -0
- package/dist/components/CodeEditor/engine/adapterPainter.d.ts +23 -0
- package/dist/components/CodeEditor/engine/adapterPainter.js +110 -0
- package/dist/components/CodeEditor/engine/babelSyntax.d.ts +15 -0
- package/dist/components/CodeEditor/engine/babelSyntax.js +54 -0
- package/dist/components/CodeEditor/engine/completion.d.ts +17 -0
- package/dist/components/CodeEditor/engine/completion.js +129 -0
- package/dist/components/CodeEditor/engine/contentAttributes.d.ts +12 -0
- package/dist/components/CodeEditor/engine/contentAttributes.js +24 -0
- package/dist/components/CodeEditor/engine/diagnostics.d.ts +73 -0
- package/dist/components/CodeEditor/engine/diagnostics.js +327 -0
- package/dist/components/CodeEditor/engine/diff.d.ts +37 -0
- package/dist/components/CodeEditor/engine/diff.js +145 -0
- package/dist/components/CodeEditor/engine/folds.d.ts +25 -0
- package/dist/components/CodeEditor/engine/folds.js +458 -0
- package/dist/components/CodeEditor/engine/gutters.d.ts +22 -0
- package/dist/components/CodeEditor/engine/gutters.js +160 -0
- package/dist/components/CodeEditor/engine/index.d.ts +12 -0
- package/dist/components/CodeEditor/engine/index.js +387 -0
- package/dist/components/CodeEditor/engine/languages/http/index.d.ts +20 -0
- package/dist/components/CodeEditor/engine/languages/http/index.js +69 -0
- package/dist/components/CodeEditor/engine/languages/http/parser.d.ts +2 -0
- package/dist/components/CodeEditor/engine/languages/http/parser.js +31 -0
- package/dist/components/CodeEditor/engine/languages/http/parser.terms.d.ts +1 -0
- package/dist/components/CodeEditor/engine/languages/http/parser.terms.js +2 -0
- package/dist/components/CodeEditor/engine/languages/index.d.ts +8 -0
- package/dist/components/CodeEditor/engine/languages/index.js +41 -0
- package/dist/components/CodeEditor/engine/languages/json.d.ts +8 -0
- package/dist/components/CodeEditor/engine/languages/json.js +11 -0
- package/dist/components/CodeEditor/engine/languages/jsonPointers.d.ts +47 -0
- package/dist/components/CodeEditor/engine/languages/jsonPointers.js +125 -0
- package/dist/components/CodeEditor/engine/languages/yaml.d.ts +4 -0
- package/dist/components/CodeEditor/engine/languages/yaml.js +11 -0
- package/dist/components/CodeEditor/engine/lines.d.ts +22 -0
- package/dist/components/CodeEditor/engine/lines.js +131 -0
- package/dist/components/CodeEditor/engine/luaSyntax.d.ts +14 -0
- package/dist/components/CodeEditor/engine/luaSyntax.js +36 -0
- package/dist/components/CodeEditor/engine/positions.d.ts +19 -0
- package/dist/components/CodeEditor/engine/positions.js +22 -0
- package/dist/components/CodeEditor/engine/schema/complete.d.ts +12 -0
- package/dist/components/CodeEditor/engine/schema/complete.js +211 -0
- package/dist/components/CodeEditor/engine/schema/hover.d.ts +12 -0
- package/dist/components/CodeEditor/engine/schema/hover.js +73 -0
- package/dist/components/CodeEditor/engine/schema/loadSchema.d.ts +19 -0
- package/dist/components/CodeEditor/engine/schema/loadSchema.js +32 -0
- package/dist/components/CodeEditor/engine/schema/validate.d.ts +9 -0
- package/dist/components/CodeEditor/engine/schema/validate.js +67 -0
- package/dist/components/CodeEditor/engine/search.d.ts +13 -0
- package/dist/components/CodeEditor/engine/search.js +84 -0
- package/dist/components/CodeEditor/engine/searchMatches.d.ts +8 -0
- package/dist/components/CodeEditor/engine/searchMatches.js +15 -0
- package/dist/components/CodeEditor/engine/theme.d.ts +8 -0
- package/dist/components/CodeEditor/engine/theme.js +89 -0
- package/dist/components/CodeEditor/engine/types.d.ts +44 -0
- package/dist/components/CodeEditor/engine/types.js +0 -0
- package/dist/components/CodeEditor/hooks/useCodeEditor.d.ts +6 -0
- package/dist/components/CodeEditor/hooks/useCodeEditor.js +3 -0
- package/dist/components/CodeEditor/index.d.ts +6 -0
- package/dist/components/CodeEditor/index.js +5 -0
- package/dist/components/CodeEditor/lib/PortalOutlet.d.ts +11 -0
- package/dist/components/CodeEditor/lib/PortalOutlet.js +11 -0
- package/dist/components/CodeEditor/lib/httpCompletions.d.ts +7 -0
- package/dist/components/CodeEditor/lib/httpCompletions.js +102 -0
- package/dist/components/CodeEditor/lib/httpCompletionsData.d.ts +29 -0
- package/dist/components/CodeEditor/lib/httpCompletionsData.js +650 -0
- package/dist/components/CodeEditor/lib/keyboardHint.d.ts +5 -0
- package/dist/components/CodeEditor/lib/keyboardHint.js +2 -0
- package/dist/components/CodeEditor/lib/loadEngine.d.ts +7 -0
- package/dist/components/CodeEditor/lib/loadEngine.js +9 -0
- package/dist/components/CodeEditor/lib/portalRegistry.d.ts +20 -0
- package/dist/components/CodeEditor/lib/portalRegistry.js +47 -0
- package/dist/components/CodeEditor/lib/splitContentProps.d.ts +12 -0
- package/dist/components/CodeEditor/lib/splitContentProps.js +28 -0
- package/dist/components/CodeEditor/types.d.ts +72 -0
- package/dist/components/CodeEditor/types.js +0 -0
- package/dist/components/CodeSnippet/CodeSnippetCode.js +6 -23
- package/dist/components/CodeSnippet/CodeSnippetCopyButton.js +4 -3
- package/dist/components/CodeSnippet/CodeSnippetFrameContext.d.ts +25 -0
- package/dist/components/CodeSnippet/CodeSnippetFrameContext.js +3 -0
- package/dist/components/CodeSnippet/CodeSnippetFullscreenButton.js +2 -2
- package/dist/components/CodeSnippet/CodeSnippetRoot.d.ts +3 -5
- package/dist/components/CodeSnippet/CodeSnippetRoot.js +56 -50
- package/dist/components/CodeSnippet/CodeSnippetShowMoreButton.js +7 -5
- package/dist/components/CodeSnippet/CodeSnippetWrapButton.js +2 -2
- package/dist/components/CodeSnippet/adapters/highlightjs.js +1 -0
- package/dist/components/CodeSnippet/adapters/prism.js +3 -1
- package/dist/components/CodeSnippet/adapters/shiki.js +1 -0
- package/dist/components/CodeSnippet/adapters/types.d.ts +3 -3
- package/dist/components/CodeSnippet/classes.d.ts +3 -0
- package/dist/components/CodeSnippet/classes.js +14 -0
- package/dist/components/CodeSnippet/hooks/index.d.ts +1 -0
- package/dist/components/CodeSnippet/hooks/index.js +1 -0
- package/dist/components/CodeSnippet/hooks/useCodeSnippetFrame.d.ts +2 -0
- package/dist/components/CodeSnippet/hooks/useCodeSnippetFrame.js +8 -0
- package/dist/components/CodeSnippet/index.d.ts +2 -1
- package/dist/components/CodeSnippet/index.js +1 -1
- package/dist/components/CodeSnippet/internal/CodeSnippetFrame.d.ts +22 -0
- package/dist/components/CodeSnippet/internal/CodeSnippetFrame.js +81 -0
- package/dist/components/CodeSnippet/internal/CodeToken.d.ts +2 -1
- package/dist/components/CodeSnippet/internal/CodeToken.js +1 -1
- package/dist/components/CodeSnippet/internal/FoldSummary.d.ts +11 -0
- package/dist/components/CodeSnippet/internal/FoldSummary.js +27 -0
- package/dist/components/CodeSnippet/internal/FoldToggle.d.ts +2 -0
- package/dist/components/CodeSnippet/internal/FoldToggle.js +2 -1
- package/dist/components/CodeSnippet/internal/index.d.ts +1 -0
- package/dist/components/CodeSnippet/internal/index.js +1 -0
- package/dist/components/CodeSnippet/lib/foldUtils.d.ts +9 -2
- package/dist/components/CodeSnippet/lib/foldUtils.js +2 -2
- package/dist/components/CodeSnippet/lib/showMore.d.ts +7 -0
- package/dist/components/CodeSnippet/lib/showMore.js +7 -0
- package/dist/components/Copyable/Copyable.d.ts +5 -2
- package/dist/components/Copyable/Copyable.js +1 -1
- package/dist/metadata/components.json +1235 -5
- package/package.json +24 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
3
|
-
"generatedAt": "2026-
|
|
2
|
+
"version": "1.30.0",
|
|
3
|
+
"generatedAt": "2026-10-01T07:56:09.079Z",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"name": "Accordion",
|
|
@@ -19175,12 +19175,1242 @@
|
|
|
19175
19175
|
}
|
|
19176
19176
|
]
|
|
19177
19177
|
},
|
|
19178
|
+
{
|
|
19179
|
+
"name": "CodeEditor",
|
|
19180
|
+
"description": "Editable code surface (CodeMirror 6, lazy-loaded) that looks like CodeSnippet and reuses\nits chrome: syntax-adapter colours, gutters, lines, folds, copy/wrap/fullscreen/show-more,\nplus find/replace, diagnostics, JSON Schema, autocomplete and diff against an original.",
|
|
19181
|
+
"importPath": "@wallarm-org/design-system/CodeEditor",
|
|
19182
|
+
"props": [
|
|
19183
|
+
{
|
|
19184
|
+
"name": "value",
|
|
19185
|
+
"type": "string | undefined",
|
|
19186
|
+
"required": false,
|
|
19187
|
+
"description": "Controlled document"
|
|
19188
|
+
},
|
|
19189
|
+
{
|
|
19190
|
+
"name": "defaultValue",
|
|
19191
|
+
"type": "string | undefined",
|
|
19192
|
+
"required": false,
|
|
19193
|
+
"description": "Uncontrolled initial document (controlled vs uncontrolled is locked on first render)"
|
|
19194
|
+
},
|
|
19195
|
+
{
|
|
19196
|
+
"name": "language",
|
|
19197
|
+
"type": "CodeEditorLanguage | undefined",
|
|
19198
|
+
"required": false,
|
|
19199
|
+
"description": "Passed verbatim to the syntax adapter; selects the structural parser"
|
|
19200
|
+
},
|
|
19201
|
+
{
|
|
19202
|
+
"name": "documentId",
|
|
19203
|
+
"type": "string | undefined",
|
|
19204
|
+
"required": false,
|
|
19205
|
+
"description": "Document identity: changing it swaps to that document's cached state (undo history,\nselection, folds). Requires a controlled `value`: when the id changes, `value` must already\nhold that document's text (an uncached id starts from `value`). In uncontrolled mode the new\ndocument would be seeded with the previous document's text."
|
|
19206
|
+
},
|
|
19207
|
+
{
|
|
19208
|
+
"name": "readOnly",
|
|
19209
|
+
"type": "boolean | undefined",
|
|
19210
|
+
"required": false,
|
|
19211
|
+
"description": "Focusable, selectable, searchable, copyable — but not editable by the user"
|
|
19212
|
+
},
|
|
19213
|
+
{
|
|
19214
|
+
"name": "startingLineNumber",
|
|
19215
|
+
"type": "number | undefined",
|
|
19216
|
+
"required": false,
|
|
19217
|
+
"description": "Offsets gutter numbers; `lines`, `folds`, `diagnostics` use absolute numbers"
|
|
19218
|
+
},
|
|
19219
|
+
{
|
|
19220
|
+
"name": "lines",
|
|
19221
|
+
"type": "Record<number, LineConfig> | undefined",
|
|
19222
|
+
"required": false,
|
|
19223
|
+
"description": "Per-line configuration keyed by absolute line number (static, see spec D6).\nCompared by identity: memoise it (or hoist it to a constant) — a new object\nevery render reconfigures the lines and gutters on every render."
|
|
19224
|
+
},
|
|
19225
|
+
{
|
|
19226
|
+
"name": "folds",
|
|
19227
|
+
"type": "CodeEditorFolds | undefined",
|
|
19228
|
+
"required": false,
|
|
19229
|
+
"description": "Fold regions, or a function re-run after edits; collapsed state is kept by `id`.\nCompared by identity: memoise the array or pass a stable function (e.g. `getHttpFolds`) —\nan inline array/arrow reconfigures folds on every render and bypasses the re-run debounce."
|
|
19230
|
+
},
|
|
19231
|
+
{
|
|
19232
|
+
"name": "wrapLines",
|
|
19233
|
+
"type": "boolean | undefined",
|
|
19234
|
+
"required": false,
|
|
19235
|
+
"description": "Controlled line wrapping"
|
|
19236
|
+
},
|
|
19237
|
+
{
|
|
19238
|
+
"name": "defaultWrapLines",
|
|
19239
|
+
"type": "boolean | undefined",
|
|
19240
|
+
"required": false,
|
|
19241
|
+
"description": "Uncontrolled initial line wrapping"
|
|
19242
|
+
},
|
|
19243
|
+
{
|
|
19244
|
+
"name": "maxLines",
|
|
19245
|
+
"type": "number | undefined",
|
|
19246
|
+
"required": false,
|
|
19247
|
+
"description": "Height clamp in rows; auto-renders `CodeSnippetShowMoreButton` unless one is a direct child"
|
|
19248
|
+
},
|
|
19249
|
+
{
|
|
19250
|
+
"name": "original",
|
|
19251
|
+
"type": "string | undefined",
|
|
19252
|
+
"required": false,
|
|
19253
|
+
"description": "Enables diff mode against this text"
|
|
19254
|
+
},
|
|
19255
|
+
{
|
|
19256
|
+
"name": "schema",
|
|
19257
|
+
"type": "JsonSchema | undefined",
|
|
19258
|
+
"required": false,
|
|
19259
|
+
"description": "JSON Schema for the document (`json`) or the JSON body (`http`)"
|
|
19260
|
+
},
|
|
19261
|
+
{
|
|
19262
|
+
"name": "completions",
|
|
19263
|
+
"type": "CodeEditorCompletionSource[] | undefined",
|
|
19264
|
+
"required": false,
|
|
19265
|
+
"description": "Consumer completion sources, added after the built-in ones. Compared by identity: a new\narray reconfigures autocomplete and closes an open list, so keep it stable (module constant\nor `useMemo`)."
|
|
19266
|
+
},
|
|
19267
|
+
{
|
|
19268
|
+
"name": "diagnostics",
|
|
19269
|
+
"type": "CodeEditorDiagnostic[] | undefined",
|
|
19270
|
+
"required": false,
|
|
19271
|
+
"description": "External diagnostics, merged with syntax and schema ones"
|
|
19272
|
+
},
|
|
19273
|
+
{
|
|
19274
|
+
"name": "apiRef",
|
|
19275
|
+
"type": "Ref<CodeEditorApi> | undefined",
|
|
19276
|
+
"required": false,
|
|
19277
|
+
"description": "Imperative handle"
|
|
19278
|
+
},
|
|
19279
|
+
{
|
|
19280
|
+
"name": "cspNonce",
|
|
19281
|
+
"type": "string | undefined",
|
|
19282
|
+
"required": false,
|
|
19283
|
+
"description": "Nonce for the style tags the editor injects"
|
|
19284
|
+
},
|
|
19285
|
+
{
|
|
19286
|
+
"name": "contentEditable",
|
|
19287
|
+
"type": "Booleanish | \"inherit\" | \"plaintext-only\" | undefined",
|
|
19288
|
+
"required": false
|
|
19289
|
+
},
|
|
19290
|
+
{
|
|
19291
|
+
"name": "role",
|
|
19292
|
+
"type": "AriaRole | undefined",
|
|
19293
|
+
"required": false
|
|
19294
|
+
},
|
|
19295
|
+
{
|
|
19296
|
+
"name": "defaultChecked",
|
|
19297
|
+
"type": "boolean | undefined",
|
|
19298
|
+
"required": false
|
|
19299
|
+
},
|
|
19300
|
+
{
|
|
19301
|
+
"name": "suppressContentEditableWarning",
|
|
19302
|
+
"type": "boolean | undefined",
|
|
19303
|
+
"required": false
|
|
19304
|
+
},
|
|
19305
|
+
{
|
|
19306
|
+
"name": "suppressHydrationWarning",
|
|
19307
|
+
"type": "boolean | undefined",
|
|
19308
|
+
"required": false
|
|
19309
|
+
},
|
|
19310
|
+
{
|
|
19311
|
+
"name": "accessKey",
|
|
19312
|
+
"type": "string | undefined",
|
|
19313
|
+
"required": false
|
|
19314
|
+
},
|
|
19315
|
+
{
|
|
19316
|
+
"name": "autoCapitalize",
|
|
19317
|
+
"type": "\"off\" | \"none\" | \"on\" | \"sentences\" | \"words\" | \"characters\" | (string & {}) | undefined",
|
|
19318
|
+
"required": false
|
|
19319
|
+
},
|
|
19320
|
+
{
|
|
19321
|
+
"name": "autoFocus",
|
|
19322
|
+
"type": "boolean | undefined",
|
|
19323
|
+
"required": false
|
|
19324
|
+
},
|
|
19325
|
+
{
|
|
19326
|
+
"name": "contextMenu",
|
|
19327
|
+
"type": "string | undefined",
|
|
19328
|
+
"required": false
|
|
19329
|
+
},
|
|
19330
|
+
{
|
|
19331
|
+
"name": "dir",
|
|
19332
|
+
"type": "string | undefined",
|
|
19333
|
+
"required": false
|
|
19334
|
+
},
|
|
19335
|
+
{
|
|
19336
|
+
"name": "draggable",
|
|
19337
|
+
"type": "Booleanish | undefined",
|
|
19338
|
+
"required": false
|
|
19339
|
+
},
|
|
19340
|
+
{
|
|
19341
|
+
"name": "enterKeyHint",
|
|
19342
|
+
"type": "\"enter\" | \"done\" | \"go\" | \"next\" | \"previous\" | \"search\" | \"send\" | undefined",
|
|
19343
|
+
"required": false
|
|
19344
|
+
},
|
|
19345
|
+
{
|
|
19346
|
+
"name": "hidden",
|
|
19347
|
+
"type": "boolean | undefined",
|
|
19348
|
+
"required": false
|
|
19349
|
+
},
|
|
19350
|
+
{
|
|
19351
|
+
"name": "id",
|
|
19352
|
+
"type": "string | undefined",
|
|
19353
|
+
"required": false
|
|
19354
|
+
},
|
|
19355
|
+
{
|
|
19356
|
+
"name": "lang",
|
|
19357
|
+
"type": "string | undefined",
|
|
19358
|
+
"required": false
|
|
19359
|
+
},
|
|
19360
|
+
{
|
|
19361
|
+
"name": "nonce",
|
|
19362
|
+
"type": "string | undefined",
|
|
19363
|
+
"required": false
|
|
19364
|
+
},
|
|
19365
|
+
{
|
|
19366
|
+
"name": "slot",
|
|
19367
|
+
"type": "string | undefined",
|
|
19368
|
+
"required": false
|
|
19369
|
+
},
|
|
19370
|
+
{
|
|
19371
|
+
"name": "spellCheck",
|
|
19372
|
+
"type": "Booleanish | undefined",
|
|
19373
|
+
"required": false
|
|
19374
|
+
},
|
|
19375
|
+
{
|
|
19376
|
+
"name": "tabIndex",
|
|
19377
|
+
"type": "number | undefined",
|
|
19378
|
+
"required": false
|
|
19379
|
+
},
|
|
19380
|
+
{
|
|
19381
|
+
"name": "title",
|
|
19382
|
+
"type": "string | undefined",
|
|
19383
|
+
"required": false
|
|
19384
|
+
},
|
|
19385
|
+
{
|
|
19386
|
+
"name": "translate",
|
|
19387
|
+
"type": "\"yes\" | \"no\" | undefined",
|
|
19388
|
+
"required": false
|
|
19389
|
+
},
|
|
19390
|
+
{
|
|
19391
|
+
"name": "radioGroup",
|
|
19392
|
+
"type": "string | undefined",
|
|
19393
|
+
"required": false
|
|
19394
|
+
},
|
|
19395
|
+
{
|
|
19396
|
+
"name": "about",
|
|
19397
|
+
"type": "string | undefined",
|
|
19398
|
+
"required": false
|
|
19399
|
+
},
|
|
19400
|
+
{
|
|
19401
|
+
"name": "content",
|
|
19402
|
+
"type": "string | undefined",
|
|
19403
|
+
"required": false
|
|
19404
|
+
},
|
|
19405
|
+
{
|
|
19406
|
+
"name": "datatype",
|
|
19407
|
+
"type": "string | undefined",
|
|
19408
|
+
"required": false
|
|
19409
|
+
},
|
|
19410
|
+
{
|
|
19411
|
+
"name": "inlist",
|
|
19412
|
+
"type": "any",
|
|
19413
|
+
"required": false
|
|
19414
|
+
},
|
|
19415
|
+
{
|
|
19416
|
+
"name": "prefix",
|
|
19417
|
+
"type": "string | undefined",
|
|
19418
|
+
"required": false
|
|
19419
|
+
},
|
|
19420
|
+
{
|
|
19421
|
+
"name": "property",
|
|
19422
|
+
"type": "string | undefined",
|
|
19423
|
+
"required": false
|
|
19424
|
+
},
|
|
19425
|
+
{
|
|
19426
|
+
"name": "rel",
|
|
19427
|
+
"type": "string | undefined",
|
|
19428
|
+
"required": false
|
|
19429
|
+
},
|
|
19430
|
+
{
|
|
19431
|
+
"name": "resource",
|
|
19432
|
+
"type": "string | undefined",
|
|
19433
|
+
"required": false
|
|
19434
|
+
},
|
|
19435
|
+
{
|
|
19436
|
+
"name": "rev",
|
|
19437
|
+
"type": "string | undefined",
|
|
19438
|
+
"required": false
|
|
19439
|
+
},
|
|
19440
|
+
{
|
|
19441
|
+
"name": "typeof",
|
|
19442
|
+
"type": "string | undefined",
|
|
19443
|
+
"required": false
|
|
19444
|
+
},
|
|
19445
|
+
{
|
|
19446
|
+
"name": "vocab",
|
|
19447
|
+
"type": "string | undefined",
|
|
19448
|
+
"required": false
|
|
19449
|
+
},
|
|
19450
|
+
{
|
|
19451
|
+
"name": "autoCorrect",
|
|
19452
|
+
"type": "string | undefined",
|
|
19453
|
+
"required": false
|
|
19454
|
+
},
|
|
19455
|
+
{
|
|
19456
|
+
"name": "autoSave",
|
|
19457
|
+
"type": "string | undefined",
|
|
19458
|
+
"required": false
|
|
19459
|
+
},
|
|
19460
|
+
{
|
|
19461
|
+
"name": "color",
|
|
19462
|
+
"type": "string | undefined",
|
|
19463
|
+
"required": false
|
|
19464
|
+
},
|
|
19465
|
+
{
|
|
19466
|
+
"name": "itemProp",
|
|
19467
|
+
"type": "string | undefined",
|
|
19468
|
+
"required": false
|
|
19469
|
+
},
|
|
19470
|
+
{
|
|
19471
|
+
"name": "itemScope",
|
|
19472
|
+
"type": "boolean | undefined",
|
|
19473
|
+
"required": false
|
|
19474
|
+
},
|
|
19475
|
+
{
|
|
19476
|
+
"name": "itemType",
|
|
19477
|
+
"type": "string | undefined",
|
|
19478
|
+
"required": false
|
|
19479
|
+
},
|
|
19480
|
+
{
|
|
19481
|
+
"name": "itemID",
|
|
19482
|
+
"type": "string | undefined",
|
|
19483
|
+
"required": false
|
|
19484
|
+
},
|
|
19485
|
+
{
|
|
19486
|
+
"name": "itemRef",
|
|
19487
|
+
"type": "string | undefined",
|
|
19488
|
+
"required": false
|
|
19489
|
+
},
|
|
19490
|
+
{
|
|
19491
|
+
"name": "results",
|
|
19492
|
+
"type": "number | undefined",
|
|
19493
|
+
"required": false
|
|
19494
|
+
},
|
|
19495
|
+
{
|
|
19496
|
+
"name": "security",
|
|
19497
|
+
"type": "string | undefined",
|
|
19498
|
+
"required": false
|
|
19499
|
+
},
|
|
19500
|
+
{
|
|
19501
|
+
"name": "unselectable",
|
|
19502
|
+
"type": "\"off\" | \"on\" | undefined",
|
|
19503
|
+
"required": false
|
|
19504
|
+
},
|
|
19505
|
+
{
|
|
19506
|
+
"name": "popover",
|
|
19507
|
+
"type": "\"\" | \"auto\" | \"manual\" | \"hint\" | undefined",
|
|
19508
|
+
"required": false
|
|
19509
|
+
},
|
|
19510
|
+
{
|
|
19511
|
+
"name": "popoverTargetAction",
|
|
19512
|
+
"type": "\"toggle\" | \"show\" | \"hide\" | undefined",
|
|
19513
|
+
"required": false
|
|
19514
|
+
},
|
|
19515
|
+
{
|
|
19516
|
+
"name": "popoverTarget",
|
|
19517
|
+
"type": "string | undefined",
|
|
19518
|
+
"required": false
|
|
19519
|
+
},
|
|
19520
|
+
{
|
|
19521
|
+
"name": "inert",
|
|
19522
|
+
"type": "boolean | undefined",
|
|
19523
|
+
"required": false,
|
|
19524
|
+
"description": "@see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert}"
|
|
19525
|
+
},
|
|
19526
|
+
{
|
|
19527
|
+
"name": "inputMode",
|
|
19528
|
+
"type": "\"none\" | \"search\" | \"text\" | \"tel\" | \"url\" | \"email\" | \"numeric\" | \"decimal\" | undefined",
|
|
19529
|
+
"required": false,
|
|
19530
|
+
"description": "Hints at the type of data that might be entered by the user while editing the element or its contents"
|
|
19531
|
+
},
|
|
19532
|
+
{
|
|
19533
|
+
"name": "is",
|
|
19534
|
+
"type": "string | undefined",
|
|
19535
|
+
"required": false,
|
|
19536
|
+
"description": "Specify that a standard HTML element should behave like a defined custom built-in element"
|
|
19537
|
+
},
|
|
19538
|
+
{
|
|
19539
|
+
"name": "exportparts",
|
|
19540
|
+
"type": "string | undefined",
|
|
19541
|
+
"required": false,
|
|
19542
|
+
"description": "@see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts}"
|
|
19543
|
+
},
|
|
19544
|
+
{
|
|
19545
|
+
"name": "part",
|
|
19546
|
+
"type": "string | undefined",
|
|
19547
|
+
"required": false,
|
|
19548
|
+
"description": "@see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part}"
|
|
19549
|
+
},
|
|
19550
|
+
{
|
|
19551
|
+
"name": "size",
|
|
19552
|
+
"type": "{ sm: string; md: string; lg: string; }",
|
|
19553
|
+
"required": false
|
|
19554
|
+
}
|
|
19555
|
+
],
|
|
19556
|
+
"variants": [
|
|
19557
|
+
{
|
|
19558
|
+
"name": "column",
|
|
19559
|
+
"options": [
|
|
19560
|
+
"stick",
|
|
19561
|
+
"lineNumbers",
|
|
19562
|
+
"folds",
|
|
19563
|
+
"prefix"
|
|
19564
|
+
],
|
|
19565
|
+
"defaultValue": "lineNumbers"
|
|
19566
|
+
},
|
|
19567
|
+
{
|
|
19568
|
+
"name": "hasGutter",
|
|
19569
|
+
"options": [
|
|
19570
|
+
"true",
|
|
19571
|
+
"false"
|
|
19572
|
+
],
|
|
19573
|
+
"defaultValue": "false"
|
|
19574
|
+
},
|
|
19575
|
+
{
|
|
19576
|
+
"name": "wrapLines",
|
|
19577
|
+
"options": [
|
|
19578
|
+
"true",
|
|
19579
|
+
"false"
|
|
19580
|
+
],
|
|
19581
|
+
"defaultValue": "false"
|
|
19582
|
+
}
|
|
19583
|
+
],
|
|
19584
|
+
"subComponents": [
|
|
19585
|
+
{
|
|
19586
|
+
"name": "CodeEditorContent",
|
|
19587
|
+
"props": [
|
|
19588
|
+
{
|
|
19589
|
+
"name": "lineNumbers",
|
|
19590
|
+
"type": "boolean | undefined",
|
|
19591
|
+
"required": false,
|
|
19592
|
+
"description": "Show the line-number gutter (CodeSnippet's `<CodeSnippetLineNumbers />` equivalent)",
|
|
19593
|
+
"defaultValue": "false"
|
|
19594
|
+
},
|
|
19595
|
+
{
|
|
19596
|
+
"name": "defaultChecked",
|
|
19597
|
+
"type": "boolean | undefined",
|
|
19598
|
+
"required": false
|
|
19599
|
+
},
|
|
19600
|
+
{
|
|
19601
|
+
"name": "suppressContentEditableWarning",
|
|
19602
|
+
"type": "boolean | undefined",
|
|
19603
|
+
"required": false
|
|
19604
|
+
},
|
|
19605
|
+
{
|
|
19606
|
+
"name": "suppressHydrationWarning",
|
|
19607
|
+
"type": "boolean | undefined",
|
|
19608
|
+
"required": false
|
|
19609
|
+
},
|
|
19610
|
+
{
|
|
19611
|
+
"name": "accessKey",
|
|
19612
|
+
"type": "string | undefined",
|
|
19613
|
+
"required": false
|
|
19614
|
+
},
|
|
19615
|
+
{
|
|
19616
|
+
"name": "autoCapitalize",
|
|
19617
|
+
"type": "\"off\" | \"none\" | \"on\" | \"sentences\" | \"words\" | \"characters\" | (string & {}) | undefined",
|
|
19618
|
+
"required": false
|
|
19619
|
+
},
|
|
19620
|
+
{
|
|
19621
|
+
"name": "autoFocus",
|
|
19622
|
+
"type": "boolean | undefined",
|
|
19623
|
+
"required": false
|
|
19624
|
+
},
|
|
19625
|
+
{
|
|
19626
|
+
"name": "contextMenu",
|
|
19627
|
+
"type": "string | undefined",
|
|
19628
|
+
"required": false
|
|
19629
|
+
},
|
|
19630
|
+
{
|
|
19631
|
+
"name": "dir",
|
|
19632
|
+
"type": "string | undefined",
|
|
19633
|
+
"required": false
|
|
19634
|
+
},
|
|
19635
|
+
{
|
|
19636
|
+
"name": "draggable",
|
|
19637
|
+
"type": "Booleanish | undefined",
|
|
19638
|
+
"required": false
|
|
19639
|
+
},
|
|
19640
|
+
{
|
|
19641
|
+
"name": "enterKeyHint",
|
|
19642
|
+
"type": "\"enter\" | \"done\" | \"go\" | \"next\" | \"previous\" | \"search\" | \"send\" | undefined",
|
|
19643
|
+
"required": false
|
|
19644
|
+
},
|
|
19645
|
+
{
|
|
19646
|
+
"name": "hidden",
|
|
19647
|
+
"type": "boolean | undefined",
|
|
19648
|
+
"required": false
|
|
19649
|
+
},
|
|
19650
|
+
{
|
|
19651
|
+
"name": "id",
|
|
19652
|
+
"type": "string | undefined",
|
|
19653
|
+
"required": false
|
|
19654
|
+
},
|
|
19655
|
+
{
|
|
19656
|
+
"name": "lang",
|
|
19657
|
+
"type": "string | undefined",
|
|
19658
|
+
"required": false
|
|
19659
|
+
},
|
|
19660
|
+
{
|
|
19661
|
+
"name": "nonce",
|
|
19662
|
+
"type": "string | undefined",
|
|
19663
|
+
"required": false
|
|
19664
|
+
},
|
|
19665
|
+
{
|
|
19666
|
+
"name": "slot",
|
|
19667
|
+
"type": "string | undefined",
|
|
19668
|
+
"required": false
|
|
19669
|
+
},
|
|
19670
|
+
{
|
|
19671
|
+
"name": "spellCheck",
|
|
19672
|
+
"type": "Booleanish | undefined",
|
|
19673
|
+
"required": false
|
|
19674
|
+
},
|
|
19675
|
+
{
|
|
19676
|
+
"name": "tabIndex",
|
|
19677
|
+
"type": "number | undefined",
|
|
19678
|
+
"required": false
|
|
19679
|
+
},
|
|
19680
|
+
{
|
|
19681
|
+
"name": "title",
|
|
19682
|
+
"type": "string | undefined",
|
|
19683
|
+
"required": false
|
|
19684
|
+
},
|
|
19685
|
+
{
|
|
19686
|
+
"name": "translate",
|
|
19687
|
+
"type": "\"yes\" | \"no\" | undefined",
|
|
19688
|
+
"required": false
|
|
19689
|
+
},
|
|
19690
|
+
{
|
|
19691
|
+
"name": "radioGroup",
|
|
19692
|
+
"type": "string | undefined",
|
|
19693
|
+
"required": false
|
|
19694
|
+
},
|
|
19695
|
+
{
|
|
19696
|
+
"name": "about",
|
|
19697
|
+
"type": "string | undefined",
|
|
19698
|
+
"required": false
|
|
19699
|
+
},
|
|
19700
|
+
{
|
|
19701
|
+
"name": "content",
|
|
19702
|
+
"type": "string | undefined",
|
|
19703
|
+
"required": false
|
|
19704
|
+
},
|
|
19705
|
+
{
|
|
19706
|
+
"name": "datatype",
|
|
19707
|
+
"type": "string | undefined",
|
|
19708
|
+
"required": false
|
|
19709
|
+
},
|
|
19710
|
+
{
|
|
19711
|
+
"name": "inlist",
|
|
19712
|
+
"type": "any",
|
|
19713
|
+
"required": false
|
|
19714
|
+
},
|
|
19715
|
+
{
|
|
19716
|
+
"name": "prefix",
|
|
19717
|
+
"type": "string | undefined",
|
|
19718
|
+
"required": false
|
|
19719
|
+
},
|
|
19720
|
+
{
|
|
19721
|
+
"name": "property",
|
|
19722
|
+
"type": "string | undefined",
|
|
19723
|
+
"required": false
|
|
19724
|
+
},
|
|
19725
|
+
{
|
|
19726
|
+
"name": "rel",
|
|
19727
|
+
"type": "string | undefined",
|
|
19728
|
+
"required": false
|
|
19729
|
+
},
|
|
19730
|
+
{
|
|
19731
|
+
"name": "resource",
|
|
19732
|
+
"type": "string | undefined",
|
|
19733
|
+
"required": false
|
|
19734
|
+
},
|
|
19735
|
+
{
|
|
19736
|
+
"name": "rev",
|
|
19737
|
+
"type": "string | undefined",
|
|
19738
|
+
"required": false
|
|
19739
|
+
},
|
|
19740
|
+
{
|
|
19741
|
+
"name": "typeof",
|
|
19742
|
+
"type": "string | undefined",
|
|
19743
|
+
"required": false
|
|
19744
|
+
},
|
|
19745
|
+
{
|
|
19746
|
+
"name": "vocab",
|
|
19747
|
+
"type": "string | undefined",
|
|
19748
|
+
"required": false
|
|
19749
|
+
},
|
|
19750
|
+
{
|
|
19751
|
+
"name": "autoCorrect",
|
|
19752
|
+
"type": "string | undefined",
|
|
19753
|
+
"required": false
|
|
19754
|
+
},
|
|
19755
|
+
{
|
|
19756
|
+
"name": "autoSave",
|
|
19757
|
+
"type": "string | undefined",
|
|
19758
|
+
"required": false
|
|
19759
|
+
},
|
|
19760
|
+
{
|
|
19761
|
+
"name": "color",
|
|
19762
|
+
"type": "string | undefined",
|
|
19763
|
+
"required": false
|
|
19764
|
+
},
|
|
19765
|
+
{
|
|
19766
|
+
"name": "itemProp",
|
|
19767
|
+
"type": "string | undefined",
|
|
19768
|
+
"required": false
|
|
19769
|
+
},
|
|
19770
|
+
{
|
|
19771
|
+
"name": "itemScope",
|
|
19772
|
+
"type": "boolean | undefined",
|
|
19773
|
+
"required": false
|
|
19774
|
+
},
|
|
19775
|
+
{
|
|
19776
|
+
"name": "itemType",
|
|
19777
|
+
"type": "string | undefined",
|
|
19778
|
+
"required": false
|
|
19779
|
+
},
|
|
19780
|
+
{
|
|
19781
|
+
"name": "itemID",
|
|
19782
|
+
"type": "string | undefined",
|
|
19783
|
+
"required": false
|
|
19784
|
+
},
|
|
19785
|
+
{
|
|
19786
|
+
"name": "itemRef",
|
|
19787
|
+
"type": "string | undefined",
|
|
19788
|
+
"required": false
|
|
19789
|
+
},
|
|
19790
|
+
{
|
|
19791
|
+
"name": "results",
|
|
19792
|
+
"type": "number | undefined",
|
|
19793
|
+
"required": false
|
|
19794
|
+
},
|
|
19795
|
+
{
|
|
19796
|
+
"name": "security",
|
|
19797
|
+
"type": "string | undefined",
|
|
19798
|
+
"required": false
|
|
19799
|
+
},
|
|
19800
|
+
{
|
|
19801
|
+
"name": "unselectable",
|
|
19802
|
+
"type": "\"off\" | \"on\" | undefined",
|
|
19803
|
+
"required": false
|
|
19804
|
+
},
|
|
19805
|
+
{
|
|
19806
|
+
"name": "popover",
|
|
19807
|
+
"type": "\"\" | \"auto\" | \"manual\" | \"hint\" | undefined",
|
|
19808
|
+
"required": false
|
|
19809
|
+
},
|
|
19810
|
+
{
|
|
19811
|
+
"name": "popoverTargetAction",
|
|
19812
|
+
"type": "\"toggle\" | \"show\" | \"hide\" | undefined",
|
|
19813
|
+
"required": false
|
|
19814
|
+
},
|
|
19815
|
+
{
|
|
19816
|
+
"name": "popoverTarget",
|
|
19817
|
+
"type": "string | undefined",
|
|
19818
|
+
"required": false
|
|
19819
|
+
},
|
|
19820
|
+
{
|
|
19821
|
+
"name": "inert",
|
|
19822
|
+
"type": "boolean | undefined",
|
|
19823
|
+
"required": false,
|
|
19824
|
+
"description": "@see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert}"
|
|
19825
|
+
},
|
|
19826
|
+
{
|
|
19827
|
+
"name": "inputMode",
|
|
19828
|
+
"type": "\"none\" | \"search\" | \"text\" | \"tel\" | \"url\" | \"email\" | \"numeric\" | \"decimal\" | undefined",
|
|
19829
|
+
"required": false,
|
|
19830
|
+
"description": "Hints at the type of data that might be entered by the user while editing the element or its contents"
|
|
19831
|
+
},
|
|
19832
|
+
{
|
|
19833
|
+
"name": "is",
|
|
19834
|
+
"type": "string | undefined",
|
|
19835
|
+
"required": false,
|
|
19836
|
+
"description": "Specify that a standard HTML element should behave like a defined custom built-in element"
|
|
19837
|
+
},
|
|
19838
|
+
{
|
|
19839
|
+
"name": "exportparts",
|
|
19840
|
+
"type": "string | undefined",
|
|
19841
|
+
"required": false,
|
|
19842
|
+
"description": "@see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts}"
|
|
19843
|
+
},
|
|
19844
|
+
{
|
|
19845
|
+
"name": "part",
|
|
19846
|
+
"type": "string | undefined",
|
|
19847
|
+
"required": false,
|
|
19848
|
+
"description": "@see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part}"
|
|
19849
|
+
}
|
|
19850
|
+
]
|
|
19851
|
+
},
|
|
19852
|
+
{
|
|
19853
|
+
"name": "CodeEditorRoot",
|
|
19854
|
+
"props": [
|
|
19855
|
+
{
|
|
19856
|
+
"name": "value",
|
|
19857
|
+
"type": "string | undefined",
|
|
19858
|
+
"required": false,
|
|
19859
|
+
"description": "Controlled document"
|
|
19860
|
+
},
|
|
19861
|
+
{
|
|
19862
|
+
"name": "defaultValue",
|
|
19863
|
+
"type": "string | undefined",
|
|
19864
|
+
"required": false,
|
|
19865
|
+
"description": "Uncontrolled initial document (controlled vs uncontrolled is locked on first render)",
|
|
19866
|
+
"defaultValue": ""
|
|
19867
|
+
},
|
|
19868
|
+
{
|
|
19869
|
+
"name": "language",
|
|
19870
|
+
"type": "CodeEditorLanguage | undefined",
|
|
19871
|
+
"required": false,
|
|
19872
|
+
"description": "Passed verbatim to the syntax adapter; selects the structural parser",
|
|
19873
|
+
"defaultValue": "text"
|
|
19874
|
+
},
|
|
19875
|
+
{
|
|
19876
|
+
"name": "documentId",
|
|
19877
|
+
"type": "string | undefined",
|
|
19878
|
+
"required": false,
|
|
19879
|
+
"description": "Document identity: changing it swaps to that document's cached state (undo history,\nselection, folds). Requires a controlled `value`: when the id changes, `value` must already\nhold that document's text (an uncached id starts from `value`). In uncontrolled mode the new\ndocument would be seeded with the previous document's text."
|
|
19880
|
+
},
|
|
19881
|
+
{
|
|
19882
|
+
"name": "readOnly",
|
|
19883
|
+
"type": "boolean | undefined",
|
|
19884
|
+
"required": false,
|
|
19885
|
+
"description": "Focusable, selectable, searchable, copyable — but not editable by the user",
|
|
19886
|
+
"defaultValue": "false"
|
|
19887
|
+
},
|
|
19888
|
+
{
|
|
19889
|
+
"name": "startingLineNumber",
|
|
19890
|
+
"type": "number | undefined",
|
|
19891
|
+
"required": false,
|
|
19892
|
+
"description": "Offsets gutter numbers; `lines`, `folds`, `diagnostics` use absolute numbers",
|
|
19893
|
+
"defaultValue": "1"
|
|
19894
|
+
},
|
|
19895
|
+
{
|
|
19896
|
+
"name": "lines",
|
|
19897
|
+
"type": "Record<number, LineConfig> | undefined",
|
|
19898
|
+
"required": false,
|
|
19899
|
+
"description": "Per-line configuration keyed by absolute line number (static, see spec D6).\nCompared by identity: memoise it (or hoist it to a constant) — a new object\nevery render reconfigures the lines and gutters on every render.",
|
|
19900
|
+
"defaultValue": "EMPTY_LINES"
|
|
19901
|
+
},
|
|
19902
|
+
{
|
|
19903
|
+
"name": "folds",
|
|
19904
|
+
"type": "CodeEditorFolds | undefined",
|
|
19905
|
+
"required": false,
|
|
19906
|
+
"description": "Fold regions, or a function re-run after edits; collapsed state is kept by `id`.\nCompared by identity: memoise the array or pass a stable function (e.g. `getHttpFolds`) —\nan inline array/arrow reconfigures folds on every render and bypasses the re-run debounce."
|
|
19907
|
+
},
|
|
19908
|
+
{
|
|
19909
|
+
"name": "wrapLines",
|
|
19910
|
+
"type": "boolean | undefined",
|
|
19911
|
+
"required": false,
|
|
19912
|
+
"description": "Controlled line wrapping"
|
|
19913
|
+
},
|
|
19914
|
+
{
|
|
19915
|
+
"name": "defaultWrapLines",
|
|
19916
|
+
"type": "boolean | undefined",
|
|
19917
|
+
"required": false,
|
|
19918
|
+
"description": "Uncontrolled initial line wrapping",
|
|
19919
|
+
"defaultValue": "false"
|
|
19920
|
+
},
|
|
19921
|
+
{
|
|
19922
|
+
"name": "maxLines",
|
|
19923
|
+
"type": "number | undefined",
|
|
19924
|
+
"required": false,
|
|
19925
|
+
"description": "Height clamp in rows; auto-renders `CodeSnippetShowMoreButton` unless one is a direct child",
|
|
19926
|
+
"defaultValue": "0"
|
|
19927
|
+
},
|
|
19928
|
+
{
|
|
19929
|
+
"name": "original",
|
|
19930
|
+
"type": "string | undefined",
|
|
19931
|
+
"required": false,
|
|
19932
|
+
"description": "Enables diff mode against this text"
|
|
19933
|
+
},
|
|
19934
|
+
{
|
|
19935
|
+
"name": "schema",
|
|
19936
|
+
"type": "JsonSchema | undefined",
|
|
19937
|
+
"required": false,
|
|
19938
|
+
"description": "JSON Schema for the document (`json`) or the JSON body (`http`)"
|
|
19939
|
+
},
|
|
19940
|
+
{
|
|
19941
|
+
"name": "completions",
|
|
19942
|
+
"type": "CodeEditorCompletionSource[] | undefined",
|
|
19943
|
+
"required": false,
|
|
19944
|
+
"description": "Consumer completion sources, added after the built-in ones. Compared by identity: a new\narray reconfigures autocomplete and closes an open list, so keep it stable (module constant\nor `useMemo`).",
|
|
19945
|
+
"defaultValue": "EMPTY_COMPLETIONS"
|
|
19946
|
+
},
|
|
19947
|
+
{
|
|
19948
|
+
"name": "diagnostics",
|
|
19949
|
+
"type": "CodeEditorDiagnostic[] | undefined",
|
|
19950
|
+
"required": false,
|
|
19951
|
+
"description": "External diagnostics, merged with syntax and schema ones",
|
|
19952
|
+
"defaultValue": "EMPTY_DIAGNOSTICS"
|
|
19953
|
+
},
|
|
19954
|
+
{
|
|
19955
|
+
"name": "apiRef",
|
|
19956
|
+
"type": "Ref<CodeEditorApi> | undefined",
|
|
19957
|
+
"required": false,
|
|
19958
|
+
"description": "Imperative handle"
|
|
19959
|
+
},
|
|
19960
|
+
{
|
|
19961
|
+
"name": "cspNonce",
|
|
19962
|
+
"type": "string | undefined",
|
|
19963
|
+
"required": false,
|
|
19964
|
+
"description": "Nonce for the style tags the editor injects"
|
|
19965
|
+
},
|
|
19966
|
+
{
|
|
19967
|
+
"name": "contentEditable",
|
|
19968
|
+
"type": "Booleanish | \"inherit\" | \"plaintext-only\" | undefined",
|
|
19969
|
+
"required": false
|
|
19970
|
+
},
|
|
19971
|
+
{
|
|
19972
|
+
"name": "role",
|
|
19973
|
+
"type": "AriaRole | undefined",
|
|
19974
|
+
"required": false
|
|
19975
|
+
},
|
|
19976
|
+
{
|
|
19977
|
+
"name": "defaultChecked",
|
|
19978
|
+
"type": "boolean | undefined",
|
|
19979
|
+
"required": false
|
|
19980
|
+
},
|
|
19981
|
+
{
|
|
19982
|
+
"name": "suppressContentEditableWarning",
|
|
19983
|
+
"type": "boolean | undefined",
|
|
19984
|
+
"required": false
|
|
19985
|
+
},
|
|
19986
|
+
{
|
|
19987
|
+
"name": "suppressHydrationWarning",
|
|
19988
|
+
"type": "boolean | undefined",
|
|
19989
|
+
"required": false
|
|
19990
|
+
},
|
|
19991
|
+
{
|
|
19992
|
+
"name": "accessKey",
|
|
19993
|
+
"type": "string | undefined",
|
|
19994
|
+
"required": false
|
|
19995
|
+
},
|
|
19996
|
+
{
|
|
19997
|
+
"name": "autoCapitalize",
|
|
19998
|
+
"type": "\"off\" | \"none\" | \"on\" | \"sentences\" | \"words\" | \"characters\" | (string & {}) | undefined",
|
|
19999
|
+
"required": false
|
|
20000
|
+
},
|
|
20001
|
+
{
|
|
20002
|
+
"name": "autoFocus",
|
|
20003
|
+
"type": "boolean | undefined",
|
|
20004
|
+
"required": false
|
|
20005
|
+
},
|
|
20006
|
+
{
|
|
20007
|
+
"name": "contextMenu",
|
|
20008
|
+
"type": "string | undefined",
|
|
20009
|
+
"required": false
|
|
20010
|
+
},
|
|
20011
|
+
{
|
|
20012
|
+
"name": "dir",
|
|
20013
|
+
"type": "string | undefined",
|
|
20014
|
+
"required": false
|
|
20015
|
+
},
|
|
20016
|
+
{
|
|
20017
|
+
"name": "draggable",
|
|
20018
|
+
"type": "Booleanish | undefined",
|
|
20019
|
+
"required": false
|
|
20020
|
+
},
|
|
20021
|
+
{
|
|
20022
|
+
"name": "enterKeyHint",
|
|
20023
|
+
"type": "\"enter\" | \"done\" | \"go\" | \"next\" | \"previous\" | \"search\" | \"send\" | undefined",
|
|
20024
|
+
"required": false
|
|
20025
|
+
},
|
|
20026
|
+
{
|
|
20027
|
+
"name": "hidden",
|
|
20028
|
+
"type": "boolean | undefined",
|
|
20029
|
+
"required": false
|
|
20030
|
+
},
|
|
20031
|
+
{
|
|
20032
|
+
"name": "id",
|
|
20033
|
+
"type": "string | undefined",
|
|
20034
|
+
"required": false
|
|
20035
|
+
},
|
|
20036
|
+
{
|
|
20037
|
+
"name": "lang",
|
|
20038
|
+
"type": "string | undefined",
|
|
20039
|
+
"required": false
|
|
20040
|
+
},
|
|
20041
|
+
{
|
|
20042
|
+
"name": "nonce",
|
|
20043
|
+
"type": "string | undefined",
|
|
20044
|
+
"required": false
|
|
20045
|
+
},
|
|
20046
|
+
{
|
|
20047
|
+
"name": "slot",
|
|
20048
|
+
"type": "string | undefined",
|
|
20049
|
+
"required": false
|
|
20050
|
+
},
|
|
20051
|
+
{
|
|
20052
|
+
"name": "spellCheck",
|
|
20053
|
+
"type": "Booleanish | undefined",
|
|
20054
|
+
"required": false
|
|
20055
|
+
},
|
|
20056
|
+
{
|
|
20057
|
+
"name": "tabIndex",
|
|
20058
|
+
"type": "number | undefined",
|
|
20059
|
+
"required": false
|
|
20060
|
+
},
|
|
20061
|
+
{
|
|
20062
|
+
"name": "title",
|
|
20063
|
+
"type": "string | undefined",
|
|
20064
|
+
"required": false
|
|
20065
|
+
},
|
|
20066
|
+
{
|
|
20067
|
+
"name": "translate",
|
|
20068
|
+
"type": "\"yes\" | \"no\" | undefined",
|
|
20069
|
+
"required": false
|
|
20070
|
+
},
|
|
20071
|
+
{
|
|
20072
|
+
"name": "radioGroup",
|
|
20073
|
+
"type": "string | undefined",
|
|
20074
|
+
"required": false
|
|
20075
|
+
},
|
|
20076
|
+
{
|
|
20077
|
+
"name": "about",
|
|
20078
|
+
"type": "string | undefined",
|
|
20079
|
+
"required": false
|
|
20080
|
+
},
|
|
20081
|
+
{
|
|
20082
|
+
"name": "content",
|
|
20083
|
+
"type": "string | undefined",
|
|
20084
|
+
"required": false
|
|
20085
|
+
},
|
|
20086
|
+
{
|
|
20087
|
+
"name": "datatype",
|
|
20088
|
+
"type": "string | undefined",
|
|
20089
|
+
"required": false
|
|
20090
|
+
},
|
|
20091
|
+
{
|
|
20092
|
+
"name": "inlist",
|
|
20093
|
+
"type": "any",
|
|
20094
|
+
"required": false
|
|
20095
|
+
},
|
|
20096
|
+
{
|
|
20097
|
+
"name": "prefix",
|
|
20098
|
+
"type": "string | undefined",
|
|
20099
|
+
"required": false
|
|
20100
|
+
},
|
|
20101
|
+
{
|
|
20102
|
+
"name": "property",
|
|
20103
|
+
"type": "string | undefined",
|
|
20104
|
+
"required": false
|
|
20105
|
+
},
|
|
20106
|
+
{
|
|
20107
|
+
"name": "rel",
|
|
20108
|
+
"type": "string | undefined",
|
|
20109
|
+
"required": false
|
|
20110
|
+
},
|
|
20111
|
+
{
|
|
20112
|
+
"name": "resource",
|
|
20113
|
+
"type": "string | undefined",
|
|
20114
|
+
"required": false
|
|
20115
|
+
},
|
|
20116
|
+
{
|
|
20117
|
+
"name": "rev",
|
|
20118
|
+
"type": "string | undefined",
|
|
20119
|
+
"required": false
|
|
20120
|
+
},
|
|
20121
|
+
{
|
|
20122
|
+
"name": "typeof",
|
|
20123
|
+
"type": "string | undefined",
|
|
20124
|
+
"required": false
|
|
20125
|
+
},
|
|
20126
|
+
{
|
|
20127
|
+
"name": "vocab",
|
|
20128
|
+
"type": "string | undefined",
|
|
20129
|
+
"required": false
|
|
20130
|
+
},
|
|
20131
|
+
{
|
|
20132
|
+
"name": "autoCorrect",
|
|
20133
|
+
"type": "string | undefined",
|
|
20134
|
+
"required": false
|
|
20135
|
+
},
|
|
20136
|
+
{
|
|
20137
|
+
"name": "autoSave",
|
|
20138
|
+
"type": "string | undefined",
|
|
20139
|
+
"required": false
|
|
20140
|
+
},
|
|
20141
|
+
{
|
|
20142
|
+
"name": "color",
|
|
20143
|
+
"type": "string | undefined",
|
|
20144
|
+
"required": false
|
|
20145
|
+
},
|
|
20146
|
+
{
|
|
20147
|
+
"name": "itemProp",
|
|
20148
|
+
"type": "string | undefined",
|
|
20149
|
+
"required": false
|
|
20150
|
+
},
|
|
20151
|
+
{
|
|
20152
|
+
"name": "itemScope",
|
|
20153
|
+
"type": "boolean | undefined",
|
|
20154
|
+
"required": false
|
|
20155
|
+
},
|
|
20156
|
+
{
|
|
20157
|
+
"name": "itemType",
|
|
20158
|
+
"type": "string | undefined",
|
|
20159
|
+
"required": false
|
|
20160
|
+
},
|
|
20161
|
+
{
|
|
20162
|
+
"name": "itemID",
|
|
20163
|
+
"type": "string | undefined",
|
|
20164
|
+
"required": false
|
|
20165
|
+
},
|
|
20166
|
+
{
|
|
20167
|
+
"name": "itemRef",
|
|
20168
|
+
"type": "string | undefined",
|
|
20169
|
+
"required": false
|
|
20170
|
+
},
|
|
20171
|
+
{
|
|
20172
|
+
"name": "results",
|
|
20173
|
+
"type": "number | undefined",
|
|
20174
|
+
"required": false
|
|
20175
|
+
},
|
|
20176
|
+
{
|
|
20177
|
+
"name": "security",
|
|
20178
|
+
"type": "string | undefined",
|
|
20179
|
+
"required": false
|
|
20180
|
+
},
|
|
20181
|
+
{
|
|
20182
|
+
"name": "unselectable",
|
|
20183
|
+
"type": "\"off\" | \"on\" | undefined",
|
|
20184
|
+
"required": false
|
|
20185
|
+
},
|
|
20186
|
+
{
|
|
20187
|
+
"name": "popover",
|
|
20188
|
+
"type": "\"\" | \"auto\" | \"manual\" | \"hint\" | undefined",
|
|
20189
|
+
"required": false
|
|
20190
|
+
},
|
|
20191
|
+
{
|
|
20192
|
+
"name": "popoverTargetAction",
|
|
20193
|
+
"type": "\"toggle\" | \"show\" | \"hide\" | undefined",
|
|
20194
|
+
"required": false
|
|
20195
|
+
},
|
|
20196
|
+
{
|
|
20197
|
+
"name": "popoverTarget",
|
|
20198
|
+
"type": "string | undefined",
|
|
20199
|
+
"required": false
|
|
20200
|
+
},
|
|
20201
|
+
{
|
|
20202
|
+
"name": "inert",
|
|
20203
|
+
"type": "boolean | undefined",
|
|
20204
|
+
"required": false,
|
|
20205
|
+
"description": "@see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert}"
|
|
20206
|
+
},
|
|
20207
|
+
{
|
|
20208
|
+
"name": "inputMode",
|
|
20209
|
+
"type": "\"none\" | \"search\" | \"text\" | \"tel\" | \"url\" | \"email\" | \"numeric\" | \"decimal\" | undefined",
|
|
20210
|
+
"required": false,
|
|
20211
|
+
"description": "Hints at the type of data that might be entered by the user while editing the element or its contents"
|
|
20212
|
+
},
|
|
20213
|
+
{
|
|
20214
|
+
"name": "is",
|
|
20215
|
+
"type": "string | undefined",
|
|
20216
|
+
"required": false,
|
|
20217
|
+
"description": "Specify that a standard HTML element should behave like a defined custom built-in element"
|
|
20218
|
+
},
|
|
20219
|
+
{
|
|
20220
|
+
"name": "exportparts",
|
|
20221
|
+
"type": "string | undefined",
|
|
20222
|
+
"required": false,
|
|
20223
|
+
"description": "@see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts}"
|
|
20224
|
+
},
|
|
20225
|
+
{
|
|
20226
|
+
"name": "part",
|
|
20227
|
+
"type": "string | undefined",
|
|
20228
|
+
"required": false,
|
|
20229
|
+
"description": "@see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part}"
|
|
20230
|
+
},
|
|
20231
|
+
{
|
|
20232
|
+
"name": "size",
|
|
20233
|
+
"type": "{ sm: string; md: string; lg: string; }",
|
|
20234
|
+
"required": false,
|
|
20235
|
+
"defaultValue": "sm"
|
|
20236
|
+
}
|
|
20237
|
+
]
|
|
20238
|
+
}
|
|
20239
|
+
],
|
|
20240
|
+
"examples": [
|
|
20241
|
+
{
|
|
20242
|
+
"name": "Default",
|
|
20243
|
+
"code": "() => {\n const [value, setValue] = useState(jsonCode);\n\n return (\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n value={value}\n onChange={setValue}\n language='json'\n data-testid='code-editor-default'\n >\n <CodeEditorContent lineNumbers aria-label='Package manifest' />\n </CodeEditorRoot>\n </div>\n );\n}",
|
|
20244
|
+
"description": "A controlled editor: `value` plus `onChange`, like any input. With no adapter in scope the\ntext is plain, exactly as `CodeSnippet` renders it without a provider."
|
|
20245
|
+
},
|
|
20246
|
+
{
|
|
20247
|
+
"name": "WithHeader",
|
|
20248
|
+
"code": "() => {\n const [value, setValue] = useState(jsonCode);\n\n return (\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n value={value}\n onChange={setValue}\n language='json'\n data-testid='code-editor-with-header'\n >\n <CodeSnippetHeader>\n <CodeSnippetTitle>rule.json</CodeSnippetTitle>\n <CodeSnippetActions>\n <CodeSnippetCopyButton />\n <CodeSnippetWrapButton />\n <CodeSnippetFullscreenButton />\n </CodeSnippetActions>\n </CodeSnippetHeader>\n <CodeEditorContent lineNumbers aria-label='Rule JSON' />\n </CodeEditorRoot>\n </div>\n );\n}",
|
|
20249
|
+
"description": "The `CodeSnippet` header works unchanged: a title and the copy, wrap and fullscreen buttons.\nCopy puts the edited value on the clipboard, and fullscreen keeps the undo history."
|
|
20250
|
+
},
|
|
20251
|
+
{
|
|
20252
|
+
"name": "FloatingActions",
|
|
20253
|
+
"code": "() => {\n const [value, setValue] = useState(sampleCode);\n\n return (\n <div style={{ width: '320px' }}>\n <CodeEditorRoot\n value={value}\n onChange={setValue}\n language='text'\n data-testid='code-editor-floating-actions'\n >\n <CodeSnippetActions>\n <CodeSnippetWrapButton />\n <CodeSnippetCopyButton />\n </CodeSnippetActions>\n <CodeEditorContent lineNumbers aria-label='Sample code' />\n </CodeEditorRoot>\n </div>\n );\n}",
|
|
20254
|
+
"description": "Without a header, `CodeSnippetActions` as a direct child floats over the top-right of the\neditor, as it does over a snippet."
|
|
20255
|
+
},
|
|
20256
|
+
{
|
|
20257
|
+
"name": "LineNumbersAndStartingLine",
|
|
20258
|
+
"code": "() => (\n <VStack gap={16}>\n <VStack align='start' gap={4}>\n <span className='sb-annotation'>lineNumbers</span>\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n defaultValue={sampleCode}\n language='text'\n data-testid='code-editor-line-numbers'\n >\n <CodeEditorContent lineNumbers aria-label='Sample code' />\n </CodeEditorRoot>\n </div>\n </VStack>\n <VStack align='start' gap={4}>\n <span className='sb-annotation'>startingLineNumber = 97</span>\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n defaultValue={sampleCode}\n language='text'\n startingLineNumber={97}\n data-testid='code-editor-starting-line'\n >\n <CodeEditorContent lineNumbers aria-label='Sample code from line 97' />\n </CodeEditorRoot>\n </div>\n </VStack>\n </VStack>\n)",
|
|
20259
|
+
"description": "`lineNumbers` on `CodeEditorContent` is the equivalent of `CodeSnippetLineNumbers`, and\n`startingLineNumber` renumbers the gutter for a fragment taken from a longer file."
|
|
20260
|
+
},
|
|
20261
|
+
{
|
|
20262
|
+
"name": "LineColorsAndPrefixes",
|
|
20263
|
+
"code": "() => (\n <VStack gap={16}>\n <VStack align='start' gap={4}>\n <span className='sb-annotation'>colours</span>\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n defaultValue={colorsCode}\n language='text'\n lines={colorLines}\n data-testid='code-editor-line-colors'\n >\n <CodeEditorContent lineNumbers aria-label='Line colours' />\n </CodeEditorRoot>\n </div>\n </VStack>\n <VStack align='start' gap={4}>\n <span className='sb-annotation'>text prefixes</span>\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n defaultValue={diffCode}\n language='text'\n lines={diffLines}\n data-testid='code-editor-line-diff'\n >\n <CodeEditorContent lineNumbers aria-label='Diff prefixes' />\n </CodeEditorRoot>\n </div>\n </VStack>\n <VStack align='start' gap={4}>\n <span className='sb-annotation'>ReactNode prefixes with tooltips</span>\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n defaultValue={annotatedHeadersCode}\n language='text'\n lines={iconLines}\n data-testid='code-editor-line-icons'\n >\n <CodeEditorContent lineNumbers aria-label='Annotated headers' />\n </CodeEditorRoot>\n </div>\n </VStack>\n </VStack>\n)",
|
|
20264
|
+
"description": "`lines` uses the same `LineConfig` as CodeSnippet: seven semantic colours, text prefixes for a\nhand-made diff, and ReactNode prefixes such as a tooltipped icon. Lines are static and tied\nto line numbers, so they stay on their number while you type."
|
|
20265
|
+
},
|
|
20266
|
+
{
|
|
20267
|
+
"name": "Ranges",
|
|
20268
|
+
"code": "() => (\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n defaultValue={rangesCode}\n language='text'\n lines={rangeLines}\n data-testid='code-editor-ranges'\n >\n <CodeEditorContent lineNumbers aria-label='Request with ranges' />\n </CodeEditorRoot>\n </div>\n)",
|
|
20269
|
+
"description": "`ranges` colours character offsets inside a line (start inclusive, end exclusive). The line\nkeeps its background, and only the range gets the colour."
|
|
20270
|
+
},
|
|
20271
|
+
{
|
|
20272
|
+
"name": "HttpRequestWithPrism",
|
|
20273
|
+
"code": "() => {\n const [value, setValue] = useState(httpRequestCode);\n\n return (\n <CodeSnippetAdapterProvider adapter={loadPrismAdapter}>\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n value={value}\n onChange={setValue}\n language='http'\n data-testid='code-editor-http-request'\n >\n <CodeEditorContent lineNumbers aria-label='HTTP request' />\n </CodeEditorRoot>\n </div>\n </CodeSnippetAdapterProvider>\n );\n}",
|
|
20274
|
+
"description": "`language='http'` under Prism. The colours come from the adapter and the structure (start\nline, headers, JSON body) comes from the editor's own HTTP grammar."
|
|
20275
|
+
},
|
|
20276
|
+
{
|
|
20277
|
+
"name": "HttpResponseWithShiki",
|
|
20278
|
+
"code": "() => {\n const [value, setValue] = useState(httpResponseCode);\n\n return (\n <CodeSnippetAdapterProvider adapter={loadShikiAdapter}>\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n value={value}\n onChange={setValue}\n language='http'\n data-testid='code-editor-http-response'\n >\n <CodeEditorContent lineNumbers aria-label='HTTP response' />\n </CodeEditorRoot>\n </div>\n </CodeSnippetAdapterProvider>\n );\n}",
|
|
20279
|
+
"description": "The response side under Shiki. After an edit, highlighting is repainted in the background,\nso for a moment you may see the previous colours mapped through your change."
|
|
20280
|
+
},
|
|
20281
|
+
{
|
|
20282
|
+
"name": "HttpFolds",
|
|
20283
|
+
"code": "() => {\n const [request, setRequest] = useState(foldableRequestCode);\n const [response, setResponse] = useState(foldableResponseCode);\n\n return (\n <VStack gap={16}>\n <VStack align='start' gap={4}>\n <span className='sb-annotation'>headers collapsed by default</span>\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n value={request}\n onChange={setRequest}\n language='http'\n folds={foldRequestHeadersCollapsed}\n data-testid='code-editor-http-folds-request'\n >\n <CodeEditorContent lineNumbers aria-label='Foldable HTTP request' />\n </CodeEditorRoot>\n </div>\n </VStack>\n <VStack align='start' gap={4}>\n <span className='sb-annotation'>startingLineNumber = 100</span>\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n value={response}\n onChange={setResponse}\n language='http'\n startingLineNumber={100}\n folds={foldHttp}\n data-testid='code-editor-http-folds-response'\n >\n <CodeEditorContent lineNumbers aria-label='Foldable HTTP response' />\n </CodeEditorRoot>\n </div>\n </VStack>\n </VStack>\n );\n}",
|
|
20284
|
+
"description": "`folds` as a function of the value: `getHttpFolds` runs again after edits, so adding a header\ngrows the headers fold. Collapsed state is kept by fold `id`. The second editor starts at\nline 100, and the fold function gets the same offset."
|
|
20285
|
+
},
|
|
20286
|
+
{
|
|
20287
|
+
"name": "ShowMore",
|
|
20288
|
+
"code": "() => (\n <div style={{ display: 'flex', flexDirection: 'column', gap: '24px', width: '500px' }}>\n <div>\n <p className='sb-annotation mb-8'>12 lines, clamped at 7 — 5 hidden</p>\n <CodeEditorRoot\n defaultValue={showMoreCode}\n language='text'\n maxLines={7}\n data-testid='code-editor-show-more'\n >\n <CodeEditorContent aria-label='Request headers' />\n </CodeEditorRoot>\n </div>\n <div>\n <p className='sb-annotation mb-8'>9 lines, clamped at 7 — 2 hidden, no button</p>\n <CodeEditorRoot\n defaultValue={showMoreThresholdCode}\n language='text'\n maxLines={7}\n data-testid='code-editor-show-more-threshold'\n >\n <CodeEditorContent aria-label='Request headers' />\n </CodeEditorRoot>\n </div>\n <div>\n <p className='sb-annotation mb-8'>the button rendered by hand</p>\n <CodeEditorRoot\n defaultValue={showMoreCode}\n language='text'\n maxLines={7}\n data-testid='code-editor-show-more-manual'\n >\n <CodeEditorContent aria-label='Request headers' />\n <CodeSnippetShowMoreButton data-analytics-id='CODE_EDITOR_SHOW_MORE' />\n </CodeEditorRoot>\n </div>\n </div>\n)",
|
|
20289
|
+
"description": "`maxLines` limits the height, and the editor scrolls inside it (no rows are removed). The\nbutton appears on its own when at least three lines are hidden. Render\n`CodeSnippetShowMoreButton` yourself only to pass props to the real button."
|
|
20290
|
+
},
|
|
20291
|
+
{
|
|
20292
|
+
"name": "Wrap",
|
|
20293
|
+
"code": "() => {\n const [wrap, setWrap] = useState(true);\n\n return (\n <VStack gap={16}>\n <VStack align='start' gap={4}>\n <span className='sb-annotation'>no wrapping</span>\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n defaultValue={longCode}\n language='text'\n lines={wrapDiffLines}\n data-testid='code-editor-wrap-off'\n >\n <CodeEditorContent lineNumbers aria-label='Long lines' />\n </CodeEditorRoot>\n </div>\n </VStack>\n <VStack align='start' gap={4}>\n <span className='sb-annotation'>defaultWrapLines + wrap button</span>\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n defaultValue={longCode}\n language='text'\n defaultWrapLines\n lines={wrapDiffLines}\n data-testid='code-editor-wrap-uncontrolled'\n >\n <CodeSnippetActions>\n <CodeSnippetWrapButton />\n </CodeSnippetActions>\n <CodeEditorContent lineNumbers aria-label='Long lines, wrapped' />\n </CodeEditorRoot>\n </div>\n </VStack>\n <VStack align='start' gap={4}>\n <span className='sb-annotation'>controlled — wrapLines = {String(wrap)}</span>\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n defaultValue={longCode}\n language='text'\n wrapLines={wrap}\n onWrapLinesChange={setWrap}\n data-testid='code-editor-wrap-controlled'\n >\n <CodeSnippetActions>\n <CodeSnippetWrapButton />\n </CodeSnippetActions>\n <CodeEditorContent lineNumbers aria-label='Long lines, controlled wrap' />\n </CodeEditorRoot>\n </div>\n </VStack>\n </VStack>\n );\n}",
|
|
20294
|
+
"description": "Wrapping can be uncontrolled (`defaultWrapLines`, driven by the wrap button) or controlled\n(`wrapLines` plus `onWrapLinesChange`). Colour sticks and prefixes stay on the first visual row."
|
|
20295
|
+
},
|
|
20296
|
+
{
|
|
20297
|
+
"name": "Sizes",
|
|
20298
|
+
"code": "() => (\n <VStack gap={16}>\n <VStack align='start' gap={4}>\n <span className='sb-annotation'>sm (default)</span>\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n defaultValue={bashCode}\n language='bash'\n size='sm'\n data-testid='code-editor-size-sm'\n >\n <CodeEditorContent lineNumbers aria-label='Install commands, small' />\n </CodeEditorRoot>\n </div>\n </VStack>\n <VStack align='start' gap={4}>\n <span className='sb-annotation'>md</span>\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n defaultValue={bashCode}\n language='bash'\n size='md'\n data-testid='code-editor-size-md'\n >\n <CodeEditorContent lineNumbers aria-label='Install commands, medium' />\n </CodeEditorRoot>\n </div>\n </VStack>\n <VStack align='start' gap={4}>\n <span className='sb-annotation'>lg</span>\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n defaultValue={bashCode}\n language='bash'\n size='lg'\n data-testid='code-editor-size-lg'\n >\n <CodeEditorContent lineNumbers aria-label='Install commands, large' />\n </CodeEditorRoot>\n </div>\n </VStack>\n </VStack>\n)",
|
|
20299
|
+
"description": "The same three sizes as CodeSnippet: `sm` (12px, default), `md` (14px) and `lg` (16px), each\non 20px rows."
|
|
20300
|
+
},
|
|
20301
|
+
{
|
|
20302
|
+
"name": "ReadOnly",
|
|
20303
|
+
"code": "() => (\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n value={httpResponseCode}\n language='http'\n readOnly\n data-testid='code-editor-read-only'\n >\n <CodeSnippetHeader>\n <CodeSnippetTitle>Response</CodeSnippetTitle>\n <CodeSnippetActions>\n <CodeSnippetCopyButton />\n </CodeSnippetActions>\n </CodeSnippetHeader>\n <CodeEditorContent lineNumbers aria-label='HTTP response, read only' />\n </CodeEditorRoot>\n </div>\n)",
|
|
20304
|
+
"description": "`readOnly` still lets you focus, select, search and copy, but not type. Use it when the value\ncan change elsewhere but not here. If it never changes, use `CodeSnippet`."
|
|
20305
|
+
},
|
|
20306
|
+
{
|
|
20307
|
+
"name": "Tabs",
|
|
20308
|
+
"code": "() => {\n const [tab, setTab] = useState<TabId>('request');\n const [docs, setDocs] = useState<Record<TabId, string>>(tabDocuments);\n\n return (\n <div style={{ width: '600px' }}>\n <CodeEditorRoot\n documentId={tab}\n value={docs[tab]}\n onChange={value => setDocs(prev => ({ ...prev, [tab]: value }))}\n language='http'\n data-testid='code-editor-tabs'\n >\n <CodeSnippetHeader>\n <CodeSnippetTabs\n value={tab}\n onValueChange={value => {\n if (isTabId(value)) setTab(value);\n }}\n >\n <CodeSnippetTab value='request' data-testid='code-editor-tabs--tab-request'>\n Request\n </CodeSnippetTab>\n <CodeSnippetTab value='response' data-testid='code-editor-tabs--tab-response'>\n Response\n </CodeSnippetTab>\n </CodeSnippetTabs>\n <CodeSnippetActions>\n <CodeSnippetCopyButton />\n </CodeSnippetActions>\n </CodeSnippetHeader>\n <CodeEditorContent lineNumbers aria-label='HTTP message' />\n </CodeEditorRoot>\n </div>\n );\n}",
|
|
20309
|
+
"description": "Tabs swap `value`, and `documentId` swaps the editor's whole state with it, so each tab keeps\nits own undo history, selection and collapsed folds."
|
|
20310
|
+
},
|
|
20311
|
+
{
|
|
20312
|
+
"name": "ParityDefault",
|
|
20313
|
+
"code": "() => (\n <ParityPair testId='parity-default' code={sampleCode} language='text' />\n)",
|
|
20314
|
+
"description": "Parity check: the same code and props in CodeSnippet and in a read-only CodeEditor should look\nidentical. Accepted differences: a native thin scrollbar, and CodeMirror's caret and selection\nlayer (shown only while focused)."
|
|
20315
|
+
},
|
|
20316
|
+
{
|
|
20317
|
+
"name": "ParityLineColors",
|
|
20318
|
+
"code": "() => (\n <ParityPair\n testId='parity-line-colors'\n code={colorsCode}\n language='text'\n lines={parityColorLines}\n />\n)",
|
|
20319
|
+
"description": "Parity check with line colours, text prefixes and a tooltipped icon prefix: same stick, same\ntint, same prefix column."
|
|
20320
|
+
},
|
|
20321
|
+
{
|
|
20322
|
+
"name": "ParityFoldsCollapsed",
|
|
20323
|
+
"code": "() => (\n <ParityPair\n testId='parity-folds-collapsed'\n code={foldableRequestCode}\n language='text'\n folds={parityCollapsedFolds}\n />\n)",
|
|
20324
|
+
"description": "Parity check with the headers fold collapsed: same chevrons and the same summary row in place\nof the hidden lines."
|
|
20325
|
+
},
|
|
20326
|
+
{
|
|
20327
|
+
"name": "ParityHttpPrism",
|
|
20328
|
+
"code": "() => (\n <CodeSnippetAdapterProvider adapter={loadPrismAdapter}>\n <ParityPair testId='parity-http-prism' code={httpRequestCode} language='http' />\n </CodeSnippetAdapterProvider>\n)",
|
|
20329
|
+
"description": "Parity check for an HTTP request with a JSON body, both under the same Prism provider: token\ncolours come from the same adapter."
|
|
20330
|
+
},
|
|
20331
|
+
{
|
|
20332
|
+
"name": "ParityRanges",
|
|
20333
|
+
"code": "() => (\n <ParityPair testId='parity-ranges' code={rangesCode} language='text' lines={rangeLines} />\n)",
|
|
20334
|
+
"description": "Parity check for `ranges`: the same bold, coloured spans inside the same tinted lines."
|
|
20335
|
+
},
|
|
20336
|
+
{
|
|
20337
|
+
"name": "ParityWrap",
|
|
20338
|
+
"code": "() => (\n <ParityPair testId='parity-wrap' code={longCode} language='text' wrapLines />\n)",
|
|
20339
|
+
"description": "Parity check for wrapped lines: long lines break at the same points and line numbers stay on\nthe first row of each wrapped line."
|
|
20340
|
+
},
|
|
20341
|
+
{
|
|
20342
|
+
"name": "ParitySizes",
|
|
20343
|
+
"code": "() => (\n <VStack gap={24}>\n <ParityPair testId='parity-size-sm' code={bashCode} language='bash' size='sm' />\n <ParityPair testId='parity-size-md' code={bashCode} language='bash' size='md' />\n <ParityPair testId='parity-size-lg' code={bashCode} language='bash' size='lg' />\n </VStack>\n)",
|
|
20344
|
+
"description": "Parity check for the three sizes: the same font size, line height and gutter padding per size."
|
|
20345
|
+
},
|
|
20346
|
+
{
|
|
20347
|
+
"name": "ParityChrome",
|
|
20348
|
+
"code": "() => (\n <VStack gap={24}>\n <ParityPair testId='parity-chrome-header' code={sampleCode} language='text'>\n {PARITY_HEADER_CHROME}\n </ParityPair>\n <ParityPair testId='parity-chrome-floating' code={sampleCode} language='text'>\n {PARITY_FLOATING_CHROME}\n </ParityPair>\n </VStack>\n)",
|
|
20349
|
+
"description": "Parity check for the shared chrome: a header with tabs and actions, and floating actions\nwithout a header, sit in the same place with the same spacing."
|
|
20350
|
+
},
|
|
20351
|
+
{
|
|
20352
|
+
"name": "ParityShowMore",
|
|
20353
|
+
"code": "() => (\n <ParityPair testId='parity-show-more' code={showMoreCode} language='text' maxLines={7} />\n)",
|
|
20354
|
+
"description": "Parity check for `maxLines`: the same clamped height and the same \"Show N more lines\" button."
|
|
20355
|
+
},
|
|
20356
|
+
{
|
|
20357
|
+
"name": "Languages",
|
|
20358
|
+
"code": "() => (\n <CodeSnippetAdapterProvider adapter={loadShikiAdapter}>\n <VStack gap={16}>\n {LANGUAGE_SAMPLES.map(sample => (\n <LanguageExample key={sample.id} sample={sample} />\n ))}\n </VStack>\n </CodeSnippetAdapterProvider>\n)",
|
|
20359
|
+
"description": "Colours come from the adapter (Shiki here); JavaScript, TypeScript, Python and Lua parsers load\non first use."
|
|
20360
|
+
},
|
|
20361
|
+
{
|
|
20362
|
+
"name": "SyntaxErrors",
|
|
20363
|
+
"code": "() => (\n <CodeSnippetAdapterProvider adapter={loadShikiAdapter}>\n <VStack gap={16}>\n {SYNTAX_ERROR_SAMPLES.map(sample => (\n <SyntaxErrorExample key={sample.language} sample={sample} />\n ))}\n </VStack>\n </CodeSnippetAdapterProvider>\n)",
|
|
20364
|
+
"description": "Syntax errors for every language with a structure parser: JSON and an HTTP JSON body use the\nprecise `JSON.parse` message, JavaScript and TypeScript use Babel, Lua uses luaparse (first error only), YAML and Python report\nLezer error nodes. Hover an underline to read the message; the count below each editor comes from\n`onDiagnosticsChange`. Bash and plain text have no syntax diagnostics."
|
|
20365
|
+
},
|
|
20366
|
+
{
|
|
20367
|
+
"name": "Diff",
|
|
20368
|
+
"code": "() => {\n const [value, setValue] = useState(DIFF_MODIFIED);\n\n return (\n <CodeEditorRoot\n data-testid='code-editor-diff'\n language='http'\n original={DIFF_ORIGINAL}\n value={value}\n onChange={setValue}\n >\n <CodeEditorContent aria-label='Request draft compared with the stored request' lineNumbers />\n </CodeEditorRoot>\n );\n}",
|
|
20369
|
+
"description": "`original` turns on diff mode: added and changed lines read as `success` lines with a `+`,\nremoved lines as `danger` rows with a `-` and no line number. The rows stay editable, and the\ndiff updates as you type."
|
|
20370
|
+
},
|
|
20371
|
+
{
|
|
20372
|
+
"name": "DiffWrapLines",
|
|
20373
|
+
"code": "() => {\n const [value, setValue] = useState(DIFF_WRAP_MODIFIED);\n\n return (\n <div className='w-480'>\n <CodeEditorRoot\n data-testid='code-editor-diff-wrap'\n language='http'\n original={DIFF_WRAP_ORIGINAL}\n value={value}\n onChange={setValue}\n defaultWrapLines\n >\n <CodeEditorContent aria-label='Request without the debug header' lineNumbers />\n </CodeEditorRoot>\n </div>\n );\n}",
|
|
20374
|
+
"description": "With wrapping on, a removed line longer than the frame wraps inside its `danger` row and its\n`-` marker stays on the first visual row, beside where the line starts."
|
|
20375
|
+
},
|
|
20376
|
+
{
|
|
20377
|
+
"name": "AnalyticsAttributes",
|
|
20378
|
+
"code": "() => (\n <CodeEditorRoot\n data-testid='analytics-editor'\n language='http'\n defaultValue={analyticsRequest}\n folds={analyticsFolds}\n >\n <CodeSnippetHeader>\n <CodeSnippetTitle>Request</CodeSnippetTitle>\n <CodeSnippetActions>\n <CodeSnippetCopyButton data-analytics-id='CODE_EDITOR_COPY' />\n <CodeSnippetWrapButton data-analytics-id='CODE_EDITOR_WRAP' />\n <CodeSnippetFullscreenButton data-analytics-id='CODE_EDITOR_FULLSCREEN' />\n </CodeSnippetActions>\n </CodeSnippetHeader>\n <CodeEditorContent\n aria-label='HTTP request'\n lineNumbers\n data-analytics-id='CODE_EDITOR_REQUEST'\n data-analytics-props='{\"surface\":\"rule-editor\"}'\n />\n </CodeEditorRoot>\n)",
|
|
20379
|
+
"description": "Where analytics attributes land. `data-*` / `aria-*` / `id` on `CodeEditorContent`\nreach the typing surface (`role=\"textbox\"`), chrome buttons take them directly, and\nfold buttons take them through `toggleProps` / `summaryProps`. Popups drawn by the\neditor (autocomplete, tooltips, search panel) are not attributable — see\n`CodeEditor/ANALYTICS_GAPS.md`."
|
|
20380
|
+
},
|
|
20381
|
+
{
|
|
20382
|
+
"name": "EditingWorkflow",
|
|
20383
|
+
"code": "() => <EditingWorkflowDemo />",
|
|
20384
|
+
"description": "A controlled HTTP request with header and body folds and a JSON Schema on the body —\n`retries` breaks the schema's maximum on purpose, so the underline and its hover message\nare part of the example. The editor's description points at `CODE_EDITOR_KEYBOARD_HINT`."
|
|
20385
|
+
},
|
|
20386
|
+
{
|
|
20387
|
+
"name": "TabsKeepHistory",
|
|
20388
|
+
"code": "() => <TabsKeepHistoryDemo />",
|
|
20389
|
+
"description": "Each tab passes its own `documentId`, so switching swaps in that document's undo history,\nselection and collapsed folds instead of replacing the text of one shared document."
|
|
20390
|
+
},
|
|
20391
|
+
{
|
|
20392
|
+
"name": "LongDocument",
|
|
20393
|
+
"code": "() => <LongDocumentDemo />",
|
|
20394
|
+
"description": "2 000 read-only lines clamped by `maxLines` — the top of the envelope the colour painter is\nbuilt for, where `readOnly` still lets the text be focused, searched and copied."
|
|
20395
|
+
}
|
|
20396
|
+
]
|
|
20397
|
+
},
|
|
19178
20398
|
{
|
|
19179
20399
|
"name": "CodeSnippet",
|
|
19180
20400
|
"description": "Code block with syntax highlighting, actions, line numbers, folding, and maxLines collapse.",
|
|
19181
20401
|
"importPath": "@wallarm-org/design-system/CodeSnippet",
|
|
19182
20402
|
"props": [],
|
|
19183
|
-
"variants": [
|
|
20403
|
+
"variants": [
|
|
20404
|
+
{
|
|
20405
|
+
"name": "size",
|
|
20406
|
+
"options": [
|
|
20407
|
+
"sm",
|
|
20408
|
+
"md",
|
|
20409
|
+
"lg"
|
|
20410
|
+
],
|
|
20411
|
+
"defaultValue": "sm"
|
|
20412
|
+
}
|
|
20413
|
+
],
|
|
19184
20414
|
"subComponents": [
|
|
19185
20415
|
{
|
|
19186
20416
|
"name": "CodeSnippetActions",
|
|
@@ -23710,9 +24940,9 @@
|
|
|
23710
24940
|
"props": [
|
|
23711
24941
|
{
|
|
23712
24942
|
"name": "text",
|
|
23713
|
-
"type": "string",
|
|
24943
|
+
"type": "string | (() => string)",
|
|
23714
24944
|
"required": true,
|
|
23715
|
-
"description": "The text to copy to the clipboard."
|
|
24945
|
+
"description": "The text to copy to the clipboard. Pass a function to read the text\nlazily at click time (e.g. the live document of an editor)."
|
|
23716
24946
|
},
|
|
23717
24947
|
{
|
|
23718
24948
|
"name": "tooltip",
|