@pixerate/editor-react 0.177.0 → 0.179.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.
@@ -2,6 +2,7 @@
2
2
  import { useEffect, useMemo, useState } from "react";
3
3
  import { StickerBrowser } from "@pixerate/editor/stickers";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
+ var tooltip = (it) => `${it.name} (${it.ref}) \xB7 ${it.licence.name}${it.licence.attribution ? ` \xB7 ${it.licence.attribution}` : ""}${it.aiGenerated ? " \xB7 AI-generated" : ""}${it.variants?.includes("dark") ? " \xB7 light and dark" : ""}`;
5
6
  var StickerLibraryPicker = ({ provider, selected = [], onPick, label = "Stickers", footer, className }) => {
6
7
  const browser = useMemo(() => new StickerBrowser(() => provider), [provider]);
7
8
  const [, setTick] = useState(0);
@@ -17,6 +18,15 @@ var StickerLibraryPicker = ({ provider, selected = [], onPick, label = "Stickers
17
18
  s.categories.length > 1 && /* @__PURE__ */ jsxs("select", { "aria-label": "Sticker category", value: s.category, onChange: (e) => void browser.setCategory(e.target.value), className: "rounded bg-slate-800 px-1 py-0.5", children: [
18
19
  /* @__PURE__ */ jsx("option", { value: "", children: "All" }),
19
20
  s.categories.map((c) => /* @__PURE__ */ jsx("option", { value: c.id, children: c.name }, c.id))
21
+ ] }),
22
+ s.collections.length > 0 && /* @__PURE__ */ jsxs("select", { "aria-label": "Sticker collection", value: s.collection, onChange: (e) => void browser.setCollection(e.target.value), className: "rounded bg-slate-800 px-1 py-0.5", children: [
23
+ /* @__PURE__ */ jsx("option", { value: "", children: "All collections" }),
24
+ s.collections.map((c) => /* @__PURE__ */ jsxs("option", { value: c.id, title: c.description, children: [
25
+ c.name,
26
+ " (",
27
+ c.count,
28
+ ")"
29
+ ] }, c.id))
20
30
  ] })
21
31
  ] }),
22
32
  /* @__PURE__ */ jsx("div", { className: "flex max-h-32 flex-wrap gap-1 overflow-y-auto", role: "group", "aria-label": label, children: s.items.map((it) => {
@@ -26,12 +36,13 @@ var StickerLibraryPicker = ({ provider, selected = [], onPick, label = "Stickers
26
36
  {
27
37
  type: "button",
28
38
  "aria-pressed": on,
29
- title: `${it.name} (${it.ref}) \xB7 ${it.licence.name}${it.licence.attribution ? ` \xB7 ${it.licence.attribution}` : ""}`,
39
+ title: tooltip(it),
30
40
  className: `flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] ${on ? "bg-indigo-600 text-white" : "bg-slate-800 text-slate-300"}`,
31
41
  onClick: () => onPick(it),
32
42
  children: [
33
43
  it.thumbnail && /* @__PURE__ */ jsx("img", { src: it.thumbnail, alt: "", className: "h-4 w-4" }),
34
- it.name
44
+ it.name,
45
+ it.aiGenerated && /* @__PURE__ */ jsx("span", { className: "rounded bg-slate-700 px-0.5 text-[8px] text-slate-200", "aria-label": "AI-generated", children: "AI" })
35
46
  ]
36
47
  },
37
48
  it.ref
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { type PaintEditorController } from '@pixerate/editor/paint-editor';
3
+ export interface PathStrokePanelProps {
4
+ controller: PaintEditorController;
5
+ className?: string;
6
+ }
7
+ /**
8
+ * Brush a path: paste SVG path data (document pixels, e.g. from a vector tool) and brush it on
9
+ * the active layer with the active brush and colour, as if drawn by hand along it, with an even
10
+ * pressure or a taper. One undo step, as the `stroke_path` agent tool.
11
+ */
12
+ export declare const PathStrokePanel: React.FC<PathStrokePanelProps>;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { type PaintEditorController } from '@pixerate/editor/paint-editor';
3
+ export interface PathStrokePanelProps {
4
+ controller: PaintEditorController;
5
+ className?: string;
6
+ }
7
+ /**
8
+ * Brush a path: paste SVG path data (document pixels, e.g. from a vector tool) and brush it on
9
+ * the active layer with the active brush and colour, as if drawn by hand along it, with an even
10
+ * pressure or a taper. One undo step, as the `stroke_path` agent tool.
11
+ */
12
+ export declare const PathStrokePanel: React.FC<PathStrokePanelProps>;