sculpted 0.0.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +105 -0
- package/README.md +233 -0
- package/dist/index.d.mts +129 -0
- package/dist/index.mjs +3 -0
- package/dist/patcher-BAw2kF1Q.mjs +2594 -0
- package/dist/protocol-BJm-xGHP.mjs +54 -0
- package/dist/runtime-DwE3PVhB.d.mts +64 -0
- package/dist/runtime.d.mts +2 -0
- package/dist/runtime.mjs +613 -0
- package/dist/sourceSyntax-DanNzS7Y.d.mts +103 -0
- package/dist/types-CdByW0ji.d.mts +381 -0
- package/dist/ui.d.mts +54 -0
- package/dist/ui.mjs +11125 -0
- package/dist/vite.d.mts +85 -0
- package/dist/vite.mjs +2325 -0
- package/examples/manual-vite-preact-pandacss/README.md +75 -0
- package/examples/manual-vite-preact-pandacss/index.html +12 -0
- package/examples/manual-vite-preact-pandacss/package.json +23 -0
- package/examples/manual-vite-preact-pandacss/panda.config.ts +43 -0
- package/examples/manual-vite-preact-pandacss/pnpm-lock.yaml +3359 -0
- package/examples/manual-vite-preact-pandacss/pnpm-workspace.yaml +2 -0
- package/examples/manual-vite-preact-pandacss/postcss.config.cjs +5 -0
- package/examples/manual-vite-preact-pandacss/src/TsrxManualPanel.tsrx +47 -0
- package/examples/manual-vite-preact-pandacss/src/index.css +8 -0
- package/examples/manual-vite-preact-pandacss/src/main.style.ts +33 -0
- package/examples/manual-vite-preact-pandacss/src/main.tsx +484 -0
- package/examples/manual-vite-preact-pandacss/src/tsrx.d.ts +5 -0
- package/examples/manual-vite-preact-pandacss/tsconfig.json +21 -0
- package/examples/manual-vite-preact-pandacss/vite.config.ts +20 -0
- package/package.json +66 -8
- package/readme.md +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-ALv2
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 Alec Larson
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# Sculpted
|
|
2
|
+
|
|
3
|
+
Sculpted is an experimental alpha, development-only inspector for editing a narrow lane of Panda
|
|
4
|
+
CSS styles in the browser and writing those edits back to source.
|
|
5
|
+
|
|
6
|
+
It is useful when you want to validate the inspect -> preview -> save loop in a Vite + Preact +
|
|
7
|
+
Panda CSS app. It is not a general CSS editor yet, and unsupported source shapes are intentionally
|
|
8
|
+
shown as read-only or rejected instead of guessed.
|
|
9
|
+
|
|
10
|
+
## Alpha Scope
|
|
11
|
+
|
|
12
|
+
Use Sculpted only in a project you have under version control. The dev server can write source
|
|
13
|
+
files when you click Save.
|
|
14
|
+
|
|
15
|
+
The supported alpha lane is:
|
|
16
|
+
|
|
17
|
+
- Vite development server only;
|
|
18
|
+
- Preact applications using Panda CSS;
|
|
19
|
+
- static local Panda `css({ ... })` object literals;
|
|
20
|
+
- existing literal primitive values such as strings, numbers, booleans, and `null`;
|
|
21
|
+
- nested literal paths when the source object remains directly patchable;
|
|
22
|
+
- `set` edits to existing source paths;
|
|
23
|
+
- opt-in TSRX support for the same existing-literal `css({ ... })` lane.
|
|
24
|
+
|
|
25
|
+
The alpha does not support:
|
|
26
|
+
|
|
27
|
+
- production inspection or writeback;
|
|
28
|
+
- recipes, patterns, JSX style props, or `cva()`;
|
|
29
|
+
- variable style object resolution;
|
|
30
|
+
- adding, deleting, or renaming style properties;
|
|
31
|
+
- converting computed CSS values back to design tokens;
|
|
32
|
+
- broad property-specific editors;
|
|
33
|
+
- inline source creation for TSRX;
|
|
34
|
+
- cross-file rollback if one file write succeeds and a later file write fails.
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
pnpm add -D sculpted
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Sculpted is intended as a dev dependency. It injects no inspector runtime during production builds.
|
|
43
|
+
|
|
44
|
+
## Vite Setup
|
|
45
|
+
|
|
46
|
+
Use the Vite plugin from the `sculpted/vite` subpath:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
// vite.config.ts
|
|
50
|
+
import { defineConfig } from 'vite'
|
|
51
|
+
import { preactPandaInspector } from 'sculpted/vite'
|
|
52
|
+
|
|
53
|
+
export default defineConfig({
|
|
54
|
+
plugins: [preactPandaInspector()],
|
|
55
|
+
})
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
In development, the plugin:
|
|
59
|
+
|
|
60
|
+
- instruments supported Panda `css({ ... })` calls with manifest metadata and marker classes;
|
|
61
|
+
- injects the browser runtime and inspector panel;
|
|
62
|
+
- serves a manifest at `/@panda-inspector/manifest`;
|
|
63
|
+
- serves source writeback endpoints for supported saves.
|
|
64
|
+
|
|
65
|
+
In production builds, the plugin is dark:
|
|
66
|
+
|
|
67
|
+
- no runtime script is injected;
|
|
68
|
+
- no inspector metadata is added;
|
|
69
|
+
- no manifest or writeback route is registered.
|
|
70
|
+
|
|
71
|
+
## Try A Supported Edit
|
|
72
|
+
|
|
73
|
+
Start your Vite dev server, open the app in a browser, and inspect an element whose class comes from
|
|
74
|
+
a static local Panda `css({ ... })` call:
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
import { css } from '../styled-system/css'
|
|
78
|
+
|
|
79
|
+
export function Card() {
|
|
80
|
+
return (
|
|
81
|
+
<section
|
|
82
|
+
class={css({
|
|
83
|
+
backgroundColor: 'white',
|
|
84
|
+
color: 'gray.900',
|
|
85
|
+
padding: '24px',
|
|
86
|
+
})}
|
|
87
|
+
>
|
|
88
|
+
Body
|
|
89
|
+
</section>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The inspector can preview and save changes to existing literal values such as `color: 'gray.900'`
|
|
95
|
+
or `padding: '24px'`. It will not add a new property, delete a property, or resolve styles hidden
|
|
96
|
+
behind variables or spreads.
|
|
97
|
+
|
|
98
|
+
If an element has supported and unsupported Panda contributors, Sculpted should surface that state
|
|
99
|
+
instead of pretending the full cascade can be edited safely.
|
|
100
|
+
|
|
101
|
+
## TSRX Support
|
|
102
|
+
|
|
103
|
+
TSRX support is part of the experimental alpha. It is opt-in because `.tsrx` files need the
|
|
104
|
+
ESTree-backed parser adapter from `@tsrx/core`.
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
// vite.config.ts
|
|
108
|
+
import { defineConfig } from 'vite'
|
|
109
|
+
import { tsrxSourceParserAdapter } from 'sculpted'
|
|
110
|
+
import { preactPandaInspector } from 'sculpted/vite'
|
|
111
|
+
|
|
112
|
+
export default defineConfig({
|
|
113
|
+
plugins: [
|
|
114
|
+
preactPandaInspector({
|
|
115
|
+
include: ['src/**/*.{ts,tsx,tsrx}'],
|
|
116
|
+
sourceSyntax: [tsrxSourceParserAdapter],
|
|
117
|
+
}),
|
|
118
|
+
],
|
|
119
|
+
})
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The supported TSRX authoring shape is a TSRX component with a static Panda `css({ ... })` object:
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
import { css } from '../styled-system/css'
|
|
126
|
+
|
|
127
|
+
export component Card() {
|
|
128
|
+
<section class={css({ color: 'brand.700', padding: '24px' })}>
|
|
129
|
+
"Body"
|
|
130
|
+
</section>
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
TSRX support currently covers:
|
|
135
|
+
|
|
136
|
+
- static `css({ ... })` object literal analysis;
|
|
137
|
+
- marker-class instrumentation for element selection;
|
|
138
|
+
- existing literal `set` writeback after re-parsing the original `.tsrx` source.
|
|
139
|
+
|
|
140
|
+
TSRX support intentionally does not cover:
|
|
141
|
+
|
|
142
|
+
- direct `data-panda-*` metadata insertion;
|
|
143
|
+
- inline source creation;
|
|
144
|
+
- add, delete, or rename operations;
|
|
145
|
+
- generated TSX or sourcemap-based writeback authority.
|
|
146
|
+
|
|
147
|
+
## Other Source Syntax Adapters
|
|
148
|
+
|
|
149
|
+
Languages that can expose original source ranges can opt into the same writeback lane with a
|
|
150
|
+
`sourceSyntax` parser adapter. The option accepts one adapter or an ordered adapter list.
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
preactPandaInspector({
|
|
154
|
+
include: ['src/**/*.view'],
|
|
155
|
+
sourceSyntax: {
|
|
156
|
+
languageId: 'my-tsx-superset',
|
|
157
|
+
kind: 'typescript',
|
|
158
|
+
isSupportedFile: (file) => file.endsWith('.view'),
|
|
159
|
+
parse({ filePath, sourceText }) {
|
|
160
|
+
return {
|
|
161
|
+
kind: 'typescript',
|
|
162
|
+
languageId: 'my-tsx-superset',
|
|
163
|
+
sourceFile: parseToTypeScriptCompatibleSourceFile(filePath, sourceText),
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
})
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Parser adapters must expose node ranges as offsets into the original authoring source text. The
|
|
171
|
+
patcher edits that file directly after revalidating hashes, source containment, and AST shape.
|
|
172
|
+
|
|
173
|
+
Sourcemaps are not the writeback authority. A future fallback may use sourcemaps to explain
|
|
174
|
+
generated-code provenance, but safe writes still require an original-source parser and patchable
|
|
175
|
+
target. If the adapter cannot provide stable original ranges for a source shape, Sculpted should
|
|
176
|
+
report that target as read-only.
|
|
177
|
+
|
|
178
|
+
## Source Writeback Safety
|
|
179
|
+
|
|
180
|
+
Source writes are revalidated on the dev server before writing:
|
|
181
|
+
|
|
182
|
+
- the browser sends manifest edit IDs, not trusted file paths;
|
|
183
|
+
- the server resolves edit IDs through the trusted manifest;
|
|
184
|
+
- the patcher re-reads source and validates project-root containment;
|
|
185
|
+
- stale source hashes, unsupported source shapes, duplicate keys, parse errors, and path escapes are
|
|
186
|
+
rejected;
|
|
187
|
+
- batched saves apply same-file edits against one source snapshot before writing.
|
|
188
|
+
|
|
189
|
+
The UI saves immediately after clicking Save. The writeback endpoint still supports dry-run patch
|
|
190
|
+
responses with focused diffs for tests and tooling.
|
|
191
|
+
|
|
192
|
+
## Troubleshooting
|
|
193
|
+
|
|
194
|
+
No editable entries appear:
|
|
195
|
+
|
|
196
|
+
- Confirm the app is running through the Vite dev server, not a production build.
|
|
197
|
+
- Confirm the file is included by the plugin `include` patterns.
|
|
198
|
+
- Confirm the element uses a local static `css({ ... })` object literal imported from your Panda
|
|
199
|
+
`styled-system/css` path.
|
|
200
|
+
- Open `/@panda-inspector/manifest` while the dev server is running and check whether entries exist.
|
|
201
|
+
|
|
202
|
+
The inspector shows a target as read-only:
|
|
203
|
+
|
|
204
|
+
- Check for variable style objects, object spreads, computed keys, dynamic values, recipes, patterns,
|
|
205
|
+
`cva()`, or JSX style props.
|
|
206
|
+
- For TSRX, check that the file uses supported TSRX component syntax and that
|
|
207
|
+
`tsrxSourceParserAdapter` is configured.
|
|
208
|
+
|
|
209
|
+
Save fails:
|
|
210
|
+
|
|
211
|
+
- Check whether the source changed after the manifest was generated. Restarting or waiting for Vite
|
|
212
|
+
to refresh the manifest may clear stale-source failures.
|
|
213
|
+
- Check for duplicate keys or unsupported parent object shapes around the edited path.
|
|
214
|
+
- For parser errors, fix the source syntax first; Sculpted will not write into a file it cannot
|
|
215
|
+
parse safely.
|
|
216
|
+
|
|
217
|
+
Production build has no inspector:
|
|
218
|
+
|
|
219
|
+
- This is expected. Sculpted is development-only and should be dark in production output.
|
|
220
|
+
|
|
221
|
+
## Manual Verification App
|
|
222
|
+
|
|
223
|
+
The manual Vite + Preact + Panda CSS app lives in
|
|
224
|
+
`examples/manual-vite-preact-pandacss`.
|
|
225
|
+
|
|
226
|
+
```sh
|
|
227
|
+
cd examples/manual-vite-preact-pandacss
|
|
228
|
+
pnpm install
|
|
229
|
+
pnpm dev
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Use it to verify supported edits, unsupported read-only cases, token creation checks, TSRX parsing,
|
|
233
|
+
and production-dark behavior while developing Sculpted.
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { $ as StyleModuleEditRequest, A as RuntimeAttribute, B as SourcePosition, C as OpenSourceLocationRequest, D as PreviewStyleCondition, E as PandaStyleObject, F as RuntimePropertyContext, G as StyleEdit, H as SourceTarget, I as RuntimeStyleEvidence, J as StyleEditError, K as StyleEditBatchRequest, L as SelectedElementInfo, M as RuntimeComponentLayerElement, N as RuntimeCssDeclaration, O as PreviewStyleRule, P as RuntimeElementBounds, Q as StyleEditResponse, R as SelectedElementState, S as OpenSourceLocationErrorCode, T as PandaCssSourceTarget, U as SourceTargetBase, V as SourceRange, W as SourceTargetKind, X as StyleEditOptions, Y as StyleEditErrorCode, Z as StyleEditRequest, _ as InspectorManifest, a as EditorColorTokenMetadata, at as TokenConfigEditResponse, b as JsonValue, c as EditorMetadataUnavailableReason, d as EditorPropertyMetadata, et as StyleModuleSourceAttachRequest, f as EditorTokenSourceSection, g as InspectorEditorMetadata, h as InlineCssSourceCreateRequest, i as DynamicSourceTarget, it as TokenConfigEditRequest, j as RuntimeComponentLayer, k as PreviewStyleSheet, l as EditorMetadataUpdateEvent, m as ExternalSourceTarget, n as ComponentStyleModuleSource, nt as StyleModuleSourceDetachRequest, o as EditorFontTokenMetadata, ot as UnsupportedReason, p as EditorTokenSourceTarget, q as StyleEditBatchResponse, r as Confidence, rt as StyleValueSource, s as EditorMetadataSection, st as UnsupportedSourceTarget, t as ComponentStyleModuleResponse, tt as StyleModuleSourceCreateRequest, u as EditorPropertyCategory, v as InspectorManifestEntry, w as OpenSourceLocationResponse, x as ManifestUpdateEvent, y as JsonPrimitive, z as SourceLocation } from "./types-CdByW0ji.mjs";
|
|
2
|
+
import { _ as typescriptPandaAstAdapter, a as SourceAstKind, c as SourceSyntaxAdapter, d as parsePandaSource, f as parseWithSourceParserAdapter, g as tsxSourceSyntaxAdapter, h as tsxSourceParserAdapter, i as ParsedPandaSource, l as SourceSyntaxOption, m as tsrxSourceParserAdapter, n as PandaSourceAstAdapter, o as SourceParseResult, p as resolveSourceParserAdapter, r as ParseSourceSyntaxOptions, s as SourceParserAdapter, t as EstreeNode, u as createEstreePandaAstAdapter } from "./sourceSyntax-DanNzS7Y.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/analyzer/pandaCssAnalyzer.d.ts
|
|
5
|
+
type AnalyzePandaCssSourceOptions = {
|
|
6
|
+
readonly filePath: string;
|
|
7
|
+
readonly projectRoot?: string;
|
|
8
|
+
readonly cssImportSources?: readonly string[];
|
|
9
|
+
readonly sourceText: string;
|
|
10
|
+
readonly sourceSyntax?: SourceSyntaxOption;
|
|
11
|
+
};
|
|
12
|
+
type AnalyzePandaCssSourceResult = {
|
|
13
|
+
readonly entries: readonly InspectorManifestEntry[];
|
|
14
|
+
};
|
|
15
|
+
declare function analyzePandaCssSource(options: AnalyzePandaCssSourceOptions): AnalyzePandaCssSourceResult;
|
|
16
|
+
declare function hashSource(source: string): string;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/patcher/inlineCssSourcePatcher.d.ts
|
|
19
|
+
type CreateInlineCssSourcePatchOptions = {
|
|
20
|
+
readonly projectRoot: string;
|
|
21
|
+
readonly request: InlineCssSourceCreateRequest;
|
|
22
|
+
readonly sourceText: string;
|
|
23
|
+
readonly filePath: string;
|
|
24
|
+
readonly cssImportSources?: readonly string[];
|
|
25
|
+
readonly sourceSyntax?: SourceSyntaxOption;
|
|
26
|
+
};
|
|
27
|
+
declare function createInlineCssSourcePatch(options: CreateInlineCssSourcePatchOptions): StyleEditResponse;
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/patcher/staticCssPatcher.d.ts
|
|
30
|
+
type CreateStaticCssPatchOptions = {
|
|
31
|
+
readonly manifest: InspectorManifest;
|
|
32
|
+
readonly request: StyleEditRequest;
|
|
33
|
+
readonly sourceText: string;
|
|
34
|
+
readonly filePath?: string;
|
|
35
|
+
readonly styledSystemPackageName?: string;
|
|
36
|
+
readonly sourceSyntax?: SourceSyntaxOption;
|
|
37
|
+
};
|
|
38
|
+
declare function createStaticCssPatch(options: CreateStaticCssPatchOptions): StyleEditResponse;
|
|
39
|
+
declare function createStaticCssBatchPatch(options: {
|
|
40
|
+
readonly manifest: InspectorManifest;
|
|
41
|
+
readonly requests: readonly StyleEditRequest[];
|
|
42
|
+
readonly sourceText: string;
|
|
43
|
+
readonly filePath?: string;
|
|
44
|
+
readonly styledSystemPackageName?: string;
|
|
45
|
+
readonly sourceSyntax?: SourceSyntaxOption;
|
|
46
|
+
}): StyleEditResponse;
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/patcher/styleModulePatcher.d.ts
|
|
49
|
+
type ComponentStyleModulePaths = {
|
|
50
|
+
readonly componentFile: string;
|
|
51
|
+
readonly styleFile: string;
|
|
52
|
+
readonly styleFileRelative: string;
|
|
53
|
+
readonly importPath: string;
|
|
54
|
+
};
|
|
55
|
+
declare function componentStyleModulePaths(options: {
|
|
56
|
+
readonly projectRoot: string;
|
|
57
|
+
readonly componentSource: string;
|
|
58
|
+
}): {
|
|
59
|
+
readonly ok: true;
|
|
60
|
+
readonly paths: ComponentStyleModulePaths;
|
|
61
|
+
} | {
|
|
62
|
+
readonly ok: false;
|
|
63
|
+
readonly code: StyleEditErrorCode;
|
|
64
|
+
readonly message: string;
|
|
65
|
+
readonly details?: Record<string, JsonValue>;
|
|
66
|
+
};
|
|
67
|
+
declare function readComponentStyleModule(options: {
|
|
68
|
+
readonly projectRoot: string;
|
|
69
|
+
readonly componentSource: string;
|
|
70
|
+
readonly sourceText?: string;
|
|
71
|
+
readonly cssImportSources?: readonly string[];
|
|
72
|
+
}): ComponentStyleModuleResponse;
|
|
73
|
+
declare function createStyleModuleSourcePatch(options: {
|
|
74
|
+
readonly projectRoot: string;
|
|
75
|
+
readonly request: StyleModuleSourceCreateRequest;
|
|
76
|
+
readonly sourceText?: string;
|
|
77
|
+
readonly filePath: string;
|
|
78
|
+
readonly cssImportSources?: readonly string[];
|
|
79
|
+
}): StyleEditResponse;
|
|
80
|
+
declare function createStyleModuleAttachPatch(options: {
|
|
81
|
+
readonly projectRoot: string;
|
|
82
|
+
readonly request: StyleModuleSourceAttachRequest;
|
|
83
|
+
readonly sourceText: string;
|
|
84
|
+
readonly filePath: string;
|
|
85
|
+
readonly styledSystemPackageName?: string;
|
|
86
|
+
}): StyleEditResponse;
|
|
87
|
+
declare function createStyleModuleDetachPatch(options: {
|
|
88
|
+
readonly projectRoot: string;
|
|
89
|
+
readonly request: StyleModuleSourceDetachRequest;
|
|
90
|
+
readonly sourceText: string;
|
|
91
|
+
readonly filePath: string;
|
|
92
|
+
}): StyleEditResponse;
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/patcher/tokenConfigPatcher.d.ts
|
|
95
|
+
type CreateTokenConfigPatchOptions = {
|
|
96
|
+
readonly projectRoot: string;
|
|
97
|
+
readonly tokenSource: EditorTokenSourceTarget;
|
|
98
|
+
readonly request: TokenConfigEditRequest;
|
|
99
|
+
readonly sourceText: string;
|
|
100
|
+
readonly filePath?: string;
|
|
101
|
+
};
|
|
102
|
+
declare function createTokenConfigPatch(options: CreateTokenConfigPatchOptions): TokenConfigEditResponse;
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/shared/protocol.d.ts
|
|
105
|
+
declare const PANDA_INSPECTOR_PROTOCOL_VERSION = 1;
|
|
106
|
+
declare const DEFAULT_MANIFEST_ENDPOINT = "/@panda-inspector/manifest";
|
|
107
|
+
declare const DEFAULT_EDITOR_METADATA_ENDPOINT = "/@panda-inspector/editor-metadata";
|
|
108
|
+
declare const DEFAULT_STYLE_MODULE_ENDPOINT = "/@panda-inspector/style-module";
|
|
109
|
+
declare const DEFAULT_WRITEBACK_ENDPOINT = "/@panda-inspector/writeback";
|
|
110
|
+
declare const DEFAULT_TOKEN_WRITEBACK_ENDPOINT = "/@panda-inspector/token-writeback";
|
|
111
|
+
declare const DEFAULT_OPEN_SOURCE_ENDPOINT = "/@panda-inspector/open-source";
|
|
112
|
+
declare const DEFAULT_EDIT_ID_ATTRIBUTE = "data-panda-edit-id";
|
|
113
|
+
declare const DEFAULT_SOURCE_ATTRIBUTE = "data-panda-source";
|
|
114
|
+
declare const DEFAULT_JSX_SOURCE_ATTRIBUTE = "data-panda-jsx-source";
|
|
115
|
+
declare const DEFAULT_COMPONENT_ATTRIBUTE = "data-preact-component";
|
|
116
|
+
declare const DEFAULT_FORCED_STATE_ATTRIBUTE = "data-panda-forced-state";
|
|
117
|
+
declare const DEFAULT_MARKER_CLASS_PREFIX = "__panda_i_";
|
|
118
|
+
declare function markerClassForEditId(editId: string): string;
|
|
119
|
+
declare function editIdFromMarkerClass(className: string): string | undefined;
|
|
120
|
+
declare function editIdsFromMarkerClassList(className: string): readonly string[];
|
|
121
|
+
declare const PANDA_INSPECTOR_EVENTS: {
|
|
122
|
+
readonly manifestUpdate: "panda-inspector:manifest-update";
|
|
123
|
+
readonly metadataUpdate: "panda-inspector:metadata-update";
|
|
124
|
+
readonly previewCleared: "panda-inspector:preview-cleared";
|
|
125
|
+
readonly writebackResult: "panda-inspector:writeback-result";
|
|
126
|
+
};
|
|
127
|
+
type PandaInspectorEventName = (typeof PANDA_INSPECTOR_EVENTS)[keyof typeof PANDA_INSPECTOR_EVENTS];
|
|
128
|
+
//#endregion
|
|
129
|
+
export { AnalyzePandaCssSourceOptions, AnalyzePandaCssSourceResult, ComponentStyleModulePaths, ComponentStyleModuleResponse, ComponentStyleModuleSource, Confidence, CreateInlineCssSourcePatchOptions, CreateStaticCssPatchOptions, CreateTokenConfigPatchOptions, DEFAULT_COMPONENT_ATTRIBUTE, DEFAULT_EDITOR_METADATA_ENDPOINT, DEFAULT_EDIT_ID_ATTRIBUTE, DEFAULT_FORCED_STATE_ATTRIBUTE, DEFAULT_JSX_SOURCE_ATTRIBUTE, DEFAULT_MANIFEST_ENDPOINT, DEFAULT_MARKER_CLASS_PREFIX, DEFAULT_OPEN_SOURCE_ENDPOINT, DEFAULT_SOURCE_ATTRIBUTE, DEFAULT_STYLE_MODULE_ENDPOINT, DEFAULT_TOKEN_WRITEBACK_ENDPOINT, DEFAULT_WRITEBACK_ENDPOINT, DynamicSourceTarget, EditorColorTokenMetadata, EditorFontTokenMetadata, EditorMetadataSection, EditorMetadataUnavailableReason, EditorMetadataUpdateEvent, EditorPropertyCategory, EditorPropertyMetadata, EditorTokenSourceSection, EditorTokenSourceTarget, EstreeNode, ExternalSourceTarget, InlineCssSourceCreateRequest, InspectorEditorMetadata, InspectorManifest, InspectorManifestEntry, JsonPrimitive, JsonValue, ManifestUpdateEvent, OpenSourceLocationErrorCode, OpenSourceLocationRequest, OpenSourceLocationResponse, PANDA_INSPECTOR_EVENTS, PANDA_INSPECTOR_PROTOCOL_VERSION, PandaCssSourceTarget, PandaInspectorEventName, PandaSourceAstAdapter, PandaStyleObject, ParseSourceSyntaxOptions, ParsedPandaSource, PreviewStyleCondition, PreviewStyleRule, PreviewStyleSheet, RuntimeAttribute, RuntimeComponentLayer, RuntimeComponentLayerElement, RuntimeCssDeclaration, RuntimeElementBounds, RuntimePropertyContext, RuntimeStyleEvidence, SelectedElementInfo, SelectedElementState, SourceAstKind, SourceLocation, SourceParseResult, SourceParserAdapter, SourcePosition, SourceRange, SourceSyntaxAdapter, SourceSyntaxOption, SourceTarget, SourceTargetBase, SourceTargetKind, StyleEdit, StyleEditBatchRequest, StyleEditBatchResponse, StyleEditError, StyleEditErrorCode, StyleEditOptions, StyleEditRequest, StyleEditResponse, StyleModuleEditRequest, StyleModuleSourceAttachRequest, StyleModuleSourceCreateRequest, StyleModuleSourceDetachRequest, StyleValueSource, TokenConfigEditRequest, TokenConfigEditResponse, UnsupportedReason, UnsupportedSourceTarget, analyzePandaCssSource, componentStyleModulePaths, createEstreePandaAstAdapter, createInlineCssSourcePatch, createStaticCssBatchPatch, createStaticCssPatch, createStyleModuleAttachPatch, createStyleModuleDetachPatch, createStyleModuleSourcePatch, createTokenConfigPatch, editIdFromMarkerClass, editIdsFromMarkerClassList, hashSource, markerClassForEditId, parsePandaSource, parseWithSourceParserAdapter, readComponentStyleModule, resolveSourceParserAdapter, tsrxSourceParserAdapter, tsxSourceParserAdapter, tsxSourceSyntaxAdapter, typescriptPandaAstAdapter };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { _ as markerClassForEditId, a as DEFAULT_JSX_SOURCE_ATTRIBUTE, c as DEFAULT_OPEN_SOURCE_ENDPOINT, d as DEFAULT_TOKEN_WRITEBACK_ENDPOINT, f as DEFAULT_WRITEBACK_ENDPOINT, g as editIdsFromMarkerClassList, h as editIdFromMarkerClass, i as DEFAULT_FORCED_STATE_ATTRIBUTE, l as DEFAULT_SOURCE_ATTRIBUTE, m as PANDA_INSPECTOR_PROTOCOL_VERSION, n as DEFAULT_EDITOR_METADATA_ENDPOINT, o as DEFAULT_MANIFEST_ENDPOINT, p as PANDA_INSPECTOR_EVENTS, r as DEFAULT_EDIT_ID_ATTRIBUTE, s as DEFAULT_MARKER_CLASS_PREFIX, t as DEFAULT_COMPONENT_ATTRIBUTE, u as DEFAULT_STYLE_MODULE_ENDPOINT } from "./protocol-BJm-xGHP.mjs";
|
|
2
|
+
import { C as tsxSourceParserAdapter, S as tsrxSourceParserAdapter, T as typescriptPandaAstAdapter, _ as hashSource, a as createStyleModuleSourcePatch, b as parseWithSourceParserAdapter, g as analyzePandaCssSource, h as createInlineCssSourcePatch, i as createStyleModuleDetachPatch, m as createStaticCssPatch, n as componentStyleModulePaths, o as readComponentStyleModule, p as createStaticCssBatchPatch, r as createStyleModuleAttachPatch, t as createTokenConfigPatch, v as createEstreePandaAstAdapter, w as tsxSourceSyntaxAdapter, x as resolveSourceParserAdapter, y as parsePandaSource } from "./patcher-BAw2kF1Q.mjs";
|
|
3
|
+
export { DEFAULT_COMPONENT_ATTRIBUTE, DEFAULT_EDITOR_METADATA_ENDPOINT, DEFAULT_EDIT_ID_ATTRIBUTE, DEFAULT_FORCED_STATE_ATTRIBUTE, DEFAULT_JSX_SOURCE_ATTRIBUTE, DEFAULT_MANIFEST_ENDPOINT, DEFAULT_MARKER_CLASS_PREFIX, DEFAULT_OPEN_SOURCE_ENDPOINT, DEFAULT_SOURCE_ATTRIBUTE, DEFAULT_STYLE_MODULE_ENDPOINT, DEFAULT_TOKEN_WRITEBACK_ENDPOINT, DEFAULT_WRITEBACK_ENDPOINT, PANDA_INSPECTOR_EVENTS, PANDA_INSPECTOR_PROTOCOL_VERSION, analyzePandaCssSource, componentStyleModulePaths, createEstreePandaAstAdapter, createInlineCssSourcePatch, createStaticCssBatchPatch, createStaticCssPatch, createStyleModuleAttachPatch, createStyleModuleDetachPatch, createStyleModuleSourcePatch, createTokenConfigPatch, editIdFromMarkerClass, editIdsFromMarkerClassList, hashSource, markerClassForEditId, parsePandaSource, parseWithSourceParserAdapter, readComponentStyleModule, resolveSourceParserAdapter, tsrxSourceParserAdapter, tsxSourceParserAdapter, tsxSourceSyntaxAdapter, typescriptPandaAstAdapter };
|