@comty.io/core 0.1.0 → 0.1.2
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/README.md +6 -29
- package/comty-sdk.js +1046 -210
- package/package.json +2 -2
- package/src/browser.js +531 -99
- package/src/capture.js +104 -1
- package/src/dev.mjs +3 -2
- package/src/measurements.js +209 -0
- package/src/style.js +203 -111
- package/src/vite.mjs +3 -2
package/README.md
CHANGED
|
@@ -21,21 +21,17 @@ await initComty({
|
|
|
21
21
|
|
|
22
22
|
Call once from your application entry. Server rendering is safe: it does nothing until called in a browser. Repeated calls with the same options reuse the document's instance. Reload the page to change its project or API URL. Register the site's domain in Comty to use shared comments.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
## Color tokens
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
<script src="https://YOUR_COMTY_CDN/v1/comty-sdk.js"
|
|
28
|
-
data-project-key="YOUR_PROJECT_KEY"
|
|
29
|
-
data-api-url="https://YOUR_COMTY_API"></script>
|
|
30
|
-
```
|
|
26
|
+
Element inspection shows a copyable CSS custom-property name above foreground/background colors when the winning declaration can be identified. It handles ordinary selectors, `:where()`, inline styles, inheritance, `!important`, active media/supports rules and named top-level cascade layers. Semantic aliases retain their declared name. No extra line is rendered for literal colors or uncertain provenance (including inaccessible stylesheets, shadow/scoped or nested cascades, and unsupported functional selectors).
|
|
31
27
|
|
|
32
|
-
|
|
28
|
+
The toolbar pipette shows a circular nine-pixel magnifier from a local DOM snapshot, keeping the toolbar interactive with normal UI cursors. Its light/dark ring follows the sampled colour. Scrolling or resizing refreshes the snapshot. Inaccessible images, canvas/video, external fonts and live animations may differ from screen pixels; use native screen sampling for those. If a readable snapshot cannot be created, selection falls back to the element’s CSS colour. Shift-click the pipette in Chrome or Edge to sample screen pixels instead (including images). The screen pipette receives a pixel color and copies its HEX value. When an inspected element has an identifiable background token whose rendered color matches the sample, the toast shows that token as **Element token · --name**. The native pipette does not report which element produced the pixel, so the label describes the inspected element rather than attributing the sampled pixel. Matching variable values alone do not produce a label. No additional dependency is required.
|
|
33
29
|
|
|
34
|
-
##
|
|
30
|
+
## Border measurements
|
|
35
31
|
|
|
36
|
-
|
|
32
|
+
Open inspection with **Shift I**, then choose the ruler tool or press **R**. Move close to an element or page border: a red point marks the snapped start and the cursor shows the measurement axis. Drag to another border to measure its distance. Horizontal borders produce vertical measurements; side borders produce horizontal measurements. Releasing away from a border keeps the endpoint at that page position.
|
|
37
33
|
|
|
38
|
-
|
|
34
|
+
You can place several measurements. Their arrows and pixel labels remain visible, and element anchors follow scrolling, resizing and transforms. **Escape** cancels an unfinished drag; pressing it again exits measurement. Turning off the ruler tool or changing modes clears the measurements. They stay local to the current page and are never saved or uploaded. Pixel rulers and draggable guides remain available.
|
|
39
35
|
|
|
40
36
|
## Live motion
|
|
41
37
|
|
|
@@ -90,22 +86,3 @@ Comty starts a separate agent session. It does not send instructions into an alr
|
|
|
90
86
|
Technical requests are never sent to the Comty API or its database. Their prompt and page context are sent to the selected AI provider by its coding agent. Standard shared comments retain their existing Comty authentication and storage.
|
|
91
87
|
|
|
92
88
|
Add `.comty/` to your application's `.gitignore`. Keep the companion on loopback; LAN binding, tunnels and production hosting are unsupported. Requests require the random token of the running development session and its exact origin.
|
|
93
|
-
|
|
94
|
-
## Development
|
|
95
|
-
|
|
96
|
-
```sh
|
|
97
|
-
cd sdk
|
|
98
|
-
npm ci
|
|
99
|
-
npm run build
|
|
100
|
-
npm test
|
|
101
|
-
npm run check:build
|
|
102
|
-
npm run test:vite
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Vite is a development dependency used by the integration test; it is not included in the published package.
|
|
106
|
-
|
|
107
|
-
For browser checks, run `bun sdk/tests/serve.mjs` from the repository root. Open `http://127.0.0.1:4178/` for the comment/inspector regression suite, or `http://127.0.0.1:4178/motion` for the interactive live-motion lab and slowdown checks. The test bridge is injected by that local server only and is not included in the published SDK.
|
|
108
|
-
|
|
109
|
-
From the repository root, run `bun sdk/tests/serve.mjs`, open the printed URL and select **Run regression checks**. Edit `src/browser.js`, never the generated `comty-sdk.js`.
|
|
110
|
-
|
|
111
|
-
See the repository's `doc.md` for publication, CDN deployment, verification and rollback steps.
|