@toolpath/viewer 2.1.0 → 2.2.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 CHANGED
@@ -357,9 +357,9 @@ individual buttons to use only the controls and order your application needs.
357
357
  </ViewerToolbarProvider>
358
358
  ```
359
359
 
360
- `ViewerToolbar.Controls`, `Divider`, and the fourteen `*Button` components are available on
360
+ `ViewerToolbar.Controls`, `Divider`, and the fifteen `*Button` components are available on
361
361
  `ViewerToolbar`: `StockButton`, `AxesButton`, `GridButton`, `BananaButton`, `ToolsButton`, `DirectionsButton`,
362
- `HoverButton`, `FocusButton`, `WireframeButton`, `SectionButton`, `MeasureButton`, `FitButton`,
362
+ `DfmButton` (shows or hides an application's DFM flags), `HoverButton`, `FocusButton`, `WireframeButton`, `SectionButton`, `MeasureButton`, `FitButton`,
363
363
  `ResetButton`, and `TopButton`. A rendered button requires its matching provider control. For an
364
364
  application-specific toolbar component, `useViewerToolbar()` reads the same controls from inside
365
365
  the provider.
package/dist/index.d.ts CHANGED
@@ -90,6 +90,7 @@ interface ViewerToolbarControls {
90
90
  /** Tools drawn on the part: see `<ToolMarks>`. */
91
91
  tools?: ViewerToolbarControl;
92
92
  directions?: ViewerToolbarControl;
93
+ dfm?: ViewerToolbarControl;
93
94
  hover?: ViewerToolbarControl;
94
95
  focus?: ViewerToolbarControl;
95
96
  wireframe?: ViewerToolbarControl;
@@ -131,6 +132,7 @@ declare const ViewerToolbar: (({ className, children }: ViewerToolbarProps) => r
131
132
  BananaButton: () => react.JSX.Element;
132
133
  ToolsButton: () => react.JSX.Element;
133
134
  DirectionsButton: () => react.JSX.Element;
135
+ DfmButton: () => react.JSX.Element;
134
136
  HoverButton: () => react.JSX.Element;
135
137
  FocusButton: () => react.JSX.Element;
136
138
  WireframeButton: () => react.JSX.Element;
package/dist/index.js CHANGED
@@ -268,6 +268,7 @@ var GridIcon = () => /* @__PURE__ */ jsx2(SvgIcon, { children: /* @__PURE__ */ j
268
268
  var BananaIcon = () => /* @__PURE__ */ jsx2(SvgIcon, { viewBox: "0 0 576 512", fill: "currentColor", children: /* @__PURE__ */ jsx2("path", { d: "M284.2 245.6c12.99 6.929 25.35 15.14 36.08 25.8L334.5 285.6l65.75-23.47c14.75-5.265 30.18-7.849 45.81-8.389c1.154-10.73 1.764-21.38 1.764-31.87c0-118.5-81.33-221.9-119.7-221.9c-21.01 0-40.91 17.04-40.91 39.25c0 16.18 16.74 41.9 16.74 103C303.1 170.1 300.6 203.1 284.2 245.6zM575.1 389.6c0-3.687-.8637-7.429-2.687-10.93l-15.12-29.11c-21.05-40.53-63.08-64.51-106.9-64.51c-13.43 0-27.02 2.252-40.22 6.969l-84.84 30.27l-28.59-28.41C274.4 270.9 243.7 258.1 212.8 258.1c-23.72 0-47.57 6.97-68.29 21.2L106.3 306.4c-6.732 4.631-10.35 12.07-10.35 19.63c0 14.93 12.7 23.87 24.04 23.87c4.695 0 9.443-1.376 13.61-4.26l38.13-26.23c12.43-8.525 26.71-12.69 40.91-12.69c10.64 0 21.24 2.339 30.97 6.934c-50.62 62.23-128.3 99.85-211.4 99.85C14.42 413.5 0 427.8 0 445.5v31.38c0 17.68 14.66 32.02 32.46 32.02l28.98.0009c14.15 0 34.69 1.098 59.07 1.098c93.51 0 243.4-16.15 304.8-172.4c9.021-3.22 17.95-4.712 26.53-4.712c27.65 0 51.7 15.49 63.7 38.55l15.12 29.11c3.484 6.723 11.74 12.98 21.41 12.98C564.1 413.6 575.1 403.8 575.1 389.6z" }) });
269
269
  var ToolsIcon = () => /* @__PURE__ */ jsx2(SvgIcon, { children: /* @__PURE__ */ jsx2("path", { d: "M9 2h6v7H9zM9.5 9v9.5l2.5 3.5 2.5-3.5V9M9.5 12l5 2.5M9.5 15.5l5 2.5" }) });
270
270
  var DirectionsIcon = () => /* @__PURE__ */ jsx2(SvgIcon, { children: /* @__PURE__ */ jsx2("path", { d: "M7 3v18m-4-4 4 4 4-4M17 21V3m-4 4 4-4 4 4" }) });
271
+ var DfmIcon = () => /* @__PURE__ */ jsx2(SvgIcon, { children: /* @__PURE__ */ jsx2("path", { d: "M8.3 3h7.4L21 8.3v7.4L15.7 21H8.3L3 15.7V8.3zM12 7.5v5.5m0 3.5v.01" }) });
271
272
  var HoverIcon = () => /* @__PURE__ */ jsx2(SvgIcon, { children: /* @__PURE__ */ jsx2("path", { d: "M4 4h16v12H9l-5 4zm4 5h8m-8 3h5" }) });
272
273
  var FocusIcon = () => /* @__PURE__ */ jsx2(SvgIcon, { children: /* @__PURE__ */ jsx2("path", { d: "M4 4h16v16H4zM8 8h8v8H8zM2 12h4m12 0h4M12 2v4m0 12v4" }) });
273
274
  var WireframeIcon = () => /* @__PURE__ */ jsx2(SvgIcon, { children: /* @__PURE__ */ jsx2("path", { d: "M4 7l8-4 8 4v10l-8 4-8-4zM4 7l8 4 8-4M12 11v10M4 17l8-4 8 4M12 3v10" }) });
@@ -283,6 +284,7 @@ var ICONS = {
283
284
  banana: BananaIcon,
284
285
  tools: ToolsIcon,
285
286
  directions: DirectionsIcon,
287
+ dfm: DfmIcon,
286
288
  hover: HoverIcon,
287
289
  focus: FocusIcon,
288
290
  wireframe: WireframeIcon,
@@ -377,6 +379,14 @@ var DirectionsButton = () => /* @__PURE__ */ jsx3(
377
379
  label: () => "Highlight faces by direction"
378
380
  }
379
381
  );
382
+ var DfmButton = () => /* @__PURE__ */ jsx3(
383
+ ToolbarButton,
384
+ {
385
+ action: "dfm",
386
+ icon: "dfm",
387
+ label: (pressed) => pressed ? "Hide DFM flags" : "Show DFM flags"
388
+ }
389
+ );
380
390
  var HoverButton = () => /* @__PURE__ */ jsx3(
381
391
  ToolbarButton,
382
392
  {
@@ -435,6 +445,7 @@ var DefaultControls = () => {
435
445
  ].filter(Boolean);
436
446
  const analysis = [
437
447
  controls.directions ? /* @__PURE__ */ jsx3(DirectionsButton, {}, "directions") : null,
448
+ controls.dfm ? /* @__PURE__ */ jsx3(DfmButton, {}, "dfm") : null,
438
449
  controls.hover ? /* @__PURE__ */ jsx3(HoverButton, {}, "hover") : null,
439
450
  controls.focus ? /* @__PURE__ */ jsx3(FocusButton, {}, "focus") : null,
440
451
  controls.wireframe ? /* @__PURE__ */ jsx3(WireframeButton, {}, "wireframe") : null,
@@ -474,6 +485,7 @@ var ViewerToolbar = Object.assign(ViewerToolbarRoot, {
474
485
  BananaButton,
475
486
  ToolsButton,
476
487
  DirectionsButton,
488
+ DfmButton,
477
489
  HoverButton,
478
490
  FocusButton,
479
491
  WireframeButton,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolpath/viewer",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "React Three Fiber viewer for Toolpath Engine part reports",
5
5
  "license": "MIT",
6
6
  "engines": {