@pdfme/ui 5.5.2-dev.1 → 5.5.2-dev.3
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/index.es.js +36 -20
- package/dist/index.umd.js +6 -6
- package/dist/types/src/constants.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/CtlBar.tsx +18 -9
- package/src/components/Designer/Canvas/index.tsx +4 -2
- package/src/components/Designer/LeftSidebar.tsx +5 -1
- package/src/components/Designer/RightSidebar/DetailView/AlignWidget.tsx +2 -0
- package/src/components/Designer/RightSidebar/DetailView/index.tsx +3 -1
- package/src/components/Designer/RightSidebar/ListView/index.tsx +5 -5
- package/src/components/Designer/RightSidebar/index.tsx +3 -1
- package/src/components/Root.tsx +3 -3
- package/src/constants.ts +4 -0
package/dist/index.es.js
CHANGED
|
@@ -12197,7 +12197,7 @@ const expressionCache = /* @__PURE__ */ new Map(), parseDataCache = /* @__PURE__
|
|
|
12197
12197
|
const [, c] = this.findWithLabelByType(s);
|
|
12198
12198
|
return c;
|
|
12199
12199
|
}
|
|
12200
|
-
}), DEFAULT_LANG = "en", DESTROYED_ERR_MSG = "[@pdfme/ui] this instance is already destroyed", SELECTABLE_CLASSNAME = "selectable", RULER_HEIGHT = 30, PAGE_GAP = 10, LEFT_SIDEBAR_WIDTH = 45, RIGHT_SIDEBAR_WIDTH = 400, BACKGROUND_COLOR = "rgb(74, 74, 74)", DEFAULT_MAX_ZOOM = 2, isff = typeof navigator < "u" ? navigator.userAgent.toLowerCase().indexOf("firefox") > 0 : !1;
|
|
12200
|
+
}), DEFAULT_LANG = "en", DESTROYED_ERR_MSG = "[@pdfme/ui] this instance is already destroyed", SELECTABLE_CLASSNAME = "selectable", RULER_HEIGHT = 30, PAGE_GAP = 10, LEFT_SIDEBAR_WIDTH = 45, RIGHT_SIDEBAR_WIDTH = 400, BACKGROUND_COLOR = "rgb(74, 74, 74)", DEFAULT_MAX_ZOOM = 2, DESIGNER_CLASSNAME = "pdfme-designer-", UI_CLASSNAME = "pdfme-ui-", isff = typeof navigator < "u" ? navigator.userAgent.toLowerCase().indexOf("firefox") > 0 : !1;
|
|
12201
12201
|
function addEvent$1(a, s, c, u) {
|
|
12202
12202
|
a.addEventListener ? a.addEventListener(s, c, u) : a.attachEvent && a.attachEvent("on".concat(s), c);
|
|
12203
12203
|
}
|
|
@@ -130650,7 +130650,7 @@ const SVGIcon = ({ svgString: a, size: s, styles: c, label: u }) => {
|
|
|
130650
130650
|
m(s.map(($) => $.name).join(`
|
|
130651
130651
|
`)), y(!0);
|
|
130652
130652
|
};
|
|
130653
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
130653
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: DESIGNER_CLASSNAME + "list-view", children: [
|
|
130654
130654
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { height: headHeight, display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Text$3, { strong: !0, style: { textAlign: "center", width: "100%" }, children: g("fieldsList") }) }),
|
|
130655
130655
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Divider, { style: { marginTop: x.marginXS, marginBottom: x.marginXS } }),
|
|
130656
130656
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { height: E - headHeight }, children: [
|
|
@@ -130687,16 +130687,16 @@ const SVGIcon = ({ svgString: a, size: s, styles: c, label: u }) => {
|
|
|
130687
130687
|
justifyContent: "flex-end"
|
|
130688
130688
|
},
|
|
130689
130689
|
children: b ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
130690
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { size: "small", type: "text", onClick: w, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("u", { children: [
|
|
130690
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { className: DESIGNER_CLASSNAME + "bulk-commit", size: "small", type: "text", onClick: w, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("u", { children: [
|
|
130691
130691
|
" ",
|
|
130692
130692
|
g("commitBulkUpdateFieldName")
|
|
130693
130693
|
] }) }),
|
|
130694
130694
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { margin: "0 1rem" }, children: "/" }),
|
|
130695
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { size: "small", type: "text", onClick: () => y(!1), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("u", { children: [
|
|
130695
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { className: DESIGNER_CLASSNAME + "bulk-cancel", size: "small", type: "text", onClick: () => y(!1), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("u", { children: [
|
|
130696
130696
|
" ",
|
|
130697
130697
|
g("cancel")
|
|
130698
130698
|
] }) })
|
|
130699
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { size: "small", type: "text", onClick: S, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("u", { children: [
|
|
130699
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { className: DESIGNER_CLASSNAME + "bulk-update", size: "small", type: "text", onClick: S, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("u", { children: [
|
|
130700
130700
|
" ",
|
|
130701
130701
|
g("bulkUpdateFieldName")
|
|
130702
130702
|
] }) })
|
|
@@ -146308,6 +146308,7 @@ const FormRenderComponent = withProvider(FormCore, defaultWidgets), AlignWidget
|
|
|
146308
146308
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Form$1.Item, { label: p.title, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Space.Compact, { children: x.map((g) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
146309
146309
|
Button$1,
|
|
146310
146310
|
{
|
|
146311
|
+
className: DESIGNER_CLASSNAME + "align-" + g.id,
|
|
146311
146312
|
style: { padding: 7 },
|
|
146312
146313
|
disabled: s.length <= 2 && ["vertical", "horizontal"].includes(g.id),
|
|
146313
146314
|
...g
|
|
@@ -146603,11 +146604,12 @@ const FormRenderComponent = withProvider(FormCore, defaultWidgets), AlignWidget
|
|
|
146603
146604
|
...N
|
|
146604
146605
|
};
|
|
146605
146606
|
}
|
|
146606
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
146607
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: DESIGNER_CLASSNAME + "detail-view", children: [
|
|
146607
146608
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { height: 40, display: "flex", alignItems: "center" }, children: [
|
|
146608
146609
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
146609
146610
|
Button$1,
|
|
146610
146611
|
{
|
|
146612
|
+
className: DESIGNER_CLASSNAME + "back-button",
|
|
146611
146613
|
style: {
|
|
146612
146614
|
position: "absolute",
|
|
146613
146615
|
zIndex: 100,
|
|
@@ -146651,6 +146653,7 @@ const FormRenderComponent = withProvider(FormCore, defaultWidgets), AlignWidget
|
|
|
146651
146653
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
146652
146654
|
"div",
|
|
146653
146655
|
{
|
|
146656
|
+
className: DESIGNER_CLASSNAME + "right-sidebar",
|
|
146654
146657
|
style: {
|
|
146655
146658
|
position: "absolute",
|
|
146656
146659
|
right: 0,
|
|
@@ -146662,6 +146665,7 @@ const FormRenderComponent = withProvider(FormCore, defaultWidgets), AlignWidget
|
|
|
146662
146665
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
146663
146666
|
Button$1,
|
|
146664
146667
|
{
|
|
146668
|
+
className: DESIGNER_CLASSNAME + "sidebar-toggle",
|
|
146665
146669
|
style: {
|
|
146666
146670
|
position: "absolute",
|
|
146667
146671
|
display: "flex",
|
|
@@ -146822,6 +146826,7 @@ Check this document: https://pdfme.com/docs/custom-schemas`), /* @__PURE__ */ js
|
|
|
146822
146826
|
}, [p]), /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
146823
146827
|
"div",
|
|
146824
146828
|
{
|
|
146829
|
+
className: DESIGNER_CLASSNAME + "left-sidebar",
|
|
146825
146830
|
style: {
|
|
146826
146831
|
left: 0,
|
|
146827
146832
|
right: 0,
|
|
@@ -146833,14 +146838,19 @@ Check this document: https://pdfme.com/docs/custom-schemas`), /* @__PURE__ */ js
|
|
|
146833
146838
|
textAlign: "center",
|
|
146834
146839
|
overflow: p ? "visible" : "auto"
|
|
146835
146840
|
},
|
|
146836
|
-
children: d.entries().map(([A, x]) =>
|
|
146837
|
-
|
|
146838
|
-
|
|
146839
|
-
|
|
146840
|
-
|
|
146841
|
-
|
|
146842
|
-
|
|
146843
|
-
|
|
146841
|
+
children: d.entries().map(([A, x]) => {
|
|
146842
|
+
if (!x?.propPanel.defaultSchema) return null;
|
|
146843
|
+
const g = x.propPanel.defaultSchema.type;
|
|
146844
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Draggable$1, { scale: s, basePdf: c, plugin: x, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
146845
|
+
Button$1,
|
|
146846
|
+
{
|
|
146847
|
+
className: DESIGNER_CLASSNAME + "plugin-" + g,
|
|
146848
|
+
onMouseDown: () => v(!0),
|
|
146849
|
+
style: { width: 35, height: 35, marginTop: "0.25rem", padding: "0.25rem" },
|
|
146850
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(PluginIcon, { plugin: x, label: A })
|
|
146851
|
+
}
|
|
146852
|
+
) }, A);
|
|
146853
|
+
})
|
|
146844
146854
|
}
|
|
146845
146855
|
);
|
|
146846
146856
|
}, Paper = (a) => {
|
|
@@ -158236,6 +158246,7 @@ const guideStyle = (a, s, c, u) => ({
|
|
|
158236
158246
|
Button$1,
|
|
158237
158247
|
{
|
|
158238
158248
|
id: DELETE_BTN_ID,
|
|
158249
|
+
className: DESIGNER_CLASSNAME + "delete-button",
|
|
158239
158250
|
style: {
|
|
158240
158251
|
position: "absolute",
|
|
158241
158252
|
zIndex: 1,
|
|
@@ -158366,6 +158377,7 @@ const guideStyle = (a, s, c, u) => ({
|
|
|
158366
158377
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
158367
158378
|
"div",
|
|
158368
158379
|
{
|
|
158380
|
+
className: DESIGNER_CLASSNAME + "canvas",
|
|
158369
158381
|
style: {
|
|
158370
158382
|
position: "relative",
|
|
158371
158383
|
overflow: "auto",
|
|
@@ -158541,7 +158553,7 @@ const guideStyle = (a, s, c, u) => ({
|
|
|
158541
158553
|
x.status === "fulfilled" && document.fonts.add(x.value);
|
|
158542
158554
|
});
|
|
158543
158555
|
});
|
|
158544
|
-
}, [d]), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: u, style: { position: "relative", background: BACKGROUND_COLOR, ...a }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { margin: "0 auto", ...a }, children: s === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(Spinner, {}) : c }) });
|
|
158556
|
+
}, [d]), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: DESIGNER_CLASSNAME + "root", ref: u, style: { position: "relative", background: BACKGROUND_COLOR, ...a }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: DESIGNER_CLASSNAME + "background", style: { margin: "0 auto", ...a }, children: s === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(Spinner, {}) : c }) });
|
|
158545
158557
|
}, Root$1 = reactExports.forwardRef(Root), ErrorScreen = ({ size: a, error: s }) => {
|
|
158546
158558
|
const c = reactExports.useContext(I18nContext), { token: u } = theme.useToken();
|
|
158547
158559
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -158571,6 +158583,7 @@ const guideStyle = (a, s, c, u) => ({
|
|
|
158571
158583
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
158572
158584
|
Button$1,
|
|
158573
158585
|
{
|
|
158586
|
+
className: UI_CLASSNAME + "zoom-out",
|
|
158574
158587
|
type: "text",
|
|
158575
158588
|
disabled: p >= v,
|
|
158576
158589
|
onClick: () => s(v),
|
|
@@ -158584,6 +158597,7 @@ const guideStyle = (a, s, c, u) => ({
|
|
|
158584
158597
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
158585
158598
|
Button$1,
|
|
158586
158599
|
{
|
|
158600
|
+
className: UI_CLASSNAME + "zoom-in",
|
|
158587
158601
|
type: "text",
|
|
158588
158602
|
disabled: d < A,
|
|
158589
158603
|
onClick: () => s(A),
|
|
@@ -158592,7 +158606,7 @@ const guideStyle = (a, s, c, u) => ({
|
|
|
158592
158606
|
)
|
|
158593
158607
|
] });
|
|
158594
158608
|
}, Pager = ({ pageCursor: a, pageNum: s, setPageCursor: c, style: u }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
158595
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { type: "text", disabled: a <= 0, onClick: () => c(a - 1), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronLeft, { size: 16, color: u.textStyle.color }) }),
|
|
158609
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { className: UI_CLASSNAME + "page-prev", type: "text", disabled: a <= 0, onClick: () => c(a - 1), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronLeft, { size: 16, color: u.textStyle.color }) }),
|
|
158596
158610
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Text$1, { strong: !0, style: u.textStyle, children: [
|
|
158597
158611
|
a + 1,
|
|
158598
158612
|
"/",
|
|
@@ -158601,13 +158615,14 @@ const guideStyle = (a, s, c, u) => ({
|
|
|
158601
158615
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
158602
158616
|
Button$1,
|
|
158603
158617
|
{
|
|
158618
|
+
className: UI_CLASSNAME + "page-next",
|
|
158604
158619
|
type: "text",
|
|
158605
158620
|
disabled: a + 1 >= s,
|
|
158606
158621
|
onClick: () => c(a + 1),
|
|
158607
158622
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { size: 16, color: u.textStyle.color })
|
|
158608
158623
|
}
|
|
158609
158624
|
)
|
|
158610
|
-
] }), ContextMenu = ({ items: a, style: s }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Dropdown, { menu: { items: a }, placement: "top", arrow: !0, trigger: ["click"], children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { type: "text", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Ellipsis, { size: 16, color: s.textStyle.color }) }) }), CtlBar = (a) => {
|
|
158625
|
+
] }), ContextMenu = ({ items: a, style: s }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Dropdown, { menu: { items: a }, placement: "top", arrow: !0, trigger: ["click"], children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { className: UI_CLASSNAME + "context-menu", type: "text", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Ellipsis, { size: 16, color: s.textStyle.color }) }) }), CtlBar = (a) => {
|
|
158611
158626
|
const { token: s } = theme.useToken(), c = reactExports.useContext(I18nContext), {
|
|
158612
158627
|
size: u,
|
|
158613
158628
|
pageCursor: d,
|
|
@@ -158633,6 +158648,7 @@ const guideStyle = (a, s, c, u) => ({
|
|
|
158633
158648
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { position: "absolute", top: "auto", bottom: "6%", width: u.width }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
158634
158649
|
"div",
|
|
158635
158650
|
{
|
|
158651
|
+
className: UI_CLASSNAME + "control-bar",
|
|
158636
158652
|
style: {
|
|
158637
158653
|
display: "flex",
|
|
158638
158654
|
alignItems: "center",
|
|
@@ -158648,7 +158664,7 @@ const guideStyle = (a, s, c, u) => ({
|
|
|
158648
158664
|
backgroundColor: s.colorBgMask
|
|
158649
158665
|
},
|
|
158650
158666
|
children: [
|
|
158651
|
-
p > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
158667
|
+
p > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: UI_CLASSNAME + "pager", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
158652
158668
|
Pager,
|
|
158653
158669
|
{
|
|
158654
158670
|
style: { textStyle: w },
|
|
@@ -158656,8 +158672,8 @@ const guideStyle = (a, s, c, u) => ({
|
|
|
158656
158672
|
pageNum: p,
|
|
158657
158673
|
setPageCursor: v
|
|
158658
158674
|
}
|
|
158659
|
-
),
|
|
158660
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Zoom, { style: { textStyle: w }, zoomLevel: A, setZoomLevel: x }),
|
|
158675
|
+
) }),
|
|
158676
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: UI_CLASSNAME + "zoom", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Zoom, { style: { textStyle: w }, zoomLevel: A, setZoomLevel: x }) }),
|
|
158661
158677
|
y.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(ContextMenu, { items: y, style: { textStyle: w } })
|
|
158662
158678
|
]
|
|
158663
158679
|
}
|