@pixerate/editor-react 0.127.0 → 0.128.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/dist/{chunk-KNLBDEW6.js → chunk-EEF44DJ6.js} +38 -2
- package/dist/image-editor/TypeOptionsBar.d.cts +2 -2
- package/dist/image-editor/TypeOptionsBar.d.ts +2 -2
- package/dist/image-editor/index.cjs +37 -1
- package/dist/image-editor/index.js +1 -1
- package/dist/index.cjs +37 -1
- package/dist/index.js +1 -1
- package/dist/vector/VectorTextPanel.d.cts +2 -1
- package/dist/vector/VectorTextPanel.d.ts +2 -1
- package/dist/vector/index.cjs +36 -0
- package/dist/vector/index.js +37 -0
- package/package.json +3 -3
|
@@ -3558,9 +3558,10 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
|
|
|
3558
3558
|
|
|
3559
3559
|
// src/image-editor/TypeOptionsBar.tsx
|
|
3560
3560
|
import { useEffect as useEffect13, useState as useState16 } from "react";
|
|
3561
|
-
import { TEXT_ALIGNS } from "@pixerate/editor/image-editor";
|
|
3561
|
+
import { TEXT_ALIGNS, TEXT_ORIENTATIONS } from "@pixerate/editor/image-editor";
|
|
3562
3562
|
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3563
3563
|
var ALIGN_LABELS = { left: "Left", center: "Centre", right: "Right", justify: "Justify" };
|
|
3564
|
+
var ORIENTATION_LABELS = { horizontal: "Horizontal", vertical: "Vertical" };
|
|
3564
3565
|
var TypeOptionsBar = ({ controller, options, onChange, session, className }) => {
|
|
3565
3566
|
const [, setTick] = useState16(0);
|
|
3566
3567
|
useEffect13(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
@@ -3578,6 +3579,27 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
|
|
|
3578
3579
|
};
|
|
3579
3580
|
const fonts = controller.listFonts();
|
|
3580
3581
|
const missing = active?.type === "type" ? active.missingFonts ?? [] : [];
|
|
3582
|
+
const editedId = session?.alive ? session.layerId : typeId;
|
|
3583
|
+
const edited = editedId ? controller.getLayer(editedId) : null;
|
|
3584
|
+
const orientation = edited?.type === "type" ? edited.orientation ?? "horizontal" : options.orientation ?? "horizontal";
|
|
3585
|
+
const orient = (next) => {
|
|
3586
|
+
onChange({ ...options, orientation: next });
|
|
3587
|
+
try {
|
|
3588
|
+
setError(null);
|
|
3589
|
+
if (editedId) controller.setTextOrientation(editedId, next);
|
|
3590
|
+
} catch (e) {
|
|
3591
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
3592
|
+
}
|
|
3593
|
+
};
|
|
3594
|
+
const upright = () => {
|
|
3595
|
+
try {
|
|
3596
|
+
setError(null);
|
|
3597
|
+
if (session?.alive) session.setStyle({ upright: !here.upright });
|
|
3598
|
+
else if (typeId) controller.setTextStyle(typeId, { upright: !(edited?.type === "type" && edited.runs[0]?.style.upright) });
|
|
3599
|
+
} catch (e) {
|
|
3600
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
3601
|
+
}
|
|
3602
|
+
};
|
|
3581
3603
|
const style = (change) => {
|
|
3582
3604
|
onChange({ ...options, ...change });
|
|
3583
3605
|
const s = {};
|
|
@@ -3633,7 +3655,21 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
|
|
|
3633
3655
|
/* @__PURE__ */ jsx20(ImageColor, { label: "Text colour", value: shown.color, onChange: (color) => style({ color }) })
|
|
3634
3656
|
] }),
|
|
3635
3657
|
/* @__PURE__ */ jsx20("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: TEXT_ALIGNS.map((a) => /* @__PURE__ */ jsx20("button", { type: "button", "aria-pressed": options.align === a, className: imageChipClass(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
|
|
3636
|
-
/* @__PURE__ */
|
|
3658
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Orientation", children: [
|
|
3659
|
+
TEXT_ORIENTATIONS.map((o) => /* @__PURE__ */ jsx20("button", { type: "button", "aria-pressed": orientation === o, className: imageChipClass(orientation === o), onClick: () => orient(o), children: ORIENTATION_LABELS[o] }, o)),
|
|
3660
|
+
orientation === "vertical" && editedId && /* @__PURE__ */ jsx20(
|
|
3661
|
+
"button",
|
|
3662
|
+
{
|
|
3663
|
+
type: "button",
|
|
3664
|
+
"aria-pressed": Boolean(session?.alive ? here.upright : edited?.type === "type" && edited.runs[0]?.style.upright),
|
|
3665
|
+
className: imageChipClass(Boolean(session?.alive ? here.upright : edited?.type === "type" && edited.runs[0]?.style.upright)),
|
|
3666
|
+
title: "Set Latin upright, one letter under the other (else turned sideways)",
|
|
3667
|
+
onClick: upright,
|
|
3668
|
+
children: "Upright Latin"
|
|
3669
|
+
}
|
|
3670
|
+
)
|
|
3671
|
+
] }),
|
|
3672
|
+
/* @__PURE__ */ jsx20("p", { className: "text-[10px] text-muted-foreground", children: "Click to type point text (vertical: a column down from the click), drag for a paragraph box, click text to edit it. Esc finishes." }),
|
|
3637
3673
|
missing.length > 0 && /* @__PURE__ */ jsxs18("p", { role: "status", className: "text-amber-600", "data-testid": "type-missing-fonts", children: [
|
|
3638
3674
|
"Missing ",
|
|
3639
3675
|
missing.length === 1 ? "font" : "fonts",
|
|
@@ -9,8 +9,8 @@ export interface TypeOptionsBarProps {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* The type tool's options: font family (from the editor's fonts), size, bold, italic, colour
|
|
13
|
-
* alignment. While text is being edited they style the selection (or the whole text); with a
|
|
12
|
+
* The type tool's options: font family (from the editor's fonts), size, bold, italic, colour,
|
|
13
|
+
* alignment and orientation (horizontal or vertical type, with upright Latin in vertical text). While text is being edited they style the selection (or the whole text); with a
|
|
14
14
|
* type layer active they style all of it; otherwise they set what the next text uses.
|
|
15
15
|
*/
|
|
16
16
|
export declare const TypeOptionsBar: React.FC<TypeOptionsBarProps>;
|
|
@@ -9,8 +9,8 @@ export interface TypeOptionsBarProps {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* The type tool's options: font family (from the editor's fonts), size, bold, italic, colour
|
|
13
|
-
* alignment. While text is being edited they style the selection (or the whole text); with a
|
|
12
|
+
* The type tool's options: font family (from the editor's fonts), size, bold, italic, colour,
|
|
13
|
+
* alignment and orientation (horizontal or vertical type, with upright Latin in vertical text). While text is being edited they style the selection (or the whole text); with a
|
|
14
14
|
* type layer active they style all of it; otherwise they set what the next text uses.
|
|
15
15
|
*/
|
|
16
16
|
export declare const TypeOptionsBar: React.FC<TypeOptionsBarProps>;
|
|
@@ -5487,6 +5487,7 @@ var import_react30 = require("react");
|
|
|
5487
5487
|
var import_image_editor19 = require("@pixerate/editor/image-editor");
|
|
5488
5488
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
5489
5489
|
var ALIGN_LABELS = { left: "Left", center: "Centre", right: "Right", justify: "Justify" };
|
|
5490
|
+
var ORIENTATION_LABELS = { horizontal: "Horizontal", vertical: "Vertical" };
|
|
5490
5491
|
var TypeOptionsBar = ({ controller, options, onChange, session, className }) => {
|
|
5491
5492
|
const [, setTick] = (0, import_react30.useState)(0);
|
|
5492
5493
|
(0, import_react30.useEffect)(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
@@ -5504,6 +5505,27 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
|
|
|
5504
5505
|
};
|
|
5505
5506
|
const fonts = controller.listFonts();
|
|
5506
5507
|
const missing = active?.type === "type" ? active.missingFonts ?? [] : [];
|
|
5508
|
+
const editedId = session?.alive ? session.layerId : typeId;
|
|
5509
|
+
const edited = editedId ? controller.getLayer(editedId) : null;
|
|
5510
|
+
const orientation = edited?.type === "type" ? edited.orientation ?? "horizontal" : options.orientation ?? "horizontal";
|
|
5511
|
+
const orient = (next) => {
|
|
5512
|
+
onChange({ ...options, orientation: next });
|
|
5513
|
+
try {
|
|
5514
|
+
setError(null);
|
|
5515
|
+
if (editedId) controller.setTextOrientation(editedId, next);
|
|
5516
|
+
} catch (e) {
|
|
5517
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
5518
|
+
}
|
|
5519
|
+
};
|
|
5520
|
+
const upright = () => {
|
|
5521
|
+
try {
|
|
5522
|
+
setError(null);
|
|
5523
|
+
if (session?.alive) session.setStyle({ upright: !here.upright });
|
|
5524
|
+
else if (typeId) controller.setTextStyle(typeId, { upright: !(edited?.type === "type" && edited.runs[0]?.style.upright) });
|
|
5525
|
+
} catch (e) {
|
|
5526
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
5527
|
+
}
|
|
5528
|
+
};
|
|
5507
5529
|
const style = (change) => {
|
|
5508
5530
|
onChange({ ...options, ...change });
|
|
5509
5531
|
const s = {};
|
|
@@ -5559,7 +5581,21 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
|
|
|
5559
5581
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ImageColor, { label: "Text colour", value: shown.color, onChange: (color) => style({ color }) })
|
|
5560
5582
|
] }),
|
|
5561
5583
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: import_image_editor19.TEXT_ALIGNS.map((a) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", "aria-pressed": options.align === a, className: imageChipClass(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
|
|
5562
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.
|
|
5584
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Orientation", children: [
|
|
5585
|
+
import_image_editor19.TEXT_ORIENTATIONS.map((o) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", "aria-pressed": orientation === o, className: imageChipClass(orientation === o), onClick: () => orient(o), children: ORIENTATION_LABELS[o] }, o)),
|
|
5586
|
+
orientation === "vertical" && editedId && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5587
|
+
"button",
|
|
5588
|
+
{
|
|
5589
|
+
type: "button",
|
|
5590
|
+
"aria-pressed": Boolean(session?.alive ? here.upright : edited?.type === "type" && edited.runs[0]?.style.upright),
|
|
5591
|
+
className: imageChipClass(Boolean(session?.alive ? here.upright : edited?.type === "type" && edited.runs[0]?.style.upright)),
|
|
5592
|
+
title: "Set Latin upright, one letter under the other (else turned sideways)",
|
|
5593
|
+
onClick: upright,
|
|
5594
|
+
children: "Upright Latin"
|
|
5595
|
+
}
|
|
5596
|
+
)
|
|
5597
|
+
] }),
|
|
5598
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-[10px] text-muted-foreground", children: "Click to type point text (vertical: a column down from the click), drag for a paragraph box, click text to edit it. Esc finishes." }),
|
|
5563
5599
|
missing.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("p", { role: "status", className: "text-amber-600", "data-testid": "type-missing-fonts", children: [
|
|
5564
5600
|
"Missing ",
|
|
5565
5601
|
missing.length === 1 ? "font" : "fonts",
|
package/dist/index.cjs
CHANGED
|
@@ -9201,6 +9201,7 @@ var import_react66 = require("react");
|
|
|
9201
9201
|
var import_image_editor19 = require("@pixerate/editor/image-editor");
|
|
9202
9202
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
9203
9203
|
var ALIGN_LABELS = { left: "Left", center: "Centre", right: "Right", justify: "Justify" };
|
|
9204
|
+
var ORIENTATION_LABELS = { horizontal: "Horizontal", vertical: "Vertical" };
|
|
9204
9205
|
var TypeOptionsBar = ({ controller, options, onChange, session, className }) => {
|
|
9205
9206
|
const [, setTick] = (0, import_react66.useState)(0);
|
|
9206
9207
|
(0, import_react66.useEffect)(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
@@ -9218,6 +9219,27 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
|
|
|
9218
9219
|
};
|
|
9219
9220
|
const fonts = controller.listFonts();
|
|
9220
9221
|
const missing = active?.type === "type" ? active.missingFonts ?? [] : [];
|
|
9222
|
+
const editedId = session?.alive ? session.layerId : typeId;
|
|
9223
|
+
const edited = editedId ? controller.getLayer(editedId) : null;
|
|
9224
|
+
const orientation = edited?.type === "type" ? edited.orientation ?? "horizontal" : options.orientation ?? "horizontal";
|
|
9225
|
+
const orient = (next) => {
|
|
9226
|
+
onChange({ ...options, orientation: next });
|
|
9227
|
+
try {
|
|
9228
|
+
setError(null);
|
|
9229
|
+
if (editedId) controller.setTextOrientation(editedId, next);
|
|
9230
|
+
} catch (e) {
|
|
9231
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
9232
|
+
}
|
|
9233
|
+
};
|
|
9234
|
+
const upright = () => {
|
|
9235
|
+
try {
|
|
9236
|
+
setError(null);
|
|
9237
|
+
if (session?.alive) session.setStyle({ upright: !here.upright });
|
|
9238
|
+
else if (typeId) controller.setTextStyle(typeId, { upright: !(edited?.type === "type" && edited.runs[0]?.style.upright) });
|
|
9239
|
+
} catch (e) {
|
|
9240
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
9241
|
+
}
|
|
9242
|
+
};
|
|
9221
9243
|
const style = (change) => {
|
|
9222
9244
|
onChange({ ...options, ...change });
|
|
9223
9245
|
const s = {};
|
|
@@ -9273,7 +9295,21 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
|
|
|
9273
9295
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ImageColor, { label: "Text colour", value: shown.color, onChange: (color) => style({ color }) })
|
|
9274
9296
|
] }),
|
|
9275
9297
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: import_image_editor19.TEXT_ALIGNS.map((a) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", "aria-pressed": options.align === a, className: imageChipClass(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
|
|
9276
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.
|
|
9298
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Orientation", children: [
|
|
9299
|
+
import_image_editor19.TEXT_ORIENTATIONS.map((o) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", "aria-pressed": orientation === o, className: imageChipClass(orientation === o), onClick: () => orient(o), children: ORIENTATION_LABELS[o] }, o)),
|
|
9300
|
+
orientation === "vertical" && editedId && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9301
|
+
"button",
|
|
9302
|
+
{
|
|
9303
|
+
type: "button",
|
|
9304
|
+
"aria-pressed": Boolean(session?.alive ? here.upright : edited?.type === "type" && edited.runs[0]?.style.upright),
|
|
9305
|
+
className: imageChipClass(Boolean(session?.alive ? here.upright : edited?.type === "type" && edited.runs[0]?.style.upright)),
|
|
9306
|
+
title: "Set Latin upright, one letter under the other (else turned sideways)",
|
|
9307
|
+
onClick: upright,
|
|
9308
|
+
children: "Upright Latin"
|
|
9309
|
+
}
|
|
9310
|
+
)
|
|
9311
|
+
] }),
|
|
9312
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "text-[10px] text-muted-foreground", children: "Click to type point text (vertical: a column down from the click), drag for a paragraph box, click text to edit it. Esc finishes." }),
|
|
9277
9313
|
missing.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("p", { role: "status", className: "text-amber-600", "data-testid": "type-missing-fonts", children: [
|
|
9278
9314
|
"Missing ",
|
|
9279
9315
|
missing.length === 1 ? "font" : "fonts",
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,8 @@ export interface VectorTextPanelProps {
|
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Character and paragraph style of text: family, weight, size, italic, underline, strike-through,
|
|
9
|
-
* tracking, leading, alignment
|
|
9
|
+
* tracking, leading, alignment, horizontal / vertical orientation (with upright Latin in vertical
|
|
10
|
+
* text) and point / area text. It edits the selected characters while text
|
|
10
11
|
* is being edited, else the selected text, else the defaults for new text. Type on a Path turns a
|
|
11
12
|
* selected path into path text, and Create Outlines turns text into paths (with an outline
|
|
12
13
|
* shaper). Each change is one undo step.
|
|
@@ -6,7 +6,8 @@ export interface VectorTextPanelProps {
|
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Character and paragraph style of text: family, weight, size, italic, underline, strike-through,
|
|
9
|
-
* tracking, leading, alignment
|
|
9
|
+
* tracking, leading, alignment, horizontal / vertical orientation (with upright Latin in vertical
|
|
10
|
+
* text) and point / area text. It edits the selected characters while text
|
|
10
11
|
* is being edited, else the selected text, else the defaults for new text. Type on a Path turns a
|
|
11
12
|
* selected path into path text, and Create Outlines turns text into paths (with an outline
|
|
12
13
|
* shaper). Each change is one undo step.
|
package/dist/vector/index.cjs
CHANGED
|
@@ -1699,6 +1699,42 @@ function VectorTextPanel({ controller, className }) {
|
|
|
1699
1699
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", className: buttonClass5, "aria-label": "Underline", "aria-pressed": f.underline === true, onClick: () => style({ underline: !f.underline }), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("u", { children: "U" }) }),
|
|
1700
1700
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", className: buttonClass5, "aria-label": "Strike through", "aria-pressed": f.strikethrough === true, onClick: () => style({ strikethrough: !f.strikethrough }), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("s", { children: "S" }) })
|
|
1701
1701
|
] }),
|
|
1702
|
+
panel.target !== "defaults" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Orientation", children: [
|
|
1703
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1704
|
+
"button",
|
|
1705
|
+
{
|
|
1706
|
+
type: "button",
|
|
1707
|
+
className: buttonClass5,
|
|
1708
|
+
"aria-pressed": panel.orientation === "horizontal",
|
|
1709
|
+
title: "Horizontal text: lines left to right",
|
|
1710
|
+
onClick: () => (0, import_vector8.applyVectorTextOrientation)(controller, "horizontal"),
|
|
1711
|
+
children: "Horizontal"
|
|
1712
|
+
}
|
|
1713
|
+
),
|
|
1714
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1715
|
+
"button",
|
|
1716
|
+
{
|
|
1717
|
+
type: "button",
|
|
1718
|
+
className: buttonClass5,
|
|
1719
|
+
"aria-pressed": panel.orientation === "vertical",
|
|
1720
|
+
disabled: !panel.canOrient,
|
|
1721
|
+
title: panel.canOrient ? "Vertical text: columns top to bottom, right to left" : "Text on a path cannot be vertical",
|
|
1722
|
+
onClick: () => (0, import_vector8.applyVectorTextOrientation)(controller, "vertical"),
|
|
1723
|
+
children: "Vertical"
|
|
1724
|
+
}
|
|
1725
|
+
),
|
|
1726
|
+
panel.orientation === "vertical" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1727
|
+
"button",
|
|
1728
|
+
{
|
|
1729
|
+
type: "button",
|
|
1730
|
+
className: buttonClass5,
|
|
1731
|
+
"aria-pressed": f.upright === true,
|
|
1732
|
+
title: "Set Latin upright, one letter under the other (else turned sideways)",
|
|
1733
|
+
onClick: () => style({ upright: !f.upright }),
|
|
1734
|
+
children: "Upright Latin"
|
|
1735
|
+
}
|
|
1736
|
+
)
|
|
1737
|
+
] }),
|
|
1702
1738
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
1703
1739
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "flex flex-1 items-center gap-1 text-xs text-foreground", title: "Tracking (1/1000 em)", children: [
|
|
1704
1740
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-[11px] text-muted-foreground", children: "VA" }),
|
package/dist/vector/index.js
CHANGED
|
@@ -1536,6 +1536,7 @@ import {
|
|
|
1536
1536
|
VECTOR_FONT_WEIGHTS,
|
|
1537
1537
|
VECTOR_TEXT_ALIGN_OPTIONS,
|
|
1538
1538
|
applyVectorParagraphStyle,
|
|
1539
|
+
applyVectorTextOrientation,
|
|
1539
1540
|
applyVectorTextStyle,
|
|
1540
1541
|
getVectorTextPanel
|
|
1541
1542
|
} from "@pixerate/editor/vector";
|
|
@@ -1612,6 +1613,42 @@ function VectorTextPanel({ controller, className }) {
|
|
|
1612
1613
|
/* @__PURE__ */ jsx7("button", { type: "button", className: buttonClass5, "aria-label": "Underline", "aria-pressed": f.underline === true, onClick: () => style({ underline: !f.underline }), children: /* @__PURE__ */ jsx7("u", { children: "U" }) }),
|
|
1613
1614
|
/* @__PURE__ */ jsx7("button", { type: "button", className: buttonClass5, "aria-label": "Strike through", "aria-pressed": f.strikethrough === true, onClick: () => style({ strikethrough: !f.strikethrough }), children: /* @__PURE__ */ jsx7("s", { children: "S" }) })
|
|
1614
1615
|
] }),
|
|
1616
|
+
panel.target !== "defaults" && /* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Orientation", children: [
|
|
1617
|
+
/* @__PURE__ */ jsx7(
|
|
1618
|
+
"button",
|
|
1619
|
+
{
|
|
1620
|
+
type: "button",
|
|
1621
|
+
className: buttonClass5,
|
|
1622
|
+
"aria-pressed": panel.orientation === "horizontal",
|
|
1623
|
+
title: "Horizontal text: lines left to right",
|
|
1624
|
+
onClick: () => applyVectorTextOrientation(controller, "horizontal"),
|
|
1625
|
+
children: "Horizontal"
|
|
1626
|
+
}
|
|
1627
|
+
),
|
|
1628
|
+
/* @__PURE__ */ jsx7(
|
|
1629
|
+
"button",
|
|
1630
|
+
{
|
|
1631
|
+
type: "button",
|
|
1632
|
+
className: buttonClass5,
|
|
1633
|
+
"aria-pressed": panel.orientation === "vertical",
|
|
1634
|
+
disabled: !panel.canOrient,
|
|
1635
|
+
title: panel.canOrient ? "Vertical text: columns top to bottom, right to left" : "Text on a path cannot be vertical",
|
|
1636
|
+
onClick: () => applyVectorTextOrientation(controller, "vertical"),
|
|
1637
|
+
children: "Vertical"
|
|
1638
|
+
}
|
|
1639
|
+
),
|
|
1640
|
+
panel.orientation === "vertical" && /* @__PURE__ */ jsx7(
|
|
1641
|
+
"button",
|
|
1642
|
+
{
|
|
1643
|
+
type: "button",
|
|
1644
|
+
className: buttonClass5,
|
|
1645
|
+
"aria-pressed": f.upright === true,
|
|
1646
|
+
title: "Set Latin upright, one letter under the other (else turned sideways)",
|
|
1647
|
+
onClick: () => style({ upright: !f.upright }),
|
|
1648
|
+
children: "Upright Latin"
|
|
1649
|
+
}
|
|
1650
|
+
)
|
|
1651
|
+
] }),
|
|
1615
1652
|
/* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-1", children: [
|
|
1616
1653
|
/* @__PURE__ */ jsxs7("label", { className: "flex flex-1 items-center gap-1 text-xs text-foreground", title: "Tracking (1/1000 em)", children: [
|
|
1617
1654
|
/* @__PURE__ */ jsx7("span", { className: "text-[11px] text-muted-foreground", children: "VA" }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.128.0",
|
|
4
4
|
"description": "React bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -254,7 +254,7 @@
|
|
|
254
254
|
"dependencies": {},
|
|
255
255
|
"peerDependencies": {
|
|
256
256
|
"@dagrejs/dagre": "^1.1.8",
|
|
257
|
-
"@pixerate/editor": ">=0.
|
|
257
|
+
"@pixerate/editor": ">=0.193.0 <1.0.0-0",
|
|
258
258
|
"@tiptap/core": "^2.27.3",
|
|
259
259
|
"@tiptap/extension-bubble-menu": "^2.27.3",
|
|
260
260
|
"@tiptap/extension-placeholder": "^2.27.3",
|
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
"tsup": "^9.0.0",
|
|
306
306
|
"typescript": "^5.7.3",
|
|
307
307
|
"vitest": "^5.0.5",
|
|
308
|
-
"@pixerate/editor": "0.
|
|
308
|
+
"@pixerate/editor": "0.193.0"
|
|
309
309
|
},
|
|
310
310
|
"scripts": {
|
|
311
311
|
"build": "tsup && tsc -p tsconfig.build.json && node ../../scripts/finalize-declarations.mjs dist",
|