@nxgt/material 3.6.0 → 3.7.1
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/CHANGELOG.md +26 -0
- package/README.md +46 -1
- package/dist/{button-1Fornjtn.js → button--cF4gY14.js} +1 -1
- package/dist/charts.js +1 -1
- package/dist/{code-editor-DeZYlIO2.js → code-editor-0CdGwKDg.js} +3 -3
- package/dist/code-editor.js +3 -3
- package/dist/{code-language-items-Bb7afEj-.js → code-language-items-CGARRbVm.js} +1 -1
- package/dist/components/animations/scroll.css +1 -1
- package/dist/components/base-content.css +1 -1
- package/dist/components/base.css +1 -1
- package/dist/components/components.css +2 -0
- package/dist/components/editor-field-expressive.css +5 -0
- package/dist/components/editor-prose.css +1 -1
- package/dist/components/theme-tokens.css +17 -4
- package/dist/components/ui/display/period-cards/period-cards.css +2 -2
- package/dist/components/ui/media/pdf-viewer/pdf-viewer.css +1 -1
- package/dist/components/ui/widgets/drawing/drawing-animate.css +123 -0
- package/dist/components/ui/widgets/drawing/drawing.css +459 -0
- package/dist/{components-BCYZgeoV.js → components-bYGPzyKd.js} +761 -761
- package/dist/components.js +18 -18
- package/dist/{dialog-JQT6iETD.js → dialog-DdJ1C4BR.js} +168 -168
- package/dist/dnd.js +1 -1
- package/dist/draw-animate.js +106 -0
- package/dist/draw-png.js +2 -0
- package/dist/draw-sketch.js +38 -0
- package/dist/draw.js +65 -0
- package/dist/drawing-B8VuG7nx.js +390 -0
- package/dist/drawing-context-CeKeZE6b.js +10 -0
- package/dist/{dropdown-menu-DiZvX4tG.js → dropdown-menu-DWtgUVW7.js} +1 -1
- package/dist/editor-viewer.js +1 -1
- package/dist/editor.js +120 -120
- package/dist/{empty-state-Cpvsmk0R.js → empty-state-CRWLQ1sM.js} +2 -2
- package/dist/{icon-badge-C30yKsAM.js → icon-badge-Bb5-73XP.js} +18 -18
- package/dist/{icon-button-BXlI3DJ_.js → icon-button-5A6Mrj6w.js} +60 -90
- package/dist/lib/components/ui/display/shape/use-shape-morph.d.ts +1 -0
- package/dist/lib/components/ui/widgets/drawing/drawing-a11y.d.ts +20 -0
- package/dist/lib/components/ui/widgets/drawing/drawing-context.d.ts +23 -0
- package/dist/lib/components/ui/widgets/drawing/drawing-types.d.ts +63 -0
- package/dist/lib/components/ui/widgets/drawing/drawing.d.ts +17 -0
- package/dist/lib/components/ui/widgets/drawing/index.d.ts +5 -0
- package/dist/lib/components/ui/widgets/drawing/partials/drawing-root.d.ts +17 -0
- package/dist/lib/components/ui/widgets/drawing/partials/interactive-node.d.ts +22 -0
- package/dist/lib/components/ui/widgets/drawing/partials/primitives/content.d.ts +20 -0
- package/dist/lib/components/ui/widgets/drawing/partials/primitives/path.d.ts +29 -0
- package/dist/lib/components/ui/widgets/drawing/partials/primitives/primitive.d.ts +19 -0
- package/dist/lib/components/ui/widgets/drawing/partials/primitives/shapes.d.ts +18 -0
- package/dist/lib/components/ui/widgets/drawing/partials/react-attrs.d.ts +5 -0
- package/dist/lib/components/ui/widgets/drawing/partials/ring.d.ts +9 -0
- package/dist/lib/components/ui/widgets/drawing/partials/svg-tree.d.ts +29 -0
- package/dist/lib/components/ui/widgets/drawing/use-exact-text.d.ts +16 -0
- package/dist/lib/draw/index.d.ts +32 -0
- package/dist/lib/draw-animate/index.d.ts +19 -0
- package/dist/lib/draw-animate/morph-drawing.d.ts +32 -0
- package/dist/lib/draw-animate/reduced-motion.d.ts +2 -0
- package/dist/lib/draw-animate/use-drawing-controls.d.ts +27 -0
- package/dist/lib/draw-animate/use-scene-morph.d.ts +15 -0
- package/dist/lib/draw-png/index.d.ts +11 -0
- package/dist/lib/draw-sketch/index.d.ts +17 -0
- package/dist/lib/draw-sketch/sketch.d.ts +19 -0
- package/dist/lib/print/components/print-drawing.d.ts +16 -0
- package/dist/lib/print/index.d.ts +2 -1
- package/dist/main.js +23 -23
- package/dist/map.js +63 -63
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +123 -115
- package/dist/{public-Cde8_SN8.js → public-SsiazLEv.js} +743 -743
- package/dist/{render-json-BwJX1jZ2.js → render-json-DyFYFIkZ.js} +1 -1
- package/dist/{rich-code-block-yxMXBuGd.js → rich-code-block-CwNwQs5z.js} +3 -3
- package/dist/{rich-text-viewer-Bq-2vTVm.js → rich-text-viewer-LO1IZCWs.js} +1 -1
- package/dist/{sortable-provider-DYlpq8lP.js → sortable-provider-BvD98s8Y.js} +19 -19
- package/dist/{spinner-D-FE_mTW.js → spinner-CtGCPza-.js} +4 -4
- package/dist/styles.css +1 -0
- package/dist/{toolbar-items-DnkS3bDY.js → toolbar-items-DsDDD5AY.js} +1 -1
- package/dist/{use-chat-composer-BwpSgP_D.js → use-chat-composer-DZ01a16D.js} +923 -922
- package/dist/use-shape-morph-BKA_R5P5.js +35 -0
- package/docs/README.md +1 -0
- package/docs/components/rich-widgets.md +196 -0
- package/docs/guides/drawing.md +499 -0
- package/docs/guides/printing.md +47 -0
- package/docs/guides/theming.md +3 -2
- package/docs/previews/rich-widgets-drawing.webp +0 -0
- package/docs/roadmap.md +17 -0
- package/docs/troubleshooting.md +145 -1
- package/lib/components/animations/scroll.css +1 -1
- package/lib/components/base-content.css +1 -1
- package/lib/components/base.css +1 -1
- package/lib/components/components.css +2 -0
- package/lib/components/editor-field-expressive.css +5 -0
- package/lib/components/editor-prose.css +1 -1
- package/lib/components/theme-tokens.css +17 -4
- package/lib/components/ui/display/period-cards/period-cards.css +2 -2
- package/lib/components/ui/media/pdf-viewer/pdf-viewer.css +1 -1
- package/lib/components/ui/widgets/drawing/drawing-animate.css +123 -0
- package/lib/components/ui/widgets/drawing/drawing.css +459 -0
- package/lib/styles.css +1 -0
- package/package.json +22 -2
package/dist/map.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as e } from "./utils-Bcd2Z3ea.js";
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as m } from "./
|
|
7
|
-
import { t as h } from "./button-
|
|
2
|
+
import { t } from "./tooltip-tmFoTU_d.js";
|
|
3
|
+
import { c as n, n as r, o as i, r as a, s as o, t as s, u as c } from "./dialog-DdJ1C4BR.js";
|
|
4
|
+
import { i as l, n as u, r as d, t as f } from "./hover-card-D5iHS9q1.js";
|
|
5
|
+
import { t as p } from "./use-material-translation-hLQzOjF0.js";
|
|
6
|
+
import { t as m } from "./button--cF4gY14.js";
|
|
7
|
+
import { t as h } from "./icon-button-5A6Mrj6w.js";
|
|
8
8
|
import { r as g, t as _ } from "./field-blur-DFUazxsL.js";
|
|
9
|
-
import { n as v, t as y } from "./icon-badge-
|
|
9
|
+
import { n as v, t as y } from "./icon-badge-Bb5-73XP.js";
|
|
10
10
|
import { MapIcon as b, MapPin as x, Minus as S, Plus as C } from "lucide-react";
|
|
11
11
|
import { useCallback as w, useEffect as T, useEffectEvent as E, useMemo as D, useRef as O, useState as k } from "react";
|
|
12
12
|
import { jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
@@ -95,7 +95,7 @@ function J({ className: t, children: n, showMinicardControl: r = !0, zoom: i = 1
|
|
|
95
95
|
attribution: "© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors",
|
|
96
96
|
url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
|
97
97
|
}),
|
|
98
|
-
/* @__PURE__ */ A(
|
|
98
|
+
/* @__PURE__ */ A(l, {
|
|
99
99
|
visible: r,
|
|
100
100
|
children: /* @__PURE__ */ A(q, {
|
|
101
101
|
position: "topright",
|
|
@@ -109,7 +109,7 @@ function J({ className: t, children: n, showMinicardControl: r = !0, zoom: i = 1
|
|
|
109
109
|
}
|
|
110
110
|
//#endregion
|
|
111
111
|
//#region lib/map/components/partials/marker.tsx
|
|
112
|
-
function Y({ title: e, position:
|
|
112
|
+
function Y({ title: e, position: n, onChange: r, draggable: i, children: a, tooltip: o, reference: s, icon: c, ...l }) {
|
|
113
113
|
let u = R({ viewreset() {
|
|
114
114
|
s && r?.(u.getCenter());
|
|
115
115
|
} }), d = O(null), f = D(() => ({ dragend() {
|
|
@@ -119,15 +119,15 @@ function Y({ title: e, position: t, onChange: r, draggable: i, children: a, tool
|
|
|
119
119
|
s && u.flyTo(e, u.getZoom());
|
|
120
120
|
});
|
|
121
121
|
return T(() => {
|
|
122
|
-
p(
|
|
123
|
-
}, [
|
|
122
|
+
p(n);
|
|
123
|
+
}, [n]), /* @__PURE__ */ A(H, {
|
|
124
124
|
...l,
|
|
125
125
|
title: e ?? (typeof o == "string" ? o : void 0),
|
|
126
126
|
draggable: i,
|
|
127
127
|
eventHandlers: f,
|
|
128
|
-
position:
|
|
128
|
+
position: n,
|
|
129
129
|
ref: d,
|
|
130
|
-
icon: o ? /* @__PURE__ */ A(
|
|
130
|
+
icon: o ? /* @__PURE__ */ A(t, {
|
|
131
131
|
content: o,
|
|
132
132
|
children: c ?? /* @__PURE__ */ A(X, {})
|
|
133
133
|
}) : c ?? /* @__PURE__ */ A(X, {}),
|
|
@@ -143,27 +143,27 @@ function X() {
|
|
|
143
143
|
}
|
|
144
144
|
//#endregion
|
|
145
145
|
//#region lib/map/components/partials/location-preview.tsx
|
|
146
|
-
function Z({ name: e, position:
|
|
146
|
+
function Z({ name: e, position: t, children: n }) {
|
|
147
147
|
"use no memo";
|
|
148
|
-
let { t:
|
|
149
|
-
return /* @__PURE__ */ j(
|
|
150
|
-
open:
|
|
151
|
-
onOpenChange:
|
|
152
|
-
children: [/* @__PURE__ */ A(
|
|
148
|
+
let { t: r } = p(), [i, a] = k(!1);
|
|
149
|
+
return /* @__PURE__ */ j(f, {
|
|
150
|
+
open: i,
|
|
151
|
+
onOpenChange: a,
|
|
152
|
+
children: [/* @__PURE__ */ A(d, {
|
|
153
153
|
asChild: !0,
|
|
154
|
-
children:
|
|
154
|
+
children: n ?? /* @__PURE__ */ A(h, {
|
|
155
155
|
variant: "tonal",
|
|
156
156
|
"data-pw": `${e ?? "location"}-preview`,
|
|
157
157
|
color: "info",
|
|
158
|
-
"aria-label": e ?
|
|
158
|
+
"aria-label": e ? r("material.map.preview-named", "Preview {name}", { name: e }) : r("material.map.preview", "Preview location"),
|
|
159
159
|
children: /* @__PURE__ */ A(b, {})
|
|
160
160
|
})
|
|
161
|
-
}), /* @__PURE__ */ A(
|
|
161
|
+
}), /* @__PURE__ */ A(u, {
|
|
162
162
|
className: "aspect-square",
|
|
163
163
|
children: /* @__PURE__ */ A(J, {
|
|
164
|
-
center:
|
|
164
|
+
center: t,
|
|
165
165
|
showMinicardControl: !1,
|
|
166
|
-
children: /* @__PURE__ */ A(Y, { position:
|
|
166
|
+
children: /* @__PURE__ */ A(Y, { position: t })
|
|
167
167
|
})
|
|
168
168
|
})]
|
|
169
169
|
});
|
|
@@ -171,48 +171,48 @@ function Z({ name: e, position: n, children: r }) {
|
|
|
171
171
|
//#endregion
|
|
172
172
|
//#region lib/map/components/location-field.tsx
|
|
173
173
|
var Q = [5.44087, 10.06843];
|
|
174
|
-
function $({ value:
|
|
175
|
-
let { t: y } =
|
|
174
|
+
function $({ value: t, onChange: l, dialogTitle: u, closeLabel: d, mapClassName: f, placeholder: g, ..._ }) {
|
|
175
|
+
let { t: y } = p(), b = u ?? y("material.location-field.dialog-title", "Choose a location"), S = O(null), C = w((e) => {
|
|
176
176
|
if (e) {
|
|
177
177
|
let t = [parseFloat(e.lat.toFixed(7)), parseFloat(e.lng.toFixed(7))];
|
|
178
|
-
S.current = t,
|
|
178
|
+
S.current = t, l?.(t);
|
|
179
179
|
}
|
|
180
|
-
}, [
|
|
181
|
-
!
|
|
180
|
+
}, [l]), [T, E] = k(!1), D = t ?? Q, M = !_.disabled && !_.readOnly, N = w(() => {
|
|
181
|
+
!t && M && l?.(S.current ?? Q), E(!1);
|
|
182
182
|
}, [
|
|
183
|
-
|
|
183
|
+
t,
|
|
184
184
|
M,
|
|
185
|
-
|
|
185
|
+
l
|
|
186
186
|
]);
|
|
187
187
|
return /* @__PURE__ */ A(v, {
|
|
188
188
|
..._,
|
|
189
|
-
value:
|
|
189
|
+
value: t ? t.join(" - ") : "",
|
|
190
190
|
placeholder: g ?? y("material.location-field.placeholder", "No location selected"),
|
|
191
|
-
leading:
|
|
192
|
-
position:
|
|
191
|
+
leading: t ? /* @__PURE__ */ A(Z, {
|
|
192
|
+
position: t,
|
|
193
193
|
children: _.leading
|
|
194
194
|
}) : _.leading,
|
|
195
|
-
trailing: /* @__PURE__ */ j(
|
|
195
|
+
trailing: /* @__PURE__ */ j(s, {
|
|
196
196
|
open: T,
|
|
197
197
|
onOpenChange: E,
|
|
198
|
-
children: [/* @__PURE__ */ A(
|
|
198
|
+
children: [/* @__PURE__ */ A(i, {
|
|
199
199
|
asChild: !0,
|
|
200
|
-
children: _.trailing ?? /* @__PURE__ */ A(
|
|
200
|
+
children: _.trailing ?? /* @__PURE__ */ A(h, {
|
|
201
201
|
"data-pw": `${_.name}-trailing`,
|
|
202
202
|
variant: "tonal",
|
|
203
203
|
"aria-label": typeof b == "string" ? b : void 0,
|
|
204
204
|
children: /* @__PURE__ */ A(x, {})
|
|
205
205
|
})
|
|
206
|
-
}), /* @__PURE__ */ j(
|
|
207
|
-
/* @__PURE__ */ A(
|
|
206
|
+
}), /* @__PURE__ */ j(a, { children: [
|
|
207
|
+
/* @__PURE__ */ A(r, {
|
|
208
208
|
variant: "tonal",
|
|
209
209
|
color: "primary"
|
|
210
210
|
}),
|
|
211
|
-
/* @__PURE__ */ A(
|
|
212
|
-
/* @__PURE__ */ A(
|
|
211
|
+
/* @__PURE__ */ A(c, { children: b }),
|
|
212
|
+
/* @__PURE__ */ A(o, { hidden: !0 }),
|
|
213
213
|
/* @__PURE__ */ A(J, {
|
|
214
214
|
center: D,
|
|
215
|
-
className: e(
|
|
215
|
+
className: e(f),
|
|
216
216
|
children: /* @__PURE__ */ A(Y, {
|
|
217
217
|
position: D,
|
|
218
218
|
onChange: C,
|
|
@@ -220,9 +220,9 @@ function $({ value: n, onChange: u, dialogTitle: d, closeLabel: f, mapClassName:
|
|
|
220
220
|
reference: M
|
|
221
221
|
})
|
|
222
222
|
}),
|
|
223
|
-
/* @__PURE__ */ A(
|
|
223
|
+
/* @__PURE__ */ A(n, { children: /* @__PURE__ */ A(m, {
|
|
224
224
|
onClick: N,
|
|
225
|
-
children:
|
|
225
|
+
children: d ?? y("material.location-field.confirm", "OK")
|
|
226
226
|
}) })
|
|
227
227
|
] })]
|
|
228
228
|
})
|
|
@@ -253,7 +253,7 @@ function ee({ control: e, name: t, ...n }) {
|
|
|
253
253
|
//#endregion
|
|
254
254
|
//#region lib/map/components/partials/location-marker.tsx
|
|
255
255
|
function te({ ...e }) {
|
|
256
|
-
let { t } =
|
|
256
|
+
let { t } = p(), { coords: n } = W(), r = I();
|
|
257
257
|
return T(() => {
|
|
258
258
|
n && r.flyTo([n.latitude, n.longitude], r.getZoom());
|
|
259
259
|
}, [
|
|
@@ -273,29 +273,29 @@ function te({ ...e }) {
|
|
|
273
273
|
}
|
|
274
274
|
//#endregion
|
|
275
275
|
//#region lib/map/components/partials/map-actions.tsx
|
|
276
|
-
function ne({ position:
|
|
277
|
-
let { t:
|
|
278
|
-
|
|
279
|
-
}, [
|
|
280
|
-
|
|
281
|
-
}, [
|
|
276
|
+
function ne({ position: t = "topleft", className: n, ...r }) {
|
|
277
|
+
let { t: i } = p(), a = I(), { coords: o } = W(), s = w(() => {
|
|
278
|
+
a.setView(a.getCenter(), a.getZoom() + 1, { animate: !0 });
|
|
279
|
+
}, [a]), c = w(() => {
|
|
280
|
+
a.setView(a.getCenter(), Math.max(a.getZoom() - 1, 0), { animate: !0 });
|
|
281
|
+
}, [a]);
|
|
282
282
|
return T(() => {
|
|
283
|
-
|
|
284
|
-
}, [
|
|
285
|
-
className: e(U[
|
|
283
|
+
o && a.setView([o.latitude, o.longitude], a.getZoom());
|
|
284
|
+
}, [o, a]), /* @__PURE__ */ A("div", {
|
|
285
|
+
className: e(U[t], "border-primary"),
|
|
286
286
|
children: /* @__PURE__ */ A("div", {
|
|
287
287
|
className: "leaflet-control leaflet-bar border-primary",
|
|
288
288
|
children: /* @__PURE__ */ j("div", {
|
|
289
|
-
className: e("grid gap-1 p-0.5 bg-paper rounded *:z-[300]",
|
|
290
|
-
...
|
|
291
|
-
children: [/* @__PURE__ */ A(
|
|
292
|
-
"aria-label":
|
|
293
|
-
onClick:
|
|
289
|
+
className: e("grid gap-1 p-0.5 bg-paper rounded *:z-[300]", n),
|
|
290
|
+
...r,
|
|
291
|
+
children: [/* @__PURE__ */ A(h, {
|
|
292
|
+
"aria-label": i("material.map.zoom-in", "Zoom in"),
|
|
293
|
+
onClick: s,
|
|
294
294
|
children: /* @__PURE__ */ A(C, {})
|
|
295
|
-
}), /* @__PURE__ */ A(
|
|
296
|
-
"aria-label":
|
|
297
|
-
disabled:
|
|
298
|
-
onClick:
|
|
295
|
+
}), /* @__PURE__ */ A(h, {
|
|
296
|
+
"aria-label": i("material.map.zoom-out", "Zoom out"),
|
|
297
|
+
disabled: a.getZoom() === 0,
|
|
298
|
+
onClick: c,
|
|
299
299
|
children: /* @__PURE__ */ A(S, {})
|
|
300
300
|
})]
|
|
301
301
|
})
|