@chestnutlabs/gcode-preview-element 0.13.0 → 0.15.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.
|
@@ -16,7 +16,7 @@ import type { MachineGeometry, MappedProgress, ProgressObservation } from '@ches
|
|
|
16
16
|
import type { WireParseOptions, WorkerLike } from '@chestnutlabs/gcode-parser';
|
|
17
17
|
export type GcodePreviewSource = Uint8Array | ArrayBuffer | File | null;
|
|
18
18
|
/** Advanced/test renderer injectables (pass-throughs of the controller's renderer contract). */
|
|
19
|
-
export type ElementRendererOptions = Omit<NonNullable<PreviewControllerRenderer>, 'buildVolume' | 'quality' | 'cameraMode' | 'frameContent' | 'interactionQuality' | 'theme' | 'colorMode' | 'tube'>;
|
|
19
|
+
export type ElementRendererOptions = Omit<NonNullable<PreviewControllerRenderer>, 'buildVolume' | 'quality' | 'qualityMode' | 'progressivePreview' | 'cameraMode' | 'frameContent' | 'interactionQuality' | 'theme' | 'colorMode' | 'tube'>;
|
|
20
20
|
type PreviewControllerRenderer = NonNullable<Parameters<typeof createPreviewController>[0]>['renderer'];
|
|
21
21
|
/** The default tag name (DD-009 §4.5). */
|
|
22
22
|
export declare const DEFAULT_TAG = "gcode-preview";
|
|
@@ -54,6 +54,10 @@ export declare class GcodePreviewElement extends HTMLElement {
|
|
|
54
54
|
set rendererOptions(v: ElementRendererOptions | undefined);
|
|
55
55
|
get quality(): string | null;
|
|
56
56
|
set quality(v: string | null);
|
|
57
|
+
get qualityMode(): string | null;
|
|
58
|
+
set qualityMode(v: string | null);
|
|
59
|
+
get progressivePreview(): string | null;
|
|
60
|
+
set progressivePreview(v: string | null);
|
|
57
61
|
get cameraMode(): string | null;
|
|
58
62
|
set cameraMode(v: string | null);
|
|
59
63
|
/** #306/#6: frame the printed 'object' (excl. skirt/prime) or 'all' extrusion. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gcode-preview-element.d.ts","sourceRoot":"","sources":["../src/gcode-preview-element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAElB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EACV,cAAc,EAEd,WAAW,EAEX,SAAS,EACT,KAAK,EACL,WAAW,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACxG,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE/E,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;AAExE,gGAAgG;AAChG,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,WAAW,CAAC,yBAAyB,CAAC,
|
|
1
|
+
{"version":3,"file":"gcode-preview-element.d.ts","sourceRoot":"","sources":["../src/gcode-preview-element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAElB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EACV,cAAc,EAEd,WAAW,EAEX,SAAS,EACT,KAAK,EACL,WAAW,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACxG,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE/E,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;AAEx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I,iBAAiB,CAAC,KAAK,CAAC,CAElC;IACD,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC;IAG7F,eAAe,CAAC,GAAG,EAAE,mBAAmB,GAAG,cAAc,GAAG,IAAI;IAGhE,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI;IAGlD,aAAa,IAAI,IAAI;IAGrB,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,GAAG,MAAM,IAAI;IAKlD,iBAAiB,IAAI,IAAI;IAwCzB,oBAAoB,IAAI,IAAI;IAO5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAuDvF,kGAAkG;IAClG,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,iBAAiB;IAOzB,kEAAkE;IAClE,OAAO,CAAC,MAAM;CAmDf;AASD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,GAAE,MAAoB,GAAG,IAAI,CAGlE"}
|
|
@@ -14,6 +14,8 @@ import { createPreviewController } from '@chestnutlabs/gcode-preview-core';
|
|
|
14
14
|
/** Observed scalar/boolean/number attributes; rich options are property-only. */
|
|
15
15
|
const OBSERVED = [
|
|
16
16
|
'quality',
|
|
17
|
+
'quality-mode',
|
|
18
|
+
'progressive-preview',
|
|
17
19
|
'camera-mode',
|
|
18
20
|
'frame-content',
|
|
19
21
|
'interaction-quality',
|
|
@@ -116,6 +118,18 @@ export class GcodePreviewElement extends HTMLElement {
|
|
|
116
118
|
set quality(v) {
|
|
117
119
|
this.reflect('quality', v);
|
|
118
120
|
}
|
|
121
|
+
get qualityMode() {
|
|
122
|
+
return this.getAttribute('quality-mode');
|
|
123
|
+
}
|
|
124
|
+
set qualityMode(v) {
|
|
125
|
+
this.reflect('quality-mode', v);
|
|
126
|
+
}
|
|
127
|
+
get progressivePreview() {
|
|
128
|
+
return this.getAttribute('progressive-preview');
|
|
129
|
+
}
|
|
130
|
+
set progressivePreview(v) {
|
|
131
|
+
this.reflect('progressive-preview', v);
|
|
132
|
+
}
|
|
119
133
|
get cameraMode() {
|
|
120
134
|
return this.getAttribute('camera-mode');
|
|
121
135
|
}
|
|
@@ -248,6 +262,8 @@ export class GcodePreviewElement extends HTMLElement {
|
|
|
248
262
|
mode: this.getAttribute('renderer') ?? undefined,
|
|
249
263
|
buildVolume: isMachine ? undefined : this._buildVolume,
|
|
250
264
|
quality: this.getAttribute('quality') ?? 'auto',
|
|
265
|
+
qualityMode: this.getAttribute('quality-mode') ?? undefined,
|
|
266
|
+
progressivePreview: this.getAttribute('progressive-preview') ?? undefined,
|
|
251
267
|
cameraMode: this.getAttribute('camera-mode') ?? undefined,
|
|
252
268
|
frameContent: this.getAttribute('frame-content') ?? undefined,
|
|
253
269
|
interactionQuality: this.getAttribute('interaction-quality') ?? undefined,
|
|
@@ -281,6 +297,14 @@ export class GcodePreviewElement extends HTMLElement {
|
|
|
281
297
|
case 'quality':
|
|
282
298
|
c.setQuality(value ?? 'auto');
|
|
283
299
|
break;
|
|
300
|
+
case 'quality-mode':
|
|
301
|
+
if (value !== null)
|
|
302
|
+
c.setQualityMode(value);
|
|
303
|
+
break;
|
|
304
|
+
case 'progressive-preview':
|
|
305
|
+
if (value !== null)
|
|
306
|
+
c.setProgressivePreview(value);
|
|
307
|
+
break;
|
|
284
308
|
case 'camera-mode':
|
|
285
309
|
if (value !== null)
|
|
286
310
|
c.setCameraMode(value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chestnutlabs/gcode-preview-element",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Framework-free <gcode-preview> Web Component for the Chestnut Labs G-code viewer (DD-007 D1 / DD-009 D5): a custom element bridging @chestnutlabs/gcode-preview-core, no framework peer dependency.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gcode",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"test": "vitest run"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@chestnutlabs/gcode-parser": "0.
|
|
56
|
-
"@chestnutlabs/gcode-preview-core": "0.
|
|
57
|
-
"@chestnutlabs/gcode-renderer-three": "0.
|
|
58
|
-
"@chestnutlabs/toolpath-core": "0.
|
|
55
|
+
"@chestnutlabs/gcode-parser": "0.15.0",
|
|
56
|
+
"@chestnutlabs/gcode-preview-core": "0.15.0",
|
|
57
|
+
"@chestnutlabs/gcode-renderer-three": "0.15.0",
|
|
58
|
+
"@chestnutlabs/toolpath-core": "0.15.0"
|
|
59
59
|
}
|
|
60
60
|
}
|