@stacksjs/components 0.2.854 → 0.2.857
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/CodeEditor-jg4w7e15.stx +497 -0
- package/dist/ContextMenu-43g3w5tp.stx +188 -0
- package/dist/DataGrid-7rt7v865.stx +376 -0
- package/dist/GraphView-0t3t9mec.stx +320 -0
- package/dist/JsonTree-satc4010.stx +317 -0
- package/dist/PreviewFrame-erbgvzj8.stx +257 -0
- package/dist/SplitPane-7sqfdwqa.stx +159 -0
- package/dist/code-editor/editor.js +2166 -0
- package/dist/component-api/component-api.js +36 -0
- package/dist/components/CodeBlock.d.ts +12 -5
- package/dist/context-menu/context-menu.js +575 -0
- package/dist/data-grid/data-grid.js +1244 -0
- package/dist/graph-view/graph-view.js +1408 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +34 -15
- package/dist/json-tree/json-tree.js +1121 -0
- package/dist/preview-frame/preview-frame.js +356 -0
- package/dist/split-pane/split-pane.js +364 -0
- package/dist/ui/code-editor/CodeEditor.d.ts +46 -0
- package/dist/ui/code-editor/controller.d.ts +103 -0
- package/dist/ui/code-editor/core/commands.d.ts +55 -0
- package/dist/ui/code-editor/core/completion.d.ts +40 -0
- package/dist/ui/code-editor/core/editor.d.ts +69 -0
- package/dist/ui/code-editor/core/highlight.d.ts +61 -0
- package/dist/ui/code-editor/core/history.d.ts +27 -0
- package/dist/ui/code-editor/core/index.d.ts +13 -0
- package/dist/ui/code-editor/core/keymap.d.ts +38 -0
- package/dist/ui/code-editor/core/selection.d.ts +30 -0
- package/dist/ui/code-editor/core/text.d.ts +64 -0
- package/dist/ui/code-editor/editor.d.ts +15 -0
- package/dist/ui/code-editor/index.d.ts +29 -0
- package/dist/ui/code-editor/tokenizer.d.ts +18 -0
- package/dist/ui/code-editor/view.d.ts +59 -0
- package/dist/ui/context-menu/ContextMenu.d.ts +14 -0
- package/dist/ui/context-menu/context-menu.d.ts +8 -0
- package/dist/ui/context-menu/core.d.ts +74 -0
- package/dist/ui/context-menu/index.d.ts +11 -0
- package/dist/ui/context-menu/view.d.ts +36 -0
- package/dist/ui/data-grid/DataGrid.d.ts +30 -0
- package/dist/ui/data-grid/core.d.ts +141 -0
- package/dist/ui/data-grid/data-grid.d.ts +9 -0
- package/dist/ui/data-grid/index.d.ts +20 -0
- package/dist/ui/data-grid/view.d.ts +56 -0
- package/dist/ui/graph-view/GraphView.d.ts +21 -0
- package/dist/ui/graph-view/core/edges.d.ts +34 -0
- package/dist/ui/graph-view/core/force.d.ts +10 -0
- package/dist/ui/graph-view/core/graph.d.ts +83 -0
- package/dist/ui/graph-view/core/index.d.ts +5 -0
- package/dist/ui/graph-view/core/layered.d.ts +24 -0
- package/dist/ui/graph-view/core/viewport.d.ts +34 -0
- package/dist/ui/graph-view/graph-view.d.ts +9 -0
- package/dist/ui/graph-view/index.d.ts +21 -0
- package/dist/ui/graph-view/view.d.ts +51 -0
- package/dist/ui/json-tree/JsonTree.d.ts +18 -0
- package/dist/ui/json-tree/core.d.ts +108 -0
- package/dist/ui/json-tree/index.d.ts +18 -0
- package/dist/ui/json-tree/json-tree.d.ts +10 -0
- package/dist/ui/json-tree/tinker.d.ts +84 -0
- package/dist/ui/json-tree/view.d.ts +59 -0
- package/dist/ui/preview-frame/PreviewFrame.d.ts +44 -0
- package/dist/ui/preview-frame/core.d.ts +81 -0
- package/dist/ui/preview-frame/index.d.ts +19 -0
- package/dist/ui/preview-frame/preview-frame.d.ts +8 -0
- package/dist/ui/preview-frame/view.d.ts +37 -0
- package/dist/ui/split-pane/SplitPane.d.ts +18 -0
- package/dist/ui/split-pane/core.d.ts +58 -0
- package/dist/ui/split-pane/index.d.ts +15 -0
- package/dist/ui/split-pane/split-pane.d.ts +8 -0
- package/dist/ui/split-pane/view.d.ts +27 -0
- package/dist/ui/virtual-table/index.d.ts +6 -0
- package/dist/utils/component-api.d.ts +4 -0
- package/dist/utils/highlighter.d.ts +19 -1
- package/dist/utils/highlighter.js +24 -7
- package/dist/utils/syntax-theme.d.ts +44 -0
- package/package.json +44 -4
- package/src/components/CodeBlock.stx +195 -17
- package/src/index.ts +10 -0
- package/src/ui/code-editor/CodeEditor.stx +497 -0
- package/src/ui/code-editor/README.md +135 -0
- package/src/ui/code-editor/controller.ts +517 -0
- package/src/ui/code-editor/core/commands.ts +381 -0
- package/src/ui/code-editor/core/completion.ts +212 -0
- package/src/ui/code-editor/core/editor.ts +319 -0
- package/src/ui/code-editor/core/highlight.ts +203 -0
- package/src/ui/code-editor/core/history.ts +190 -0
- package/src/ui/code-editor/core/index.ts +14 -0
- package/src/ui/code-editor/core/keymap.ts +125 -0
- package/src/ui/code-editor/core/selection.ts +104 -0
- package/src/ui/code-editor/core/text.ts +252 -0
- package/src/ui/code-editor/editor.ts +16 -0
- package/src/ui/code-editor/index.ts +46 -0
- package/src/ui/code-editor/tokenizer.ts +74 -0
- package/src/ui/code-editor/view.ts +1066 -0
- package/src/ui/context-menu/ContextMenu.stx +188 -0
- package/src/ui/context-menu/README.md +117 -0
- package/src/ui/context-menu/context-menu.ts +8 -0
- package/src/ui/context-menu/core.ts +250 -0
- package/src/ui/context-menu/index.ts +16 -0
- package/src/ui/context-menu/view.ts +540 -0
- package/src/ui/data-grid/DataGrid.stx +376 -0
- package/src/ui/data-grid/README.md +204 -0
- package/src/ui/data-grid/core.ts +813 -0
- package/src/ui/data-grid/data-grid.ts +9 -0
- package/src/ui/data-grid/index.ts +34 -0
- package/src/ui/data-grid/view.ts +806 -0
- package/src/ui/graph-view/GraphView.stx +320 -0
- package/src/ui/graph-view/README.md +210 -0
- package/src/ui/graph-view/core/edges.ts +180 -0
- package/src/ui/graph-view/core/force.ts +237 -0
- package/src/ui/graph-view/core/graph.ts +277 -0
- package/src/ui/graph-view/core/index.ts +5 -0
- package/src/ui/graph-view/core/layered.ts +256 -0
- package/src/ui/graph-view/core/viewport.ts +141 -0
- package/src/ui/graph-view/graph-view.ts +9 -0
- package/src/ui/graph-view/index.ts +35 -0
- package/src/ui/graph-view/view.ts +809 -0
- package/src/ui/json-tree/JsonTree.stx +317 -0
- package/src/ui/json-tree/README.md +193 -0
- package/src/ui/json-tree/core.ts +588 -0
- package/src/ui/json-tree/index.ts +28 -0
- package/src/ui/json-tree/json-tree.ts +10 -0
- package/src/ui/json-tree/tinker.ts +349 -0
- package/src/ui/json-tree/view.ts +665 -0
- package/src/ui/preview-frame/PreviewFrame.stx +257 -0
- package/src/ui/preview-frame/README.md +107 -0
- package/src/ui/preview-frame/core.ts +195 -0
- package/src/ui/preview-frame/index.ts +31 -0
- package/src/ui/preview-frame/preview-frame.ts +8 -0
- package/src/ui/preview-frame/view.ts +336 -0
- package/src/ui/split-pane/README.md +87 -0
- package/src/ui/split-pane/SplitPane.stx +159 -0
- package/src/ui/split-pane/core.ts +200 -0
- package/src/ui/split-pane/index.ts +24 -0
- package/src/ui/split-pane/split-pane.ts +8 -0
- package/src/ui/split-pane/view.ts +305 -0
- package/src/ui/virtual-table/index.ts +6 -0
- package/src/utils/component-api.ts +72 -0
- package/src/utils/highlighter.ts +121 -218
- package/src/utils/syntax-theme.ts +144 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TinkerValue } from './tinker';
|
|
2
|
+
import type { TreeNode, TreeOpenKind, TreePath } from './core';
|
|
3
|
+
export declare interface JsonTreeProps {
|
|
4
|
+
value?: TreeNode | TreeNode[] | null
|
|
5
|
+
tinker?: TinkerValue | null
|
|
6
|
+
depth?: number
|
|
7
|
+
rowHeight?: number
|
|
8
|
+
height?: string
|
|
9
|
+
label?: string
|
|
10
|
+
openable?: (node: TreeNode, path: TreePath) => TreeOpenKind | TreeOpenKind[] | null | undefined
|
|
11
|
+
contextMenu?: boolean
|
|
12
|
+
id?: string
|
|
13
|
+
className?: string
|
|
14
|
+
}
|
|
15
|
+
export * from './core';
|
|
16
|
+
export { default as JsonTree } from './JsonTree';
|
|
17
|
+
export * from './tinker';
|
|
18
|
+
export * from './view';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The value inspector without its stx template.
|
|
3
|
+
*
|
|
4
|
+
* `@stacksjs/components/json-tree`. The model (`./core`, no DOM), the adapter
|
|
5
|
+
* for tinker results (`./tinker`) and the view that draws a model into any
|
|
6
|
+
* element.
|
|
7
|
+
*/
|
|
8
|
+
export * from './core';
|
|
9
|
+
export * from './tinker';
|
|
10
|
+
export * from './view';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { TreeNode } from './core';
|
|
2
|
+
/**
|
|
3
|
+
* Turn a tinker value into a tree node.
|
|
4
|
+
*
|
|
5
|
+
* Every container keeps the serializer's object id (prefixed), which is what a
|
|
6
|
+
* `ref` names, so following a cycle in the tree lands on the right node.
|
|
7
|
+
*/
|
|
8
|
+
export declare function fromTinkerValue(value: TinkerValue, label?: string, options?: FromTinkerOptions): TreeNode;
|
|
9
|
+
export declare interface TinkerStackFrame {
|
|
10
|
+
function?: string
|
|
11
|
+
file?: string
|
|
12
|
+
line?: number
|
|
13
|
+
column?: number
|
|
14
|
+
}
|
|
15
|
+
export declare interface TinkerErrorValue {
|
|
16
|
+
t: 'error'
|
|
17
|
+
name: string
|
|
18
|
+
message: string
|
|
19
|
+
stack?: string
|
|
20
|
+
frames?: TinkerStackFrame[]
|
|
21
|
+
cause?: TinkerValue
|
|
22
|
+
entries?: Array<[string, TinkerValue]>
|
|
23
|
+
}
|
|
24
|
+
export declare interface TinkerModelValue {
|
|
25
|
+
t: 'model'
|
|
26
|
+
id: number
|
|
27
|
+
model: string
|
|
28
|
+
table?: string
|
|
29
|
+
primaryKey?: string
|
|
30
|
+
key?: TinkerValue
|
|
31
|
+
attributes: Array<[string, TinkerValue]>
|
|
32
|
+
hidden?: string[]
|
|
33
|
+
loaded?: Array<[string, TinkerValue]>
|
|
34
|
+
relations?: Array<{ kind: string, model: string, name?: string }>
|
|
35
|
+
more?: number
|
|
36
|
+
}
|
|
37
|
+
export declare interface TinkerHtmlValue {
|
|
38
|
+
t: 'html'
|
|
39
|
+
kind: 'mail' | 'view' | 'html'
|
|
40
|
+
title?: string
|
|
41
|
+
html: string
|
|
42
|
+
text?: string
|
|
43
|
+
truncated?: number
|
|
44
|
+
}
|
|
45
|
+
export declare interface FromTinkerOptions {
|
|
46
|
+
idPrefix?: string
|
|
47
|
+
}
|
|
48
|
+
/** What the tree's `meta` holds for a model node. */
|
|
49
|
+
export declare interface TinkerModelMeta {
|
|
50
|
+
model: string
|
|
51
|
+
table?: string
|
|
52
|
+
primaryKey?: string
|
|
53
|
+
hidden: string[]
|
|
54
|
+
relations: Array<{ kind: string, model: string, name?: string }>
|
|
55
|
+
}
|
|
56
|
+
/** What the tree's `meta` holds for rendered markup. */
|
|
57
|
+
export declare interface TinkerHtmlMeta {
|
|
58
|
+
kind: TinkerHtmlValue['kind']
|
|
59
|
+
title?: string
|
|
60
|
+
text?: string
|
|
61
|
+
truncated?: number
|
|
62
|
+
}
|
|
63
|
+
export type TinkerValue = | { t: 'undefined' }
|
|
64
|
+
| { t: 'null' }
|
|
65
|
+
| { t: 'boolean', v: boolean }
|
|
66
|
+
| { t: 'number', v: number | 'NaN' | 'Infinity' | '-Infinity' | '-0' }
|
|
67
|
+
| { t: 'bigint', v: string }
|
|
68
|
+
| { t: 'string', v: string, truncated?: number }
|
|
69
|
+
| { t: 'symbol', v: string }
|
|
70
|
+
| { t: 'function', name: string, kind: 'function' | 'async' | 'class' | 'generator' }
|
|
71
|
+
| { t: 'date', v: string | null }
|
|
72
|
+
| { t: 'regexp', v: string }
|
|
73
|
+
| { t: 'url', v: string }
|
|
74
|
+
| { t: 'promise' }
|
|
75
|
+
| { t: 'bytes', ctor: string, length: number, hex: string }
|
|
76
|
+
| { t: 'array', id: number, ctor?: string, length: number, items: TinkerValue[], more?: number }
|
|
77
|
+
| { t: 'object', id: number, ctor?: string, entries: Array<[string, TinkerValue]>, more?: number }
|
|
78
|
+
| { t: 'map', id: number, size: number, entries: Array<[TinkerValue, TinkerValue]>, more?: number }
|
|
79
|
+
| { t: 'set', id: number, size: number, items: TinkerValue[], more?: number }
|
|
80
|
+
| TinkerModelValue
|
|
81
|
+
| TinkerHtmlValue
|
|
82
|
+
| { t: 'ref', id: number }
|
|
83
|
+
| { t: 'cut', reason: 'depth' | 'nodes', ctor?: string }
|
|
84
|
+
| TinkerErrorValue;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { TreeModel } from './core';
|
|
2
|
+
import type { TreeNode, TreeOpenKind, TreePath } from './core';
|
|
3
|
+
export declare interface JsonTreeOptions {
|
|
4
|
+
value?: TreeNode | TreeNode[] | null
|
|
5
|
+
depth?: number
|
|
6
|
+
rowHeight?: number
|
|
7
|
+
overscan?: number
|
|
8
|
+
openable?: ((node: TreeNode, path: TreePath) => TreeOpenKind | TreeOpenKind[] | null | undefined) | null
|
|
9
|
+
contextMenu?: boolean
|
|
10
|
+
}
|
|
11
|
+
export declare interface TreeSelectDetail {
|
|
12
|
+
id: string
|
|
13
|
+
node: TreeNode
|
|
14
|
+
path: TreePath
|
|
15
|
+
pathText: string
|
|
16
|
+
}
|
|
17
|
+
export declare interface TreeToggleDetail extends TreeSelectDetail {
|
|
18
|
+
expanded: boolean
|
|
19
|
+
}
|
|
20
|
+
export declare interface TreeCopyDetail {
|
|
21
|
+
what: 'value' | 'path'
|
|
22
|
+
text: string
|
|
23
|
+
path: TreePath
|
|
24
|
+
node: TreeNode
|
|
25
|
+
}
|
|
26
|
+
export declare interface TreeOpenDetail extends TreeSelectDetail {
|
|
27
|
+
as: TreeOpenKind
|
|
28
|
+
}
|
|
29
|
+
export declare interface TreeContextDetail extends TreeSelectDetail {
|
|
30
|
+
x: number
|
|
31
|
+
y: number
|
|
32
|
+
}
|
|
33
|
+
export declare interface JsonTreeCallbacks {
|
|
34
|
+
onSelect?: (detail: TreeSelectDetail) => void
|
|
35
|
+
onToggle?: (detail: TreeToggleDetail) => void
|
|
36
|
+
onCopy?: (detail: TreeCopyDetail) => void
|
|
37
|
+
onOpen?: (detail: TreeOpenDetail) => void
|
|
38
|
+
onLoadMore?: (detail: TreeSelectDetail) => void
|
|
39
|
+
onContext?: (detail: TreeContextDetail) => void
|
|
40
|
+
}
|
|
41
|
+
export declare class JsonTreeView {
|
|
42
|
+
readonly model: TreeModel;
|
|
43
|
+
constructor(root: HTMLElement, options?: JsonTreeOptions, callbacks?: JsonTreeCallbacks);
|
|
44
|
+
setValue(value: TreeNode | TreeNode[] | null | undefined): void;
|
|
45
|
+
setDepth(depth: number): void;
|
|
46
|
+
setOpenable(openable: JsonTreeOptions['openable']): void;
|
|
47
|
+
setContextMenu(on: boolean): void;
|
|
48
|
+
expandAll(id?: string): void;
|
|
49
|
+
collapseAll(): void;
|
|
50
|
+
expand(id: string): boolean;
|
|
51
|
+
collapse(id: string): boolean;
|
|
52
|
+
reveal(id: string): boolean;
|
|
53
|
+
appendChildren(id: string, nodes: TreeNode[], more?: number): boolean;
|
|
54
|
+
getSelected(): TreeSelectDetail | null;
|
|
55
|
+
select(id: string): boolean;
|
|
56
|
+
focus(): void;
|
|
57
|
+
get drawn(): number;
|
|
58
|
+
destroy(): void;
|
|
59
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { DefineComponent } from '@stacksjs/stx';
|
|
2
|
+
declare const __dtsx_component__: __DtsxStxComponentType;
|
|
3
|
+
export declare const html: boolean;
|
|
4
|
+
export declare const viewport: unknown;
|
|
5
|
+
export declare const frameWidth: unknown;
|
|
6
|
+
export declare const frameHeight: unknown;
|
|
7
|
+
export declare const landscape: ReturnType<typeof $bool>;
|
|
8
|
+
export declare const scheme: unknown;
|
|
9
|
+
/*
|
|
10
|
+
* Off unless asked for. A page's scripts never share the host's origin either
|
|
11
|
+
* way; this decides whether they run at all.
|
|
12
|
+
*/
|
|
13
|
+
export declare const scripts: ReturnType<typeof $bool>;
|
|
14
|
+
export declare const forms: ReturnType<typeof $bool>;
|
|
15
|
+
export declare const toolbar: unknown;
|
|
16
|
+
export declare const title: unknown;
|
|
17
|
+
/* A CSS length for the whole component, toolbar included. */
|
|
18
|
+
export declare const height: unknown;
|
|
19
|
+
export declare const className: unknown;
|
|
20
|
+
export declare const previewId: unknown;
|
|
21
|
+
/** @defaultValue `[ { name: 'fill', label: 'Fill' }, { name: 'phone', label: 'Phone' }, { name: 'tablet', label: 'Tablet' }, { name: 'desktop', label: 'Desktop' }, ]` */
|
|
22
|
+
export declare const viewports: ({
|
|
23
|
+
/** @defaultValue 'fill' */
|
|
24
|
+
name: string;
|
|
25
|
+
/** @defaultValue 'Fill' */
|
|
26
|
+
label: string
|
|
27
|
+
} | {
|
|
28
|
+
/** @defaultValue 'phone' */
|
|
29
|
+
name: string;
|
|
30
|
+
/** @defaultValue 'Phone' */
|
|
31
|
+
label: string
|
|
32
|
+
} | {
|
|
33
|
+
/** @defaultValue 'tablet' */
|
|
34
|
+
name: string;
|
|
35
|
+
/** @defaultValue 'Tablet' */
|
|
36
|
+
label: string
|
|
37
|
+
} | {
|
|
38
|
+
/** @defaultValue 'desktop' */
|
|
39
|
+
name: string;
|
|
40
|
+
/** @defaultValue 'Desktop' */
|
|
41
|
+
label: string
|
|
42
|
+
})[];
|
|
43
|
+
declare type __DtsxStxComponentType = DefineComponent<{ html?: unknown, viewport?: unknown, frameWidth?: unknown, frameHeight?: unknown, landscape?: unknown, scheme?: unknown, scripts?: unknown, forms?: unknown, toolbar?: unknown, title?: string, height?: string, className?: string, id?: string }> & { readonly __stxEmits?: ["load", "reload", "viewport", "scheme"] }
|
|
44
|
+
export default __dtsx_component__;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The viewport a name stands for.
|
|
3
|
+
*
|
|
4
|
+
* A width and a height given outright win over a name. `landscape` turns a
|
|
5
|
+
* preset on its side; a desktop is already on its side and stays as it is.
|
|
6
|
+
* A name nobody knows fills the box, which is the least surprising thing to do
|
|
7
|
+
* with it.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveViewport(name: unknown, options?: { width?: unknown, height?: unknown, landscape?: boolean }): ResolvedViewport;
|
|
10
|
+
/**
|
|
11
|
+
* How much to shrink a viewport so it fits a box, never enlarging it: a page
|
|
12
|
+
* drawn larger than life would misreport what it looks like.
|
|
13
|
+
*/
|
|
14
|
+
export declare function fitScale(viewport: ViewportSize, available: ViewportSize, padding?: number): number;
|
|
15
|
+
/** `390 × 844`, with the scale when the page is shown smaller than life. */
|
|
16
|
+
export declare function describeViewport(viewport: ResolvedViewport, scale?: number): string;
|
|
17
|
+
export declare function normalizeScheme(value: unknown): PreviewScheme;
|
|
18
|
+
/**
|
|
19
|
+
* The frame's `sandbox` value. Empty is the strictest there is: no scripts, no
|
|
20
|
+
* forms, an origin of its own. An empty string still has to be written as the
|
|
21
|
+
* attribute, since a frame with no `sandbox` attribute is not sandboxed at all.
|
|
22
|
+
*/
|
|
23
|
+
export declare function sandboxValue(options?: SandboxOptions): string;
|
|
24
|
+
/** Whether a sandbox value keeps the page away from the host. */
|
|
25
|
+
export declare function isIsolatingSandbox(value: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The document the frame is given.
|
|
28
|
+
*
|
|
29
|
+
* A fragment (`<h1>Hi</h1>`) is wrapped in a page that follows the colour
|
|
30
|
+
* scheme, so bare markup is dark on a dark preview the way it would be in a
|
|
31
|
+
* dark page. A whole document is left as its author wrote it: a mail that
|
|
32
|
+
* declares no dark styles is shown light, which is what a mail client does
|
|
33
|
+
* with it.
|
|
34
|
+
*
|
|
35
|
+
* Either way links open "in a new window", which the sandbox refuses, so a
|
|
36
|
+
* click cannot navigate the preview away from what is being previewed.
|
|
37
|
+
*/
|
|
38
|
+
export declare function buildDocument(html: string | null | undefined, options?: DocumentOptions): string;
|
|
39
|
+
/** Whether a document says which colour schemes it supports. */
|
|
40
|
+
export declare function declaresColorScheme(html: string): boolean;
|
|
41
|
+
/** The preset after `name` in the toolbar's order, for the arrow keys. `fill` comes first. */
|
|
42
|
+
export declare function stepViewport(name: ViewportName, direction: 1 | -1): ViewportName;
|
|
43
|
+
/** CSS pixels, portrait for the two that are held in a hand. */
|
|
44
|
+
export declare const VIEWPORT_PRESETS: readonly ViewportPreset[];
|
|
45
|
+
/**
|
|
46
|
+
* Tokens that would give the page a way back to the host, and are never
|
|
47
|
+
* granted whatever is asked for. `allow-same-origin` puts the page in the
|
|
48
|
+
* host's origin, where its scripts can read the host's storage and DOM; the
|
|
49
|
+
* navigation ones let it replace the host page; popups get a window the
|
|
50
|
+
* sandbox does not cover.
|
|
51
|
+
*/
|
|
52
|
+
export declare const FORBIDDEN_SANDBOX_TOKENS: readonly string[];
|
|
53
|
+
export declare interface ViewportSize {
|
|
54
|
+
width: number
|
|
55
|
+
height: number
|
|
56
|
+
}
|
|
57
|
+
export declare interface ViewportPreset extends ViewportSize {
|
|
58
|
+
name: Exclude<ViewportName, 'fill' | 'custom'>
|
|
59
|
+
label: string
|
|
60
|
+
}
|
|
61
|
+
export declare interface ResolvedViewport {
|
|
62
|
+
name: ViewportName
|
|
63
|
+
size: ViewportSize | null
|
|
64
|
+
landscape: boolean
|
|
65
|
+
}
|
|
66
|
+
export declare interface SandboxOptions {
|
|
67
|
+
scripts?: boolean
|
|
68
|
+
forms?: boolean
|
|
69
|
+
}
|
|
70
|
+
export declare interface DocumentOptions {
|
|
71
|
+
title?: string
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* What a preview is made of, before there is a frame. No DOM.
|
|
75
|
+
*
|
|
76
|
+
* The document that goes into the frame, the permissions the frame is given,
|
|
77
|
+
* and the arithmetic of showing a phone-sized page in a box that is not
|
|
78
|
+
* phone-sized.
|
|
79
|
+
*/
|
|
80
|
+
export type PreviewScheme = 'light' | 'dark' | 'auto';
|
|
81
|
+
export type ViewportName = 'fill' | 'phone' | 'tablet' | 'desktop' | 'custom';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PreviewScheme, ViewportName } from './core';
|
|
2
|
+
export declare interface PreviewFrameProps {
|
|
3
|
+
html?: string
|
|
4
|
+
viewport?: Exclude<ViewportName, 'custom'>
|
|
5
|
+
frameWidth?: number
|
|
6
|
+
frameHeight?: number
|
|
7
|
+
landscape?: boolean
|
|
8
|
+
scheme?: PreviewScheme
|
|
9
|
+
scripts?: boolean
|
|
10
|
+
forms?: boolean
|
|
11
|
+
toolbar?: boolean
|
|
12
|
+
title?: string
|
|
13
|
+
height?: string
|
|
14
|
+
id?: string
|
|
15
|
+
className?: string
|
|
16
|
+
}
|
|
17
|
+
export * from './core';
|
|
18
|
+
export { default as PreviewFrame } from './PreviewFrame';
|
|
19
|
+
export * from './view';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The preview frame without its stx template.
|
|
3
|
+
*
|
|
4
|
+
* `@stacksjs/components/preview-frame`. The document and sandbox a preview is
|
|
5
|
+
* built from (`./core`, no DOM), and the view that puts one in a frame.
|
|
6
|
+
*/
|
|
7
|
+
export * from './core';
|
|
8
|
+
export * from './view';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { PreviewScheme, ViewportName } from './core';
|
|
2
|
+
export declare interface PreviewFrameOptions {
|
|
3
|
+
html?: string
|
|
4
|
+
viewport?: ViewportName | string
|
|
5
|
+
frameWidth?: number | null
|
|
6
|
+
frameHeight?: number | null
|
|
7
|
+
landscape?: boolean
|
|
8
|
+
scheme?: PreviewScheme
|
|
9
|
+
scripts?: boolean
|
|
10
|
+
forms?: boolean
|
|
11
|
+
title?: string
|
|
12
|
+
}
|
|
13
|
+
export declare interface PreviewState {
|
|
14
|
+
viewport: ViewportName
|
|
15
|
+
width: number | null
|
|
16
|
+
height: number | null
|
|
17
|
+
landscape: boolean
|
|
18
|
+
scale: number
|
|
19
|
+
scheme: PreviewScheme
|
|
20
|
+
effectiveScheme: 'light' | 'dark'
|
|
21
|
+
}
|
|
22
|
+
export declare interface PreviewFrameCallbacks {
|
|
23
|
+
onLoad?: (state: PreviewState) => void
|
|
24
|
+
onReload?: (state: PreviewState) => void
|
|
25
|
+
onViewport?: (state: PreviewState) => void
|
|
26
|
+
onScheme?: (state: PreviewState) => void
|
|
27
|
+
}
|
|
28
|
+
export declare class PreviewFrameView {
|
|
29
|
+
constructor(root: HTMLElement, options?: PreviewFrameOptions, callbacks?: PreviewFrameCallbacks);
|
|
30
|
+
getState(): PreviewState;
|
|
31
|
+
setHtml(html: string | null | undefined): void;
|
|
32
|
+
setViewport(name: string, options?: { landscape?: boolean, width?: number | null, height?: number | null }): void;
|
|
33
|
+
setScheme(scheme: unknown): void;
|
|
34
|
+
setPermissions(options: { scripts?: boolean, forms?: boolean }): void;
|
|
35
|
+
reload(): void;
|
|
36
|
+
destroy(): void;
|
|
37
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DefineComponent } from '@stacksjs/stx';
|
|
2
|
+
declare const __dtsx_component__: __DtsxStxComponentType;
|
|
3
|
+
export declare const direction: boolean;
|
|
4
|
+
/*
|
|
5
|
+
* Shares, one per pane: `[30, 70]`, `[1, 2, 1]`, or the text `30,70`. Left
|
|
6
|
+
* out, each pane's own `data-size` is used, and equal shares after that.
|
|
7
|
+
*/
|
|
8
|
+
export declare const sizes: ReturnType<typeof Array.isArray>;
|
|
9
|
+
export declare const minSize: unknown;
|
|
10
|
+
export declare const step: unknown;
|
|
11
|
+
export declare const storageKey: unknown;
|
|
12
|
+
export declare const label: unknown;
|
|
13
|
+
/* A CSS length. A split fills the box it is given, so the box needs a height. */
|
|
14
|
+
export declare const height: unknown;
|
|
15
|
+
export declare const className: unknown;
|
|
16
|
+
export declare const splitId: unknown;
|
|
17
|
+
declare type __DtsxStxComponentType = DefineComponent<{ direction?: unknown, sizes?: unknown, minSize?: unknown, step?: unknown, storageKey?: string, label?: string, height?: string, className?: string, id?: string }> & { readonly __stxEmits?: ["resize", "resize-end"] }
|
|
18
|
+
export default __dtsx_component__;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** Equal shares for `count` panes. */
|
|
2
|
+
export declare function equalSizes(count: number): number[];
|
|
3
|
+
/**
|
|
4
|
+
* Fractions that add up to one, from any list of positive numbers.
|
|
5
|
+
*
|
|
6
|
+
* `[30, 70]`, `[0.3, 0.7]` and `[3, 7]` are the same layout. A list of the
|
|
7
|
+
* wrong length, or one holding anything that is not a positive finite number,
|
|
8
|
+
* is not a layout, and the panes are shared equally instead.
|
|
9
|
+
*/
|
|
10
|
+
export declare function normalizeSizes(sizes: readonly number[] | null | undefined, count: number): number[];
|
|
11
|
+
/**
|
|
12
|
+
* Read sizes as they arrive from an attribute, a prop or storage: an array, a
|
|
13
|
+
* JSON array, or `30,70`. Null when there is nothing usable.
|
|
14
|
+
*/
|
|
15
|
+
export declare function parseSizes(value: unknown): number[] | null;
|
|
16
|
+
/** A pixel length from `120`, `'120'` or `'120px'`. The fallback for anything else. */
|
|
17
|
+
export declare function parseLength(value: unknown, fallback: number): number;
|
|
18
|
+
/**
|
|
19
|
+
* Bring a layout inside its limits for a container `total` pixels long.
|
|
20
|
+
*
|
|
21
|
+
* A pane under its minimum is raised to it and the difference is taken from
|
|
22
|
+
* the panes that have room, in proportion to the room they have. When the
|
|
23
|
+
* minimums do not fit at all the container is simply too small, and the panes
|
|
24
|
+
* share it in proportion to their minimums, which is the least wrong answer.
|
|
25
|
+
*/
|
|
26
|
+
export declare function fitSizes(sizes: readonly number[], total: number, limits: readonly PaneLimit[]): number[];
|
|
27
|
+
/**
|
|
28
|
+
* Move the divider after pane `index` by `delta` pixels.
|
|
29
|
+
*
|
|
30
|
+
* A positive delta grows the pane before the divider. The pane next to the
|
|
31
|
+
* divider on the other side shrinks first; once it is at its minimum the one
|
|
32
|
+
* beyond it gives, and so on, which is what dragging a divider through a
|
|
33
|
+
* narrow pane should do. The pane that grows stops at its maximum.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resizeAt(sizes: readonly number[], index: number, delta: number, total: number, limits: readonly PaneLimit[]): number[];
|
|
36
|
+
/** How far the divider after pane `index` can move each way, in pixels. */
|
|
37
|
+
export declare function dividerRange(sizes: readonly number[], index: number, total: number, limits: readonly PaneLimit[]): { back: number, forward: number };
|
|
38
|
+
/** What a separator reports to assistive technology: the pane before it, in percent. */
|
|
39
|
+
export declare function separatorValue(sizes: readonly number[], index: number, total: number, limits: readonly PaneLimit[]): { now: number, min: number, max: number };
|
|
40
|
+
/** The storage name a layout is kept under. */
|
|
41
|
+
export declare function storageName(key: string): string;
|
|
42
|
+
/** Sizes as they are stored: rounded, so the text is short and stable. */
|
|
43
|
+
export declare function serializeSizes(sizes: readonly number[]): string;
|
|
44
|
+
/** The pixel limits of one pane. `max` is `Infinity` when there is none. */
|
|
45
|
+
export declare interface PaneLimit {
|
|
46
|
+
min: number
|
|
47
|
+
max: number
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The arithmetic of a split layout. No DOM.
|
|
51
|
+
*
|
|
52
|
+
* A layout is a list of fractions, one per pane, that add up to one. Fractions
|
|
53
|
+
* rather than pixels, so a window that changes size keeps its proportions and
|
|
54
|
+
* a saved layout means the same thing on another screen. Pixels come in only
|
|
55
|
+
* where a person does: a drag is so many pixels, and a pane must not get
|
|
56
|
+
* narrower than so many.
|
|
57
|
+
*/
|
|
58
|
+
export type SplitDirection = 'horizontal' | 'vertical';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SplitDirection } from './core';
|
|
2
|
+
export declare interface SplitPaneProps {
|
|
3
|
+
direction?: SplitDirection
|
|
4
|
+
sizes?: number[] | string
|
|
5
|
+
minSize?: number
|
|
6
|
+
step?: number
|
|
7
|
+
storageKey?: string
|
|
8
|
+
label?: string
|
|
9
|
+
height?: string
|
|
10
|
+
id?: string
|
|
11
|
+
className?: string
|
|
12
|
+
}
|
|
13
|
+
export * from './core';
|
|
14
|
+
export { default as SplitPane } from './SplitPane';
|
|
15
|
+
export * from './view';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { SplitDirection } from './core';
|
|
2
|
+
export declare interface SplitPaneOptions {
|
|
3
|
+
direction?: SplitDirection
|
|
4
|
+
sizes?: number[] | null
|
|
5
|
+
minSize?: number
|
|
6
|
+
storageKey?: string
|
|
7
|
+
step?: number
|
|
8
|
+
label?: string
|
|
9
|
+
}
|
|
10
|
+
export declare interface SplitResizeDetail {
|
|
11
|
+
sizes: number[]
|
|
12
|
+
pixels: number[]
|
|
13
|
+
index: number
|
|
14
|
+
source: 'pointer' | 'keyboard' | 'reset' | 'api'
|
|
15
|
+
}
|
|
16
|
+
export declare interface SplitPaneCallbacks {
|
|
17
|
+
onResize?: (detail: SplitResizeDetail) => void
|
|
18
|
+
onResizeEnd?: (detail: SplitResizeDetail) => void
|
|
19
|
+
}
|
|
20
|
+
export declare class SplitPaneView {
|
|
21
|
+
constructor(root: HTMLElement, options?: SplitPaneOptions, callbacks?: SplitPaneCallbacks);
|
|
22
|
+
getSizes(): number[];
|
|
23
|
+
setSizes(sizes: readonly number[] | null | undefined): void;
|
|
24
|
+
reset(index?: number): void;
|
|
25
|
+
setDirection(direction: SplitDirection): void;
|
|
26
|
+
destroy(): void;
|
|
27
|
+
}
|
|
@@ -16,4 +16,10 @@ export declare interface VirtualTableProps<T = any> {
|
|
|
16
16
|
hoverable?: boolean
|
|
17
17
|
className?: string
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use `<DataGrid>` (`../data-grid`). It virtualizes columns as
|
|
21
|
+
* well as rows and adds sorting, resizing, filtering, selection, keyboard
|
|
22
|
+
* navigation and export. `<VirtualTable>` stays so existing pages keep
|
|
23
|
+
* working, and gets no new features.
|
|
24
|
+
*/
|
|
19
25
|
export { default as VirtualTable } from './VirtualTable';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function componentApi<T = ExposedMethods>(target: Element | string | null | undefined): T | null;
|
|
2
|
+
/** What a component exposes when nothing more precise is known: methods by name. */
|
|
3
|
+
// eslint-disable-next-line ts/no-explicit-any
|
|
4
|
+
export type ExposedMethods = Record<string, (..._arguments: any[]) => any>;
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import type { Highlighter as TSHighlighter } from 'ts-syntax-highlighter';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* The full highlighter from the package root, for a caller that wants its API.
|
|
4
|
+
*
|
|
5
|
+
* Server only: the root entry reads a config file. `highlight()` below does
|
|
6
|
+
* not use it.
|
|
4
7
|
*/
|
|
5
8
|
export declare function getHighlighter(): Promise<TSHighlighter>;
|
|
9
|
+
/**
|
|
10
|
+
* Tokenized code as HTML, or null when it cannot be tokenized.
|
|
11
|
+
*
|
|
12
|
+
* A class on each token and no colour: `tok-keyword`, not
|
|
13
|
+
* `style="color: #cf222e"`. The highlighter's own renderer writes the colour
|
|
14
|
+
* inline, where no stylesheet can reach it, which is why this block could not
|
|
15
|
+
* follow a dark-mode switch without rendering everything twice and reading the
|
|
16
|
+
* colours back out (stacksjs/stx#2015). With classes, light and dark are one
|
|
17
|
+
* piece of markup under two sets of custom properties.
|
|
18
|
+
*
|
|
19
|
+
* Works in a browser as well as on a server, so a block whose code changes
|
|
20
|
+
* after the page has loaded can be highlighted again where it is.
|
|
21
|
+
*/
|
|
22
|
+
export declare function highlightToHtml(code: string, options?: { language?: string, theme?: 'light' | 'dark' | 'auto', lineNumbers?: boolean }): Promise<string | null>;
|
|
6
23
|
/**
|
|
7
24
|
* Highlight code with syntax highlighting
|
|
8
25
|
*/
|
|
@@ -27,3 +44,4 @@ export declare interface HighlightResult {
|
|
|
27
44
|
language: string
|
|
28
45
|
theme: string
|
|
29
46
|
}
|
|
47
|
+
declare type BrowserEntry = typeof import('ts-syntax-highlighter/browser');
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
`)
|
|
4
|
-
:root
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
var k=["keyword","string","comment","numeric","constant","function","operator","punctuation","type","variable","tag","attribute"],c={background:"#ffffff",foreground:"#24292f",keyword:"#cf222e",string:"#0a3069",comment:"#6e7781",numeric:"#0550ae",constant:"#0550ae",function:"#8250df",operator:"#cf222e",punctuation:"#24292f",type:"#953800",variable:"#953800",tag:"#116329",attribute:"#0550ae"},g={background:"#0d1117",foreground:"#c9d1d9",keyword:"#ff7b72",string:"#a5d6ff",comment:"#8b949e",numeric:"#79c0ff",constant:"#79c0ff",function:"#d2a8ff",operator:"#ff7b72",punctuation:"#c9d1d9",type:"#ffa657",variable:"#ffa657",tag:"#7ee787",attribute:"#79c0ff"},v=["background","foreground",...k];function o(t,n=" "){return v.map((e)=>`${n}--stx-syntax-${e}: ${t[e]};`).join(`
|
|
3
|
+
`)}function h(){return k.map((t)=>`.tok-${t} { color: var(--stx-syntax-${t}); }`).concat(".tok-comment { font-style: italic; }").join(`
|
|
4
|
+
`)}function C(){let t=o(c),n=o(g);return[`:where(:root) {
|
|
5
|
+
${t}
|
|
6
|
+
}`,`@media (prefers-color-scheme: dark) {
|
|
7
|
+
:where(:root:not(.light)) {
|
|
8
|
+
${n}
|
|
9
|
+
}
|
|
10
|
+
}`,`:where(.dark) {
|
|
11
|
+
${n}
|
|
12
|
+
}`,`:where([data-syntax-theme="light"]) {
|
|
13
|
+
${t}
|
|
14
|
+
}`,`:where([data-syntax-theme="dark"]) {
|
|
15
|
+
${n}
|
|
16
|
+
}`,h()].join(`
|
|
17
|
+
`)}function f(){return[".syntax {"," margin: 0;"," padding: 1rem;"," overflow-x: auto;"," border-radius: 0.375rem;"," background-color: var(--stx-syntax-background);"," color: var(--stx-syntax-foreground);",' font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;'," font-size: 0.875rem;"," line-height: 1.5;"," tab-size: 2;","}",".syntax code { display: block; font-family: inherit; }",".syntax[data-line-numbers] { counter-reset: stx-syntax-line; }",".syntax[data-line-numbers] .line::before {"," counter-increment: stx-syntax-line;"," content: counter(stx-syntax-line);"," display: inline-block;"," width: 2.5em;"," margin-right: 1em;"," text-align: right;"," opacity: 0.5;"," user-select: none;","}"].join(`
|
|
18
|
+
`)}function w(){return`${C()}
|
|
19
|
+
${f()}`}var T=null;function S(){return T??=import("ts-syntax-highlighter/browser").catch(()=>null),T}var m=null,H="github-light",R="github-dark";function p(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function A(t){return`<pre class="syntax"><code>${p(t)}</code></pre>`}async function L(){if(!m){let{createHighlighter:t}=await import("ts-syntax-highlighter");m=await t({theme:"github-light"})}return m}async function N(t,n={}){let e=await S();if(!e)return null;let r;try{let i=await e.resolveGrammar(n.language??"typescript");if(!i)return null;r=new e.Tokenizer(i).tokenizeLinesFrom(t.replace(/\r\n?/g,`
|
|
20
|
+
`).split(`
|
|
21
|
+
`)).lines}catch{return null}let l=r.map((i)=>{let d="",s="",a="",y=()=>{if(s!=="")d+=a===""?p(s):`<span class="tok-${a}">${p(s)}</span>`;s=""};for(let x of i.tokens){let b=e.tokenClass(x.type);if(b!==a)y(),a=b;s+=x.content}return y(),`<span class="line">${d}</span>`}).join(`
|
|
22
|
+
`);return`<pre ${['class="syntax"',n.theme==="light"||n.theme==="dark"?`data-syntax-theme="${n.theme}"`:"",n.lineNumbers?"data-line-numbers":""].filter(Boolean).join(" ")}><code>${l}</code></pre>`}function P(t){if(t==="auto")return w();return[`[data-syntax-theme="${t}"] {
|
|
23
|
+
${o(t==="dark"?g:c)}
|
|
24
|
+
}`,h(),f()].join(`
|
|
25
|
+
`)}async function Y(t,n={}){let{theme:e="auto",language:r="typescript",lineNumbers:l=!1}=n,u=await N(t,{language:r,theme:e,lineNumbers:l});if(u===null)return{html:A(t),css:"",language:r,theme:e==="dark"?R:H};return{html:u,css:P(e),language:r,theme:e==="auto"?"auto":e==="dark"?R:H}}function B(t){if(t.includes("<!DOCTYPE")||t.includes("<html"))return"html";if(t.includes("<?php"))return"php";if(t.includes("import")&&t.includes("from"))return"typescript";if(t.includes("function")||t.includes("const"))return"javascript";if(t.includes("{")&&t.includes("}"))return"json";if(t.includes("$")&&t.includes("|"))return"bash";if(t.includes("#")&&t.includes("##"))return"markdown";return"typescript"}function X(t,n){return`<div class="${n?`rounded-md overflow-auto text-sm leading-relaxed font-mono ${n}`:"rounded-md overflow-auto text-sm leading-relaxed font-mono"}">${t}</div>`}export{X as applyHeadwindClasses,B as detectLanguage,L as getHighlighter,Y as highlight,N as highlightToHtml};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** `--stx-syntax-keyword: #cf222e;` for every property, one per line. */
|
|
2
|
+
export declare function syntaxVariables(palette: Readonly<Record<string, string>>, indent?: string): string;
|
|
3
|
+
/** The rules that colour a token class from its variable. */
|
|
4
|
+
export declare function syntaxTokenRules(): string;
|
|
5
|
+
/**
|
|
6
|
+
* The whole sheet: light values, dark values for a reader following their
|
|
7
|
+
* system and for an app with a `.dark` toggle, an explicit theme on the
|
|
8
|
+
* element itself, and the token rules.
|
|
9
|
+
*
|
|
10
|
+
* `:where()` throughout, so none of it outranks a single class an app writes.
|
|
11
|
+
*/
|
|
12
|
+
export declare function syntaxThemeCss(): string;
|
|
13
|
+
/**
|
|
14
|
+
* The block a `<CodeBlock>` draws its code in.
|
|
15
|
+
*
|
|
16
|
+
* Line numbers are a counter, not text, so selecting a numbered block and
|
|
17
|
+
* copying it gives the code and not `1const a = 1`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function syntaxPanelCss(): string;
|
|
20
|
+
/** Everything `<CodeBlock>` needs: the palettes, the token rules and the panel. */
|
|
21
|
+
export declare function codeBlockCss(): string;
|
|
22
|
+
/**
|
|
23
|
+
* The colours of code, as CSS custom properties.
|
|
24
|
+
*
|
|
25
|
+
* Two places draw highlighted code - `<CodeBlock>` and `<CodeEditor>` - and
|
|
26
|
+
* both write a class on each token (`tok-keyword`) rather than a colour. What a
|
|
27
|
+
* keyword looks like is decided here, once, as `--stx-syntax-keyword`, so an
|
|
28
|
+
* app re-themes both by setting a variable, and light and dark are the same
|
|
29
|
+
* markup under a different set of values.
|
|
30
|
+
*
|
|
31
|
+
* The defaults are the highlighter's GitHub pair. `test/syntax-theme.test.ts`
|
|
32
|
+
* holds them to `ts-syntax-highlighter`'s own themes, so they cannot drift from
|
|
33
|
+
* what the highlighter would have written inline.
|
|
34
|
+
*
|
|
35
|
+
* A component's `<style>` block is extracted from its source before anything
|
|
36
|
+
* is interpolated, so the two components carry this CSS as literal text rather
|
|
37
|
+
* than importing it. The same test holds those copies to this file.
|
|
38
|
+
*/
|
|
39
|
+
/** The token classes, in the order the rules are written. */
|
|
40
|
+
export declare const SYNTAX_TOKENS: readonly string[];
|
|
41
|
+
export declare const SYNTAX_LIGHT: Readonly<Record<string, string>>;
|
|
42
|
+
export declare const SYNTAX_DARK: Readonly<Record<string, string>>;
|
|
43
|
+
/** The properties a palette sets: the panel's two, then one per token. */
|
|
44
|
+
export declare const SYNTAX_PROPERTIES: readonly string[];
|