@aaqu/fromcubes-react 0.2.1 → 0.2.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 +11 -1
- package/THIRD-PARTY-NOTICES.md +27 -0
- package/nodes/editor/class-completion.js +1116 -0
- package/nodes/lib/admin-api.js +31 -1
- package/nodes/lib/providers.js +272 -30
- package/nodes/portal-react.html +494 -254
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -172,7 +172,7 @@ function App() {
|
|
|
172
172
|
## Editor features
|
|
173
173
|
|
|
174
174
|
- **Monaco** with full JSX support and `useNodeRed()` type declarations
|
|
175
|
-
- **Tailwind CSS
|
|
175
|
+
- **Tailwind CSS IntelliSense** inside `className="..."`, as in VS Code (with `@aaqu/fromcubes-tailwind`): all ~23k Tailwind 4 classes and every variant, colour swatches, `/50` modifiers, the generated CSS beside each suggestion and on hover, colour squares in the code, and warnings with quick fixes for conflicting classes (`p-2 p-4`) and non-canonical ones (`w-[16px]` → `w-4`). Classes must be complete literals in a string — dynamic `bg-${tone}-500` generates no CSS (use a map of full classes). Arbitrary values incl. `w-[calc(100%-2rem)]`, `grid-cols-[repeat(2,1fr)]`, `mt-0!` and `@md:flex` are supported.
|
|
176
176
|
- **JSX tag completion** — type tag name, Tab to expand
|
|
177
177
|
- **Self-close collapse** — type `/` inside empty `<tag></tag>` to convert to `<tag />`
|
|
178
178
|
- **Ctrl+D / Cmd+D** — duplicate the current line or selection (in every Monaco editor of the package)
|
|
@@ -327,6 +327,16 @@ portalReact: {
|
|
|
327
327
|
every code editor; it is asked once per installed plugin. Without it the
|
|
328
328
|
engine just gets no completion. Strings only, no whitespace, ≤ 200 chars,
|
|
329
329
|
at most 50 000.
|
|
330
|
+
- For the rest of the IntelliSense experience an engine may add
|
|
331
|
+
`editor.completions()` → `{ classes: [{ name, modifiers, color }], variants }`
|
|
332
|
+
(variants: `{ name, values, hasDash, isArbitrary, detail, valueDetails }`)
|
|
333
|
+
`editor.describe(candidates)` → per class
|
|
334
|
+
`{ hover, documentation, detail, color, rules }` or `null` (CSS for the
|
|
335
|
+
detail pane and hover, colour as `#rrggbb` / `rgba(…)`, what the conflict
|
|
336
|
+
check compares) — keep it fast, hovers wait for it — and
|
|
337
|
+
`editor.canonical(candidates)` → per class a shorter spelling or `null`
|
|
338
|
+
(only the canonical-class warning waits for it). The Tailwind add-on is the
|
|
339
|
+
reference implementation.
|
|
330
340
|
- An unknown provider name is logged once; for identity every session is then
|
|
331
341
|
anonymous. The settings pane flags a selected provider whose package is gone.
|
|
332
342
|
- Optional `label: "…"` on the plugin is shown next to its id in the settings
|
package/THIRD-PARTY-NOTICES.md
CHANGED
|
@@ -55,6 +55,33 @@ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
|
|
55
55
|
THIS SOFTWARE.
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
## Tailwind CSS IntelliSense — `nodes/editor/class-completion.js`
|
|
59
|
+
|
|
60
|
+
The editor's `className` completion is ported from
|
|
61
|
+
[Tailwind CSS IntelliSense](https://github.com/tailwindlabs/tailwindcss-intellisense)
|
|
62
|
+
(`packages/tailwindcss-language-service`): the class attribute lexer
|
|
63
|
+
(`util/lexers.ts`, `util/find.ts`), comment stripping (`util/doc.ts`), variant
|
|
64
|
+
parsing (`util/getVariantsFromClassName.ts`, `util/segment.ts`), the
|
|
65
|
+
completion list itself (`completionProvider.ts`, `util/naturalExpand.ts`), the
|
|
66
|
+
CSS-conflict and canonical-class diagnostics with their quick fixes
|
|
67
|
+
(`diagnostics/`, `codeActions/`, `util/joinWithAnd.ts`,
|
|
68
|
+
`util/removeRangesFromString.ts`), the colour squares
|
|
69
|
+
(`documentColorProvider.ts`) and the colour picker's presentations (the
|
|
70
|
+
language server's `onColorPresentation`), translated to plain JavaScript;
|
|
71
|
+
departures from the original are marked in the code.
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
MIT License
|
|
75
|
+
|
|
76
|
+
Copyright (c) Tailwind Labs, Inc.
|
|
77
|
+
|
|
78
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
79
|
+
|
|
80
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
81
|
+
|
|
82
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
83
|
+
```
|
|
84
|
+
|
|
58
85
|
## Ark Pixel — `nodes/editor/ark-pixel.woff2`
|
|
59
86
|
|
|
60
87
|
The editor's brand lockup is set in **Ark Pixel 10px proportional** by TakWolf,
|