quoin-editor 0.3.0 → 0.4.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/README.md +12 -1
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -311,7 +311,7 @@ Each core block keeps its content under its own keys. A host that persists block
|
|
|
311
311
|
|
|
312
312
|
Two of these are worth saying out loud, because both have been guessed wrong:
|
|
313
313
|
|
|
314
|
-
- **The callout's prose is `body`, not `text`.** The label over the field reads "Callout text", which is what the author sees; `body` is what the block stores.
|
|
314
|
+
- **The callout's prose is `body`, not `text`.** The label over the field reads "Callout text", which is what the author sees; `body` is what the block stores. `tone` is one of `info`, `tip`, `warning`, `success` or `danger`, each drawn in its own colour; anything else falls back to the neutral border and fill.
|
|
315
315
|
- **Markdown blocks store markdown source, not rendered HTML.** Quoin edits and stores the source and renders it as plain text; supply a `preview` if you want it rendered.
|
|
316
316
|
|
|
317
317
|
The optional fields are written after a block's first save: an image's `caption` when the author types one, its `width` and `height` once the uploaded bytes have been measured, a file's `size` when the upload reports it. `src/blocks/data.test.ts` reads the keys back out of each editor's source and fails if one drifts from the table above.
|
|
@@ -490,6 +490,9 @@ Because it draws previews and never editors, a block type registered without a `
|
|
|
490
490
|
--quoin-accent: oklch(0.97 0 0);
|
|
491
491
|
--quoin-accent-foreground: oklch(0.205 0 0);
|
|
492
492
|
--quoin-destructive: oklch(0.577 0.245 27.325);
|
|
493
|
+
--quoin-info: oklch(0.55 0.17 250);
|
|
494
|
+
--quoin-success: oklch(0.55 0.14 155);
|
|
495
|
+
--quoin-warning: oklch(0.65 0.16 65);
|
|
493
496
|
--quoin-radius: 0.625rem;
|
|
494
497
|
}
|
|
495
498
|
|
|
@@ -510,6 +513,9 @@ Because it draws previews and never editors, a block type registered without a `
|
|
|
510
513
|
--quoin-accent: oklch(0.269 0 0);
|
|
511
514
|
--quoin-accent-foreground: oklch(0.985 0 0);
|
|
512
515
|
--quoin-destructive: oklch(0.704 0.191 22.216);
|
|
516
|
+
--quoin-info: oklch(0.72 0.14 250);
|
|
517
|
+
--quoin-success: oklch(0.74 0.15 155);
|
|
518
|
+
--quoin-warning: oklch(0.79 0.15 65);
|
|
513
519
|
--quoin-radius: 0.625rem;
|
|
514
520
|
}
|
|
515
521
|
```
|
|
@@ -548,10 +554,15 @@ Point the prefixed names at your own in one block on `.quoin`. The canvas root c
|
|
|
548
554
|
--quoin-accent: var(--accent);
|
|
549
555
|
--quoin-accent-foreground: var(--accent-foreground);
|
|
550
556
|
--quoin-destructive: var(--destructive);
|
|
557
|
+
--quoin-info: var(--info);
|
|
558
|
+
--quoin-success: var(--success);
|
|
559
|
+
--quoin-warning: var(--warning);
|
|
551
560
|
--quoin-radius: var(--radius);
|
|
552
561
|
}
|
|
553
562
|
```
|
|
554
563
|
|
|
564
|
+
`--quoin-info`, `--quoin-success` and `--quoin-warning` arrived in 0.4.0 and are read only by the callout block, for its rule and the wash behind it, never for type. If your own theme has no equivalent, leave those three out of the block and the defaults above stand; the rest of the editor does not touch them.
|
|
565
|
+
|
|
555
566
|
That one block covers both modes: the tokens on the right already flip with your own dark class, and each mapping beats Quoin's `:root` and `.dark` defaults alike. Write it unlayered, or in a layer that sorts after `quoin`, so it outranks those defaults.
|
|
556
567
|
|
|
557
568
|
To change one token rather than adopt a whole theme, declare it on `:root`, and pair it with a `.dark` rule if you theme dark at all. Pinning a token on `:root` alone also beats Quoin's `.dark` value for it, which would freeze that one token in its light form.
|
package/dist/index.cjs
CHANGED
|
@@ -1519,12 +1519,12 @@ function FileBlockEditor({ data, onChange }) {
|
|
|
1519
1519
|
// src/blocks/previews.tsx
|
|
1520
1520
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1521
1521
|
var HINT = "text-sm text-muted-foreground";
|
|
1522
|
-
var
|
|
1523
|
-
info: "border-
|
|
1524
|
-
tip: "border-
|
|
1525
|
-
warning: "border-
|
|
1526
|
-
success: "border-
|
|
1527
|
-
danger: "border-destructive"
|
|
1522
|
+
var TONE = {
|
|
1523
|
+
info: "border-info bg-info/15",
|
|
1524
|
+
tip: "border-primary bg-primary/15",
|
|
1525
|
+
warning: "border-warning bg-warning/15",
|
|
1526
|
+
success: "border-success bg-success/15",
|
|
1527
|
+
danger: "border-destructive bg-destructive/15"
|
|
1528
1528
|
};
|
|
1529
1529
|
function MarkdownPreview({ data }) {
|
|
1530
1530
|
const markdown = str(data.markdown);
|
|
@@ -1551,8 +1551,8 @@ function CalloutPreview({ data }) {
|
|
|
1551
1551
|
const body = str(data.body);
|
|
1552
1552
|
if (body.trim() === "") return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: HINT, children: "Empty callout" });
|
|
1553
1553
|
const tone = str(data.tone) || "info";
|
|
1554
|
-
const
|
|
1555
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { "data-tone": tone, className: `rounded-md border-l-4 ${
|
|
1554
|
+
const paint = TONE[tone] ?? "border-border bg-muted/50";
|
|
1555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { "data-tone": tone, className: `rounded-md border-l-4 ${paint} p-3 text-sm`, children: body });
|
|
1556
1556
|
}
|
|
1557
1557
|
|
|
1558
1558
|
// src/blocks/core.ts
|