@chestnutlabs/gcode-preview-vue 0.1.0 → 0.3.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
|
@@ -12,7 +12,7 @@ npm install @chestnutlabs/gcode-preview-vue three
|
|
|
12
12
|
|
|
13
13
|
(`three` is a peerDependency of the renderer, supported range `^0.178.0` — npm ≥ 7 installs it
|
|
14
14
|
automatically; pnpm/yarn users add it explicitly. See the
|
|
15
|
-
[support policy](
|
|
15
|
+
[support policy](https://github.com/ChestnutLabs/gcode-preview/blob/dev/docs/reference/support-policy.md).)
|
|
16
16
|
|
|
17
17
|
Two adoption levels, one implementation (the component is a shell over the composable):
|
|
18
18
|
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
* and staying pure TypeScript keeps the package on the plain tsc build with typed props/emits.
|
|
11
11
|
*/
|
|
12
12
|
import { type PropType } from 'vue';
|
|
13
|
-
import type { BuildVolumeDef, ColorMode, QualityMode, TubeOptions } from '@chestnutlabs/gcode-renderer-three';
|
|
13
|
+
import type { BuildVolumeDef, CameraMode, ColorMode, QualityMode, Theme, TubeOptions } from '@chestnutlabs/gcode-renderer-three';
|
|
14
14
|
import type { MachineGeometry, ProgressObservation } from '@chestnutlabs/toolpath-core';
|
|
15
15
|
import type { WireParseOptions, WorkerLike } from '@chestnutlabs/gcode-parser';
|
|
16
|
-
import { type UseGcodePreviewOptions } from './use-gcode-preview.js';
|
|
16
|
+
import { type RendererMode, type UseGcodePreviewOptions } from './use-gcode-preview.js';
|
|
17
17
|
export type GcodePreviewSource = Uint8Array | ArrayBuffer | File | null;
|
|
18
18
|
export declare const GcodePreview: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
19
19
|
/** The one required-in-practice prop: bytes/File to parse. Changing it re-parses. */
|
|
@@ -25,6 +25,16 @@ export declare const GcodePreview: import("vue").DefineComponent<import("vue").E
|
|
|
25
25
|
type: PropType<WireParseOptions>;
|
|
26
26
|
default: undefined;
|
|
27
27
|
};
|
|
28
|
+
/** DD-014 D5: `'3d'` (default, Three.js — loaded on demand) or `'2d'` (low-resource Canvas view). */
|
|
29
|
+
renderer: {
|
|
30
|
+
type: PropType<RendererMode>;
|
|
31
|
+
default: undefined;
|
|
32
|
+
};
|
|
33
|
+
/** 2D only (`renderer="2d"`): preceding "ghost" layers beneath the active one (default 1, floor 0). */
|
|
34
|
+
adjacentLayers: {
|
|
35
|
+
type: PropType<number>;
|
|
36
|
+
default: undefined;
|
|
37
|
+
};
|
|
28
38
|
/** Consumer-configured volume — wins over file-discovered geometry (DD-005 precedence). */
|
|
29
39
|
buildVolume: {
|
|
30
40
|
type: PropType<BuildVolumeDef | MachineGeometry>;
|
|
@@ -34,6 +44,16 @@ export declare const GcodePreview: import("vue").DefineComponent<import("vue").E
|
|
|
34
44
|
type: PropType<QualityMode | "auto">;
|
|
35
45
|
default: string;
|
|
36
46
|
};
|
|
47
|
+
/** #150 (DD-009 D3): camera projection. */
|
|
48
|
+
cameraMode: {
|
|
49
|
+
type: PropType<CameraMode>;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
52
|
+
/** #153 (DD-009 D4): bounded declarative theme. */
|
|
53
|
+
theme: {
|
|
54
|
+
type: PropType<Theme>;
|
|
55
|
+
default: undefined;
|
|
56
|
+
};
|
|
37
57
|
colorMode: {
|
|
38
58
|
type: PropType<ColorMode>;
|
|
39
59
|
default: undefined;
|
|
@@ -52,10 +72,25 @@ export declare const GcodePreview: import("vue").DefineComponent<import("vue").E
|
|
|
52
72
|
type: PropType<number | null>;
|
|
53
73
|
default: null;
|
|
54
74
|
};
|
|
75
|
+
/** Time-based scrub cut in ms of print time (#181); null clears it. */
|
|
76
|
+
scrubTime: {
|
|
77
|
+
type: PropType<number | null>;
|
|
78
|
+
default: null;
|
|
79
|
+
};
|
|
55
80
|
showTravel: {
|
|
56
81
|
type: BooleanConstructor;
|
|
57
82
|
default: boolean;
|
|
58
83
|
};
|
|
84
|
+
/** DD-016 (#182): show slicer wipe moves. Default true. */
|
|
85
|
+
showWipe: {
|
|
86
|
+
type: BooleanConstructor;
|
|
87
|
+
default: boolean;
|
|
88
|
+
};
|
|
89
|
+
/** DD-009 D1 (#148): opt-in retraction/deretraction markers. */
|
|
90
|
+
showRetractions: {
|
|
91
|
+
type: BooleanConstructor;
|
|
92
|
+
default: boolean;
|
|
93
|
+
};
|
|
59
94
|
/** DD-006 live progress observation; null hides the overlay. */
|
|
60
95
|
progress: {
|
|
61
96
|
type: PropType<ProgressObservation | null>;
|
|
@@ -69,7 +104,7 @@ export declare const GcodePreview: import("vue").DefineComponent<import("vue").E
|
|
|
69
104
|
};
|
|
70
105
|
/** Advanced/test renderer injectables (pass-throughs of the renderer contract). */
|
|
71
106
|
rendererOptions: {
|
|
72
|
-
type: PropType<Omit<NonNullable<UseGcodePreviewOptions["renderer"]>, "buildVolume" | "quality" | "colorMode" | "tube">>;
|
|
107
|
+
type: PropType<Omit<NonNullable<UseGcodePreviewOptions["renderer"]>, "buildVolume" | "quality" | "cameraMode" | "theme" | "colorMode" | "tube">>;
|
|
73
108
|
default: undefined;
|
|
74
109
|
};
|
|
75
110
|
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
@@ -119,6 +154,16 @@ export declare const GcodePreview: import("vue").DefineComponent<import("vue").E
|
|
|
119
154
|
type: PropType<WireParseOptions>;
|
|
120
155
|
default: undefined;
|
|
121
156
|
};
|
|
157
|
+
/** DD-014 D5: `'3d'` (default, Three.js — loaded on demand) or `'2d'` (low-resource Canvas view). */
|
|
158
|
+
renderer: {
|
|
159
|
+
type: PropType<RendererMode>;
|
|
160
|
+
default: undefined;
|
|
161
|
+
};
|
|
162
|
+
/** 2D only (`renderer="2d"`): preceding "ghost" layers beneath the active one (default 1, floor 0). */
|
|
163
|
+
adjacentLayers: {
|
|
164
|
+
type: PropType<number>;
|
|
165
|
+
default: undefined;
|
|
166
|
+
};
|
|
122
167
|
/** Consumer-configured volume — wins over file-discovered geometry (DD-005 precedence). */
|
|
123
168
|
buildVolume: {
|
|
124
169
|
type: PropType<BuildVolumeDef | MachineGeometry>;
|
|
@@ -128,6 +173,16 @@ export declare const GcodePreview: import("vue").DefineComponent<import("vue").E
|
|
|
128
173
|
type: PropType<QualityMode | "auto">;
|
|
129
174
|
default: string;
|
|
130
175
|
};
|
|
176
|
+
/** #150 (DD-009 D3): camera projection. */
|
|
177
|
+
cameraMode: {
|
|
178
|
+
type: PropType<CameraMode>;
|
|
179
|
+
default: string;
|
|
180
|
+
};
|
|
181
|
+
/** #153 (DD-009 D4): bounded declarative theme. */
|
|
182
|
+
theme: {
|
|
183
|
+
type: PropType<Theme>;
|
|
184
|
+
default: undefined;
|
|
185
|
+
};
|
|
131
186
|
colorMode: {
|
|
132
187
|
type: PropType<ColorMode>;
|
|
133
188
|
default: undefined;
|
|
@@ -146,10 +201,25 @@ export declare const GcodePreview: import("vue").DefineComponent<import("vue").E
|
|
|
146
201
|
type: PropType<number | null>;
|
|
147
202
|
default: null;
|
|
148
203
|
};
|
|
204
|
+
/** Time-based scrub cut in ms of print time (#181); null clears it. */
|
|
205
|
+
scrubTime: {
|
|
206
|
+
type: PropType<number | null>;
|
|
207
|
+
default: null;
|
|
208
|
+
};
|
|
149
209
|
showTravel: {
|
|
150
210
|
type: BooleanConstructor;
|
|
151
211
|
default: boolean;
|
|
152
212
|
};
|
|
213
|
+
/** DD-016 (#182): show slicer wipe moves. Default true. */
|
|
214
|
+
showWipe: {
|
|
215
|
+
type: BooleanConstructor;
|
|
216
|
+
default: boolean;
|
|
217
|
+
};
|
|
218
|
+
/** DD-009 D1 (#148): opt-in retraction/deretraction markers. */
|
|
219
|
+
showRetractions: {
|
|
220
|
+
type: BooleanConstructor;
|
|
221
|
+
default: boolean;
|
|
222
|
+
};
|
|
153
223
|
/** DD-006 live progress observation; null hides the overlay. */
|
|
154
224
|
progress: {
|
|
155
225
|
type: PropType<ProgressObservation | null>;
|
|
@@ -163,7 +233,7 @@ export declare const GcodePreview: import("vue").DefineComponent<import("vue").E
|
|
|
163
233
|
};
|
|
164
234
|
/** Advanced/test renderer injectables (pass-throughs of the renderer contract). */
|
|
165
235
|
rendererOptions: {
|
|
166
|
-
type: PropType<Omit<NonNullable<UseGcodePreviewOptions["renderer"]>, "buildVolume" | "quality" | "colorMode" | "tube">>;
|
|
236
|
+
type: PropType<Omit<NonNullable<UseGcodePreviewOptions["renderer"]>, "buildVolume" | "quality" | "cameraMode" | "theme" | "colorMode" | "tube">>;
|
|
167
237
|
default: undefined;
|
|
168
238
|
};
|
|
169
239
|
}>> & Readonly<{
|
|
@@ -203,24 +273,36 @@ export declare const GcodePreview: import("vue").DefineComponent<import("vue").E
|
|
|
203
273
|
}) => any) | undefined;
|
|
204
274
|
}>, {
|
|
205
275
|
source: GcodePreviewSource;
|
|
276
|
+
renderer: RendererMode;
|
|
206
277
|
buildVolume: BuildVolumeDef | MachineGeometry;
|
|
207
278
|
quality: QualityMode | "auto";
|
|
279
|
+
cameraMode: CameraMode;
|
|
280
|
+
theme: Theme;
|
|
208
281
|
colorMode: ColorMode;
|
|
209
282
|
tube: TubeOptions;
|
|
283
|
+
adjacentLayers: number;
|
|
210
284
|
parseOptions: WireParseOptions;
|
|
211
285
|
layerRange: [number, number] | null;
|
|
212
286
|
scrub: number | null;
|
|
287
|
+
scrubTime: number | null;
|
|
213
288
|
showTravel: boolean;
|
|
289
|
+
showWipe: boolean;
|
|
290
|
+
showRetractions: boolean;
|
|
214
291
|
progress: ProgressObservation | null;
|
|
215
292
|
createWorker: () => WorkerLike;
|
|
216
293
|
rendererOptions: Omit<{
|
|
294
|
+
mode?: RendererMode;
|
|
217
295
|
buildVolume?: BuildVolumeDef;
|
|
218
296
|
quality?: QualityMode | "auto";
|
|
297
|
+
cameraMode?: CameraMode;
|
|
219
298
|
colorMode?: ColorMode;
|
|
220
299
|
tube?: TubeOptions;
|
|
300
|
+
theme?: Theme;
|
|
301
|
+
adjacentLayers?: number;
|
|
302
|
+
ghostOpacity?: number;
|
|
221
303
|
createRenderer?: (canvas: import("@chestnutlabs/gcode-renderer-three").RenderTargetCanvas) => import("@chestnutlabs/gcode-renderer-three").GLRendererLike;
|
|
222
304
|
scheduleFrame?: (cb: () => void) => void;
|
|
223
305
|
chunksPerTick?: number;
|
|
224
|
-
}, "buildVolume" | "quality" | "colorMode" | "tube">;
|
|
306
|
+
}, "buildVolume" | "quality" | "cameraMode" | "theme" | "colorMode" | "tube">;
|
|
225
307
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
226
308
|
//# sourceMappingURL=gcode-preview-component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gcode-preview-component.d.ts","sourceRoot":"","sources":["../src/gcode-preview-component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAA6C,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC/E,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"gcode-preview-component.d.ts","sourceRoot":"","sources":["../src/gcode-preview-component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAA6C,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC/E,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,SAAS,EACT,WAAW,EACX,KAAK,EACL,WAAW,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC5B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;AAExE,eAAO,MAAM,YAAY;IAGrB,qFAAqF;;cA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AM,UAAU,CAAC;;;IAG9C,mFAAmF;;cAEjE,QAAQ,CACtB,IAAI,CACF,WAAW,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC,EAC/C,aAAa,GAAG,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,CAC1E,CACF;;;;;;cAgBiB,MAAM;iBAAW,MAAM;;;kBAVb,MAAM;gBAAU,MAAM;kBAAY,OAAO;;;cAC3C,MAAM;iBAAW,MAAM;;;;wBAEV,MAAM;oBAAc,MAAM;;;kBAChC,MAAM;iBAAW,WAAW;;;cAC9B,WAAW;YAAM,WAAW;gBAAU,MAAM;;;;;cAG/B,MAAM;iBAAW,MAAM;;;;;;;;;;;;;;;;;;;;wBAxBlC,UAAU;;;;;;;;;;;;;;;4EAgL/C,CAAC"}
|
|
@@ -17,16 +17,30 @@ export const GcodePreview = defineComponent({
|
|
|
17
17
|
/** The one required-in-practice prop: bytes/File to parse. Changing it re-parses. */
|
|
18
18
|
source: { type: [Object, Uint8Array, ArrayBuffer, File], default: null },
|
|
19
19
|
parseOptions: { type: Object, default: undefined },
|
|
20
|
+
/** DD-014 D5: `'3d'` (default, Three.js — loaded on demand) or `'2d'` (low-resource Canvas view). */
|
|
21
|
+
renderer: { type: String, default: undefined },
|
|
22
|
+
/** 2D only (`renderer="2d"`): preceding "ghost" layers beneath the active one (default 1, floor 0). */
|
|
23
|
+
adjacentLayers: { type: Number, default: undefined },
|
|
20
24
|
/** Consumer-configured volume — wins over file-discovered geometry (DD-005 precedence). */
|
|
21
25
|
buildVolume: { type: Object, default: undefined },
|
|
22
26
|
quality: { type: String, default: 'auto' },
|
|
27
|
+
/** #150 (DD-009 D3): camera projection. */
|
|
28
|
+
cameraMode: { type: String, default: 'perspective' },
|
|
29
|
+
/** #153 (DD-009 D4): bounded declarative theme. */
|
|
30
|
+
theme: { type: Object, default: undefined },
|
|
23
31
|
colorMode: { type: Object, default: undefined },
|
|
24
32
|
tube: { type: Object, default: undefined },
|
|
25
33
|
/** Inclusive [start, end]; null shows every layer. */
|
|
26
34
|
layerRange: { type: Array, default: null },
|
|
27
35
|
/** Scrub cut (IR segment index); null shows everything up to the layer range. */
|
|
28
36
|
scrub: { type: Number, default: null },
|
|
37
|
+
/** Time-based scrub cut in ms of print time (#181); null clears it. */
|
|
38
|
+
scrubTime: { type: Number, default: null },
|
|
29
39
|
showTravel: { type: Boolean, default: true },
|
|
40
|
+
/** DD-016 (#182): show slicer wipe moves. Default true. */
|
|
41
|
+
showWipe: { type: Boolean, default: true },
|
|
42
|
+
/** DD-009 D1 (#148): opt-in retraction/deretraction markers. */
|
|
43
|
+
showRetractions: { type: Boolean, default: false },
|
|
30
44
|
/** DD-006 live progress observation; null hides the overlay. */
|
|
31
45
|
progress: { type: Object, default: null },
|
|
32
46
|
/** Worker factory escape hatch (DD-005 slim/custom entries; D2). Factory form only —
|
|
@@ -60,10 +74,14 @@ export const GcodePreview = defineComponent({
|
|
|
60
74
|
const preview = useGcodePreview({
|
|
61
75
|
createWorker: props.createWorker,
|
|
62
76
|
renderer: {
|
|
77
|
+
mode: props.renderer,
|
|
63
78
|
buildVolume: 'bed' in (props.buildVolume ?? {}) ? undefined : props.buildVolume,
|
|
64
79
|
quality: props.quality,
|
|
80
|
+
cameraMode: props.cameraMode,
|
|
81
|
+
theme: props.theme,
|
|
65
82
|
colorMode: props.colorMode,
|
|
66
83
|
tube: props.tube,
|
|
84
|
+
adjacentLayers: props.adjacentLayers,
|
|
67
85
|
...props.rendererOptions
|
|
68
86
|
},
|
|
69
87
|
parseDefaults: props.parseOptions
|
|
@@ -123,12 +141,20 @@ export const GcodePreview = defineComponent({
|
|
|
123
141
|
preview.controls.setLayerRange(range[0], range[1]);
|
|
124
142
|
});
|
|
125
143
|
watch(() => props.scrub, (scrub) => preview.controls.setScrubPosition(scrub));
|
|
144
|
+
watch(() => props.scrubTime, (t) => preview.controls.setScrubTime(t));
|
|
126
145
|
watch(() => props.showTravel, (visible) => preview.controls.setKindVisible('travel', visible));
|
|
146
|
+
watch(() => props.showWipe, (visible) => preview.controls.setKindVisible('wipe', visible));
|
|
147
|
+
watch(() => props.showRetractions, (visible) => preview.controls.setShowRetractions(visible));
|
|
127
148
|
watch(() => props.colorMode, (mode) => {
|
|
128
149
|
if (mode !== undefined)
|
|
129
150
|
preview.controls.setColorMode(mode);
|
|
130
151
|
});
|
|
131
152
|
watch(() => props.quality, (quality) => preview.controls.setQuality(quality));
|
|
153
|
+
watch(() => props.cameraMode, (mode) => preview.controls.setCameraMode(mode));
|
|
154
|
+
watch(() => props.theme, (theme) => {
|
|
155
|
+
if (theme !== undefined)
|
|
156
|
+
preview.controls.setTheme(theme);
|
|
157
|
+
}, { deep: true });
|
|
132
158
|
watch(() => props.buildVolume, (volume) => {
|
|
133
159
|
if (volume !== undefined)
|
|
134
160
|
preview.controls.setBuildVolume(volume);
|
|
@@ -9,10 +9,9 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { type Ref } from 'vue';
|
|
11
11
|
import type { GcodeParseSession, WireParseOptions } from '@chestnutlabs/gcode-parser';
|
|
12
|
-
import type { ToolpathRenderer } from '@chestnutlabs/gcode-renderer-three';
|
|
13
12
|
import type { MappedProgress, ProgressObservation } from '@chestnutlabs/toolpath-core';
|
|
14
|
-
import { type GcodePreviewControls, type GcodePreviewState, type ParseOutcome, type PreviewControllerOptions, type PreviewEvent } from '@chestnutlabs/gcode-preview-core';
|
|
15
|
-
export type { GcodePreviewControls, GcodePreviewState, ParseOutcome, PreviewEvent } from '@chestnutlabs/gcode-preview-core';
|
|
13
|
+
import { type GcodePreviewControls, type GcodePreviewState, type ParseOutcome, type PreviewControllerOptions, type PreviewEvent, type PreviewRenderer } from '@chestnutlabs/gcode-preview-core';
|
|
14
|
+
export type { GcodePreviewControls, GcodePreviewState, ParseOutcome, PreviewEvent, PreviewRenderer, RendererMode } from '@chestnutlabs/gcode-preview-core';
|
|
16
15
|
/** Vue-facing options — identical to the controller's (the alias is the public name). */
|
|
17
16
|
export type UseGcodePreviewOptions = PreviewControllerOptions;
|
|
18
17
|
export interface GcodePreviewHandle {
|
|
@@ -30,7 +29,7 @@ export interface GcodePreviewHandle {
|
|
|
30
29
|
/** Escape hatches — the neutral objects themselves (advanced use; not reactive). */
|
|
31
30
|
raw: {
|
|
32
31
|
session: GcodeParseSession;
|
|
33
|
-
renderer: () =>
|
|
32
|
+
renderer: () => PreviewRenderer | null;
|
|
34
33
|
};
|
|
35
34
|
onEvent(cb: (e: PreviewEvent) => void): () => void;
|
|
36
35
|
dispose(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-gcode-preview.d.ts","sourceRoot":"","sources":["../src/use-gcode-preview.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAA0E,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AACvG,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"use-gcode-preview.d.ts","sourceRoot":"","sources":["../src/use-gcode-preview.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAA0E,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AACvG,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EACjB,KAAK,eAAe,EACrB,MAAM,kCAAkC,CAAC;AAG1C,YAAY,EACV,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,YAAY,EACb,MAAM,kCAAkC,CAAC;AAE1C,yFAAyF;AACzF,MAAM,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAE9D,MAAM,WAAW,kBAAkB;IACjC,+EAA+E;IAC/E,SAAS,EAAE,GAAG,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IACzC,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC9F,MAAM,IAAI,IAAI,CAAC;IACf,yFAAyF;IACzF,eAAe,CAAC,GAAG,EAAE,mBAAmB,GAAG,cAAc,GAAG,IAAI,CAAC;IACjE,wFAAwF;IACxF,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAAC;IACnD,aAAa,IAAI,IAAI,CAAC;IACtB,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACnC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,oFAAoF;IACpF,GAAG,EAAE;QAAE,OAAO,EAAE,iBAAiB,CAAC;QAAC,QAAQ,EAAE,MAAM,eAAe,GAAG,IAAI,CAAA;KAAE,CAAC;IAC5E,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACnD,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,kBAAkB,CAiCxF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chestnutlabs/gcode-preview-vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Thin Vue 3 integration for the Chestnut Labs G-code viewer (DD-007): useGcodePreview composable + GcodePreview component over the framework-neutral parser/renderer/progress packages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gcode",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"test": "vitest run"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@chestnutlabs/gcode-parser": "0.
|
|
54
|
-
"@chestnutlabs/gcode-renderer-three": "0.
|
|
55
|
-
"@chestnutlabs/toolpath-core": "0.
|
|
56
|
-
"@chestnutlabs/gcode-preview-core": "0.
|
|
53
|
+
"@chestnutlabs/gcode-parser": "0.3.0",
|
|
54
|
+
"@chestnutlabs/gcode-renderer-three": "0.3.0",
|
|
55
|
+
"@chestnutlabs/toolpath-core": "0.3.0",
|
|
56
|
+
"@chestnutlabs/gcode-preview-core": "0.3.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"vue": "^3.4.0"
|