@layoutit/polycss 0.2.0 → 0.2.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/README.md +147 -148
- package/dist/{PolySelectElement-Tvsmhx2m.d.cts → PolyShapeElements-prI_DBZX.d.cts} +234 -104
- package/dist/{PolySelectElement-Tvsmhx2m.d.ts → PolyShapeElements-prI_DBZX.d.ts} +234 -104
- package/dist/elements.cjs +73 -17
- package/dist/elements.d.cts +1 -1
- package/dist/elements.d.ts +1 -1
- package/dist/elements.js +73 -17
- package/dist/index.cjs +73 -17
- package/dist/index.d.cts +126 -5
- package/dist/index.d.ts +126 -5
- package/dist/index.js +73 -17
- package/package.json +3 -3
|
@@ -1,13 +1,50 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CameraHandle, Vec3, Polygon, MeshResolution, ParseResult, PolyDirectionalLight, PolyAmbientLight, PolyTextureLightingMode, TextureQuality, PolySeamBleed, PolyRenderStrategiesOption } from '@layoutit/polycss-core';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
interface PolyCameraOptions {
|
|
4
|
+
zoom?: number;
|
|
5
|
+
target?: Vec3;
|
|
6
|
+
rotX?: number;
|
|
7
|
+
rotY?: number;
|
|
8
|
+
/** Camera pull-back in CSS pixels (dolly). Default 0. */
|
|
9
|
+
distance?: number;
|
|
10
|
+
}
|
|
11
|
+
interface PolyPerspectiveCameraOptions extends PolyCameraOptions {
|
|
12
|
+
/** CSS perspective distance in pixels. Default 8000. */
|
|
13
|
+
perspective?: number;
|
|
10
14
|
}
|
|
15
|
+
interface PolyOrthographicCameraOptions extends PolyCameraOptions {
|
|
16
|
+
}
|
|
17
|
+
/** Extends CameraHandle with projection info for the container element. */
|
|
18
|
+
interface PolyPerspectiveCameraHandle extends CameraHandle {
|
|
19
|
+
readonly type: "perspective";
|
|
20
|
+
/** CSS `perspective` value to set on the camera container element. */
|
|
21
|
+
readonly perspectiveStyle: string;
|
|
22
|
+
}
|
|
23
|
+
interface PolyOrthographicCameraHandle extends CameraHandle {
|
|
24
|
+
readonly type: "orthographic";
|
|
25
|
+
/** CSS `perspective` value to set on the camera container element ("none"). */
|
|
26
|
+
readonly perspectiveStyle: "none";
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Creates a perspective camera handle. The `perspectiveStyle` property
|
|
30
|
+
* returns the CSS value to apply to the camera container's `perspective`
|
|
31
|
+
* property (default `"8000px"`).
|
|
32
|
+
*/
|
|
33
|
+
declare function createPolyPerspectiveCamera(options?: PolyPerspectiveCameraOptions): PolyPerspectiveCameraHandle;
|
|
34
|
+
/**
|
|
35
|
+
* Creates an orthographic camera handle. The `perspectiveStyle` property
|
|
36
|
+
* returns `"none"` — pass it to the container element's CSS `perspective`
|
|
37
|
+
* to disable perspective projection.
|
|
38
|
+
*/
|
|
39
|
+
declare function createPolyOrthographicCamera(options?: PolyOrthographicCameraOptions): PolyOrthographicCameraHandle;
|
|
40
|
+
/**
|
|
41
|
+
* Ergonomic alias for `createPolyOrthographicCamera`. The default camera in
|
|
42
|
+
* PolyCSS is orthographic because the engine's structural advantages
|
|
43
|
+
* (integer-pixel atlas slicing, DOM-as-render-tree) are most visible in
|
|
44
|
+
* iso/voxel/diagrammatic scenes. Use `createPolyPerspectiveCamera` explicitly
|
|
45
|
+
* when depth foreshortening is needed.
|
|
46
|
+
*/
|
|
47
|
+
declare const createPolyCamera: typeof createPolyOrthographicCamera;
|
|
11
48
|
|
|
12
49
|
/**
|
|
13
50
|
* createPolyScene — imperative scene API. The vanilla counterpart to
|
|
@@ -32,27 +69,12 @@ interface PolyRenderStrategiesOption {
|
|
|
32
69
|
*/
|
|
33
70
|
|
|
34
71
|
interface PolySceneOptions {
|
|
35
|
-
perspective?: number | false;
|
|
36
|
-
rotX?: number;
|
|
37
|
-
rotY?: number;
|
|
38
|
-
zoom?: number;
|
|
39
72
|
/**
|
|
40
|
-
* Camera
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* `distance` field in core's `CameraState`. Default: 0 (no dolly offset).
|
|
73
|
+
* Camera handle created by `createPolyCamera`, `createPolyOrthographicCamera`,
|
|
74
|
+
* or `createPolyPerspectiveCamera`. Required — `createPolyScene` will throw if
|
|
75
|
+
* this field is missing.
|
|
44
76
|
*/
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* World-coordinate camera target — the world point that appears at the
|
|
48
|
-
* viewport centre. Matches React's `CameraState.target`. Defaults to
|
|
49
|
-
* `[0, 0, 0]` so existing scenes that don't set it keep working.
|
|
50
|
-
*
|
|
51
|
-
* Internally encoded as the innermost translate in the scene transform:
|
|
52
|
-
* `scale(zoom) rotateX(rotX) rotate(rotY) translate3d(-ty*tile, -tx*tile, -tz*tile)`
|
|
53
|
-
* (world→CSS axis swap: world-X→CSS-Y, world-Y→CSS-X, world-Z→CSS-Z).
|
|
54
|
-
*/
|
|
55
|
-
target?: Vec3;
|
|
77
|
+
camera: PolyPerspectiveCameraHandle | PolyOrthographicCameraHandle;
|
|
56
78
|
directionalLight?: PolyDirectionalLight;
|
|
57
79
|
ambientLight?: PolyAmbientLight;
|
|
58
80
|
/** Textured polygon lighting mode. Defaults to "baked". */
|
|
@@ -62,6 +84,8 @@ interface PolySceneOptions {
|
|
|
62
84
|
* desktop/mobile sprite sizing. Numeric values 0.1..1 force an explicit
|
|
63
85
|
* raster scale and the 64px sprite. */
|
|
64
86
|
textureQuality?: TextureQuality;
|
|
87
|
+
/** Solid seam overscan. `"auto"` computes a fitted per-edge amount from the polygon plan. */
|
|
88
|
+
seamBleed?: PolySeamBleed;
|
|
65
89
|
/**
|
|
66
90
|
* Skip specific render-strategy tags. Polygons that would normally use a
|
|
67
91
|
* disabled tag fall through the chain (b → i → s, u → i → s, i → s).
|
|
@@ -76,9 +100,11 @@ interface PolySceneOptions {
|
|
|
76
100
|
*/
|
|
77
101
|
autoCenter?: boolean;
|
|
78
102
|
/**
|
|
79
|
-
* Shadow appearance for meshes with `castShadow: true`.
|
|
80
|
-
*
|
|
81
|
-
*
|
|
103
|
+
* Shadow appearance for meshes with `castShadow: true`. Works in both
|
|
104
|
+
* lighting modes — dynamic mode projects via CSS vars so shadows
|
|
105
|
+
* follow a moving light, baked mode CPU-bakes the projection into
|
|
106
|
+
* each leaf's inline `matrix3d` and drops back-facing polys from the
|
|
107
|
+
* DOM entirely. Defaults: `{ color: "#000000", opacity: 0.25, lift: 0.05, maxExtend: 2000 }`.
|
|
82
108
|
*/
|
|
83
109
|
shadow?: {
|
|
84
110
|
/** Shadow color as a CSS hex string. Default: `"#000000"`. */
|
|
@@ -92,6 +118,18 @@ interface PolySceneOptions {
|
|
|
92
118
|
* shadow. In world units. Default: `0.05`.
|
|
93
119
|
*/
|
|
94
120
|
lift?: number;
|
|
121
|
+
/**
|
|
122
|
+
* Maximum CSS pixels the shadow may extend beyond the mesh's
|
|
123
|
+
* footprint (the no-shear silhouette directly under the mesh). The
|
|
124
|
+
* footprint area is always preserved; only the sheared tail at low
|
|
125
|
+
* light elevations is truncated. Default: `2000`.
|
|
126
|
+
*
|
|
127
|
+
* **Trade-off:** larger values give longer shadows but the SVG
|
|
128
|
+
* backing store grows quadratically with this value, which can
|
|
129
|
+
* cause repaint flicker at extreme low-elevation angles. Pass a
|
|
130
|
+
* very large number (e.g. `Infinity`) to disable the cap entirely.
|
|
131
|
+
*/
|
|
132
|
+
maxExtend?: number;
|
|
95
133
|
};
|
|
96
134
|
}
|
|
97
135
|
interface PolyMeshTransform {
|
|
@@ -108,6 +146,12 @@ interface PolyMeshTransform {
|
|
|
108
146
|
* triangle topology must remain stable from frame to frame.
|
|
109
147
|
*/
|
|
110
148
|
merge?: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Mesh optimization intent. Defaults to `"lossy"` (bounded geometric
|
|
151
|
+
* approximation when it reduces polygon count). Set `"lossless"` to preserve
|
|
152
|
+
* the authored surface — only exact coplanar merges are applied.
|
|
153
|
+
*/
|
|
154
|
+
meshResolution?: MeshResolution;
|
|
111
155
|
/**
|
|
112
156
|
* Keep polygon leaf DOM nodes stable across setPolygons() calls when the
|
|
113
157
|
* mesh topology is unchanged. Intended for animated/deforming meshes.
|
|
@@ -120,14 +164,22 @@ interface PolyMeshTransform {
|
|
|
120
164
|
*/
|
|
121
165
|
excludeFromAutoCenter?: boolean;
|
|
122
166
|
/**
|
|
123
|
-
* When `true
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* via `calc()` when the light vars change. Defaults to `false`.
|
|
167
|
+
* When `true`, this mesh casts a shadow onto the scene's shadow ground
|
|
168
|
+
* plane (and onto any meshes marked `receiveShadow: true`). The shadow
|
|
169
|
+
* emits as one per-mesh `<svg>` whose path is the union of every
|
|
170
|
+
* casting polygon's projection. Works in both lighting modes.
|
|
171
|
+
* Defaults to `false`.
|
|
129
172
|
*/
|
|
130
173
|
castShadow?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* **(experimental)** When `true`, this mesh acts as a shadow receiver:
|
|
176
|
+
* each of its polygon faces becomes a target plane that casting meshes'
|
|
177
|
+
* shadows project onto and get clipped to. Useful for "shadow on table"
|
|
178
|
+
* scenarios. Currently only convex face outlines clip cleanly. When no
|
|
179
|
+
* receivers are present the global ground plane is used as today.
|
|
180
|
+
* Defaults to `false`.
|
|
181
|
+
*/
|
|
182
|
+
receiveShadow?: boolean;
|
|
131
183
|
}
|
|
132
184
|
interface PolyMeshHandle {
|
|
133
185
|
/** The polygons that were loaded after normalization and automatic merge. */
|
|
@@ -196,8 +248,8 @@ interface PolyMeshHandle {
|
|
|
196
248
|
interface PolySceneHandle {
|
|
197
249
|
/** Add a mesh to the scene. Returns a handle for later removal. */
|
|
198
250
|
add(mesh: ParseResult, opts?: PolyMeshTransform): PolyMeshHandle;
|
|
199
|
-
/** Update scene-level config (
|
|
200
|
-
setOptions(partial: Partial<PolySceneOptions
|
|
251
|
+
/** Update scene-level config (lighting, autoCenter, strategies, etc.). Camera state is on `scene.camera`. */
|
|
252
|
+
setOptions(partial: Partial<Omit<PolySceneOptions, "camera">>): void;
|
|
201
253
|
/** Tear down the scene; revokes all blob URLs of registered meshes. */
|
|
202
254
|
destroy(): void;
|
|
203
255
|
/**
|
|
@@ -207,13 +259,30 @@ interface PolySceneHandle {
|
|
|
207
259
|
*/
|
|
208
260
|
readonly host: HTMLElement;
|
|
209
261
|
/**
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
|
|
262
|
+
* The `.polycss-camera` wrapper element created by `createPolyScene` between
|
|
263
|
+
* the host and the `.polycss-scene` element. Carries the CSS `perspective`
|
|
264
|
+
* that matches React/Vue's `<div class="polycss-camera">` wrapper shape.
|
|
265
|
+
* FPV controls toggle `.polycss-fpv-host` on this element.
|
|
266
|
+
*/
|
|
267
|
+
readonly cameraEl: HTMLElement;
|
|
268
|
+
/**
|
|
269
|
+
* The camera handle this scene is bound to. Controls update camera state
|
|
270
|
+
* via `scene.camera.update({...})` then call `scene.applyCamera()` to
|
|
271
|
+
* re-apply the transform.
|
|
215
272
|
*/
|
|
216
|
-
|
|
273
|
+
readonly camera: PolyPerspectiveCameraHandle | PolyOrthographicCameraHandle;
|
|
274
|
+
/**
|
|
275
|
+
* Re-applies the scene transform from the current camera state. Call this
|
|
276
|
+
* after mutating `scene.camera.update({...})` to make the change visible.
|
|
277
|
+
* Controls call this once per interaction event after updating camera state.
|
|
278
|
+
*/
|
|
279
|
+
applyCamera(): void;
|
|
280
|
+
/**
|
|
281
|
+
* Snapshot of the current non-camera scene options (lighting, autoCenter,
|
|
282
|
+
* textureQuality, strategies, shadow). Returned by reference — treat as
|
|
283
|
+
* read-only; use `setOptions` to update.
|
|
284
|
+
*/
|
|
285
|
+
getOptions(): Readonly<Omit<PolySceneOptions, "camera">>;
|
|
217
286
|
/** Snapshot of mesh handles currently in the scene (insertion order).
|
|
218
287
|
* Used by selection helpers to enumerate hit-test candidates. */
|
|
219
288
|
meshes(): readonly PolyMeshHandle[];
|
|
@@ -221,65 +290,30 @@ interface PolySceneHandle {
|
|
|
221
290
|
* the element doesn't belong to this scene. */
|
|
222
291
|
findMeshByElement(element: Element | null): PolyMeshHandle | null;
|
|
223
292
|
}
|
|
224
|
-
declare function createPolyScene(host: HTMLElement, options
|
|
225
|
-
|
|
226
|
-
interface PolyCameraOptions {
|
|
227
|
-
zoom?: number;
|
|
228
|
-
target?: Vec3;
|
|
229
|
-
rotX?: number;
|
|
230
|
-
rotY?: number;
|
|
231
|
-
/** Camera pull-back in CSS pixels (dolly). Default 0. */
|
|
232
|
-
distance?: number;
|
|
233
|
-
}
|
|
234
|
-
interface PolyPerspectiveCameraOptions extends PolyCameraOptions {
|
|
235
|
-
/** CSS perspective distance in pixels. Default 8000. */
|
|
236
|
-
perspective?: number;
|
|
237
|
-
}
|
|
238
|
-
interface PolyOrthographicCameraOptions extends PolyCameraOptions {
|
|
239
|
-
}
|
|
240
|
-
/** Extends CameraHandle with projection info for the container element. */
|
|
241
|
-
interface PolyPerspectiveCameraHandle extends CameraHandle {
|
|
242
|
-
readonly type: "perspective";
|
|
243
|
-
/** CSS `perspective` value to set on the camera container element. */
|
|
244
|
-
readonly perspectiveStyle: string;
|
|
245
|
-
}
|
|
246
|
-
interface PolyOrthographicCameraHandle extends CameraHandle {
|
|
247
|
-
readonly type: "orthographic";
|
|
248
|
-
/** CSS `perspective` value to set on the camera container element ("none"). */
|
|
249
|
-
readonly perspectiveStyle: "none";
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Creates a perspective camera handle. The `perspectiveStyle` property
|
|
253
|
-
* returns the CSS value to apply to the camera container's `perspective`
|
|
254
|
-
* property (default `"8000px"`).
|
|
255
|
-
*/
|
|
256
|
-
declare function createPolyPerspectiveCamera(options?: PolyPerspectiveCameraOptions): PolyPerspectiveCameraHandle;
|
|
257
|
-
/**
|
|
258
|
-
* Creates an orthographic camera handle. The `perspectiveStyle` property
|
|
259
|
-
* returns `"none"` — pass it to the container element's CSS `perspective`
|
|
260
|
-
* to disable perspective projection.
|
|
261
|
-
*/
|
|
262
|
-
declare function createPolyOrthographicCamera(options?: PolyOrthographicCameraOptions): PolyOrthographicCameraHandle;
|
|
293
|
+
declare function createPolyScene(host: HTMLElement, options: PolySceneOptions): PolySceneHandle;
|
|
263
294
|
|
|
264
|
-
declare const ELEMENT_BASE$
|
|
265
|
-
declare class PolySceneElement extends ELEMENT_BASE$
|
|
295
|
+
declare const ELEMENT_BASE$a: typeof HTMLElement;
|
|
296
|
+
declare class PolySceneElement extends ELEMENT_BASE$a {
|
|
266
297
|
static get observedAttributes(): string[];
|
|
267
298
|
private _scene;
|
|
299
|
+
private _implicitCamera;
|
|
268
300
|
/**
|
|
269
301
|
* Returns the underlying PolySceneHandle. Children call this during their own
|
|
270
302
|
* connectedCallback to register meshes.
|
|
271
303
|
*/
|
|
272
304
|
getScene(): PolySceneHandle | null;
|
|
273
|
-
private
|
|
305
|
+
private _findAncestorCamera;
|
|
306
|
+
private _buildImplicitCamera;
|
|
307
|
+
private _readNonCameraOptions;
|
|
274
308
|
private _readDirectionalLight;
|
|
275
309
|
private _readAmbientLight;
|
|
276
310
|
connectedCallback(): void;
|
|
277
311
|
disconnectedCallback(): void;
|
|
278
|
-
attributeChangedCallback(
|
|
312
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
279
313
|
}
|
|
280
314
|
|
|
281
|
-
declare const ELEMENT_BASE$
|
|
282
|
-
declare class PolyMeshElement extends ELEMENT_BASE$
|
|
315
|
+
declare const ELEMENT_BASE$9: typeof HTMLElement;
|
|
316
|
+
declare class PolyMeshElement extends ELEMENT_BASE$9 {
|
|
283
317
|
static get observedAttributes(): string[];
|
|
284
318
|
private _handle;
|
|
285
319
|
private _parseResult;
|
|
@@ -293,8 +327,8 @@ declare class PolyMeshElement extends ELEMENT_BASE$7 {
|
|
|
293
327
|
private _maybeLoad;
|
|
294
328
|
}
|
|
295
329
|
|
|
296
|
-
declare const ELEMENT_BASE$
|
|
297
|
-
declare class PolyPolygonElement extends ELEMENT_BASE$
|
|
330
|
+
declare const ELEMENT_BASE$8: typeof HTMLElement;
|
|
331
|
+
declare class PolyPolygonElement extends ELEMENT_BASE$8 {
|
|
298
332
|
static get observedAttributes(): string[];
|
|
299
333
|
private _handle;
|
|
300
334
|
connectedCallback(): void;
|
|
@@ -304,8 +338,8 @@ declare class PolyPolygonElement extends ELEMENT_BASE$6 {
|
|
|
304
338
|
private _mount;
|
|
305
339
|
}
|
|
306
340
|
|
|
307
|
-
declare const ELEMENT_BASE$
|
|
308
|
-
declare class PolyOrbitControlsElement extends ELEMENT_BASE$
|
|
341
|
+
declare const ELEMENT_BASE$7: typeof HTMLElement;
|
|
342
|
+
declare class PolyOrbitControlsElement extends ELEMENT_BASE$7 {
|
|
309
343
|
static get observedAttributes(): string[];
|
|
310
344
|
private _controls;
|
|
311
345
|
private _readAnimate;
|
|
@@ -317,8 +351,8 @@ declare class PolyOrbitControlsElement extends ELEMENT_BASE$5 {
|
|
|
317
351
|
attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void;
|
|
318
352
|
}
|
|
319
353
|
|
|
320
|
-
declare const ELEMENT_BASE$
|
|
321
|
-
declare class PolyMapControlsElement extends ELEMENT_BASE$
|
|
354
|
+
declare const ELEMENT_BASE$6: typeof HTMLElement;
|
|
355
|
+
declare class PolyMapControlsElement extends ELEMENT_BASE$6 {
|
|
322
356
|
static get observedAttributes(): string[];
|
|
323
357
|
private _controls;
|
|
324
358
|
private _readAnimate;
|
|
@@ -330,6 +364,18 @@ declare class PolyMapControlsElement extends ELEMENT_BASE$4 {
|
|
|
330
364
|
attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void;
|
|
331
365
|
}
|
|
332
366
|
|
|
367
|
+
declare const ELEMENT_BASE$5: typeof HTMLElement;
|
|
368
|
+
declare class PolyFirstPersonControlsElement extends ELEMENT_BASE$5 {
|
|
369
|
+
static get observedAttributes(): string[];
|
|
370
|
+
private _controls;
|
|
371
|
+
private _readOptions;
|
|
372
|
+
private _findScene;
|
|
373
|
+
private _attach;
|
|
374
|
+
connectedCallback(): void;
|
|
375
|
+
disconnectedCallback(): void;
|
|
376
|
+
attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void;
|
|
377
|
+
}
|
|
378
|
+
|
|
333
379
|
/**
|
|
334
380
|
* <poly-perspective-camera> — standalone perspective camera element.
|
|
335
381
|
*
|
|
@@ -347,8 +393,8 @@ declare class PolyMapControlsElement extends ELEMENT_BASE$4 {
|
|
|
347
393
|
* distance — number, camera pull-back in CSS pixels
|
|
348
394
|
*/
|
|
349
395
|
|
|
350
|
-
declare const ELEMENT_BASE$
|
|
351
|
-
declare class PolyPerspectiveCameraElement extends ELEMENT_BASE$
|
|
396
|
+
declare const ELEMENT_BASE$4: typeof HTMLElement;
|
|
397
|
+
declare class PolyPerspectiveCameraElement extends ELEMENT_BASE$4 {
|
|
352
398
|
static get observedAttributes(): string[];
|
|
353
399
|
private _camera;
|
|
354
400
|
private _wrapper;
|
|
@@ -376,8 +422,8 @@ declare class PolyPerspectiveCameraElement extends ELEMENT_BASE$3 {
|
|
|
376
422
|
* distance — number, camera pull-back in CSS pixels
|
|
377
423
|
*/
|
|
378
424
|
|
|
379
|
-
declare const ELEMENT_BASE$
|
|
380
|
-
declare class PolyOrthographicCameraElement extends ELEMENT_BASE$
|
|
425
|
+
declare const ELEMENT_BASE$3: typeof HTMLElement;
|
|
426
|
+
declare class PolyOrthographicCameraElement extends ELEMENT_BASE$3 {
|
|
381
427
|
static get observedAttributes(): string[];
|
|
382
428
|
private _camera;
|
|
383
429
|
private _wrapper;
|
|
@@ -391,8 +437,21 @@ declare class PolyOrthographicCameraElement extends ELEMENT_BASE$2 {
|
|
|
391
437
|
attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void;
|
|
392
438
|
}
|
|
393
439
|
|
|
394
|
-
|
|
395
|
-
|
|
440
|
+
/**
|
|
441
|
+
* <poly-camera> — ergonomic alias for <poly-orthographic-camera>.
|
|
442
|
+
*
|
|
443
|
+
* The default camera in PolyCSS is orthographic. `<poly-camera>` maps to
|
|
444
|
+
* `PolyOrthographicCameraElement` so the canonical tree shape works without
|
|
445
|
+
* spelling out "orthographic" when it isn't relevant to the scene being built.
|
|
446
|
+
*
|
|
447
|
+
* Use <poly-perspective-camera> when depth foreshortening is needed.
|
|
448
|
+
*/
|
|
449
|
+
|
|
450
|
+
declare class PolyCameraElement extends PolyOrthographicCameraElement {
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
declare const ELEMENT_BASE$2: typeof HTMLElement;
|
|
454
|
+
declare class PolyTransformControlsElement extends ELEMENT_BASE$2 {
|
|
396
455
|
static get observedAttributes(): string[];
|
|
397
456
|
private _tc;
|
|
398
457
|
private _findScene;
|
|
@@ -404,8 +463,8 @@ declare class PolyTransformControlsElement extends ELEMENT_BASE$1 {
|
|
|
404
463
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
405
464
|
}
|
|
406
465
|
|
|
407
|
-
declare const ELEMENT_BASE: typeof HTMLElement;
|
|
408
|
-
declare class PolySelectElement extends ELEMENT_BASE {
|
|
466
|
+
declare const ELEMENT_BASE$1: typeof HTMLElement;
|
|
467
|
+
declare class PolySelectElement extends ELEMENT_BASE$1 {
|
|
409
468
|
static get observedAttributes(): string[];
|
|
410
469
|
private _selection;
|
|
411
470
|
private _findScene;
|
|
@@ -416,4 +475,75 @@ declare class PolySelectElement extends ELEMENT_BASE {
|
|
|
416
475
|
attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void;
|
|
417
476
|
}
|
|
418
477
|
|
|
419
|
-
|
|
478
|
+
/**
|
|
479
|
+
* Primitive shape custom elements — <poly-box>, <poly-plane>, <poly-ring>,
|
|
480
|
+
* <poly-octahedron>, <poly-tetrahedron>, <poly-icosahedron>, <poly-dodecahedron>,
|
|
481
|
+
* <poly-cylinder>, <poly-cone>, <poly-torus>.
|
|
482
|
+
*
|
|
483
|
+
* Each element reads shape-specific attributes, calls the matching polygon
|
|
484
|
+
* generator from @layoutit/polycss-core, then registers the result with the
|
|
485
|
+
* nearest <poly-scene> ancestor using the same mechanism as <poly-mesh>.
|
|
486
|
+
*
|
|
487
|
+
* Attribute naming follows kebab-case conventions: `radial-segments`,
|
|
488
|
+
* `tubular-segments`, `radius-top`, `half-thickness`, etc.
|
|
489
|
+
*/
|
|
490
|
+
|
|
491
|
+
declare const ELEMENT_BASE: typeof HTMLElement;
|
|
492
|
+
/**
|
|
493
|
+
* Base class for all primitive shape elements. Subclasses implement
|
|
494
|
+
* `buildPolygons()` which returns a Polygon[] from this element's attributes.
|
|
495
|
+
*/
|
|
496
|
+
declare abstract class PolyShapeElement extends ELEMENT_BASE {
|
|
497
|
+
private _handle;
|
|
498
|
+
abstract buildPolygons(): Polygon[];
|
|
499
|
+
connectedCallback(): void;
|
|
500
|
+
disconnectedCallback(): void;
|
|
501
|
+
private _tearDown;
|
|
502
|
+
private _mount;
|
|
503
|
+
}
|
|
504
|
+
declare class PolyBoxElement extends PolyShapeElement {
|
|
505
|
+
static get observedAttributes(): string[];
|
|
506
|
+
buildPolygons(): Polygon[];
|
|
507
|
+
}
|
|
508
|
+
declare class PolyPlaneElement extends PolyShapeElement {
|
|
509
|
+
static get observedAttributes(): string[];
|
|
510
|
+
buildPolygons(): Polygon[];
|
|
511
|
+
}
|
|
512
|
+
declare class PolyRingElement extends PolyShapeElement {
|
|
513
|
+
static get observedAttributes(): string[];
|
|
514
|
+
buildPolygons(): Polygon[];
|
|
515
|
+
}
|
|
516
|
+
declare class PolyOctahedronElement extends PolyShapeElement {
|
|
517
|
+
static get observedAttributes(): string[];
|
|
518
|
+
buildPolygons(): Polygon[];
|
|
519
|
+
}
|
|
520
|
+
declare class PolyTetrahedronElement extends PolyShapeElement {
|
|
521
|
+
static get observedAttributes(): string[];
|
|
522
|
+
buildPolygons(): Polygon[];
|
|
523
|
+
}
|
|
524
|
+
declare class PolyIcosahedronElement extends PolyShapeElement {
|
|
525
|
+
static get observedAttributes(): string[];
|
|
526
|
+
buildPolygons(): Polygon[];
|
|
527
|
+
}
|
|
528
|
+
declare class PolyDodecahedronElement extends PolyShapeElement {
|
|
529
|
+
static get observedAttributes(): string[];
|
|
530
|
+
buildPolygons(): Polygon[];
|
|
531
|
+
}
|
|
532
|
+
declare class PolySphereElement extends PolyShapeElement {
|
|
533
|
+
static get observedAttributes(): string[];
|
|
534
|
+
buildPolygons(): Polygon[];
|
|
535
|
+
}
|
|
536
|
+
declare class PolyCylinderElement extends PolyShapeElement {
|
|
537
|
+
static get observedAttributes(): string[];
|
|
538
|
+
buildPolygons(): Polygon[];
|
|
539
|
+
}
|
|
540
|
+
declare class PolyConeElement extends PolyShapeElement {
|
|
541
|
+
static get observedAttributes(): string[];
|
|
542
|
+
buildPolygons(): Polygon[];
|
|
543
|
+
}
|
|
544
|
+
declare class PolyTorusElement extends PolyShapeElement {
|
|
545
|
+
static get observedAttributes(): string[];
|
|
546
|
+
buildPolygons(): Polygon[];
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
export { PolySphereElement as A, PolyTetrahedronElement as B, PolyTorusElement as C, PolyTransformControlsElement as D, createPolyCamera as E, createPolyOrthographicCamera as F, createPolyPerspectiveCamera as G, createPolyScene as H, type PolySceneHandle as P, type PolyMeshHandle as a, PolyBoxElement as b, PolyCameraElement as c, type PolyCameraOptions as d, PolyConeElement as e, PolyCylinderElement as f, PolyDodecahedronElement as g, PolyFirstPersonControlsElement as h, PolyIcosahedronElement as i, PolyMapControlsElement as j, PolyMeshElement as k, type PolyMeshTransform as l, PolyOctahedronElement as m, PolyOrbitControlsElement as n, PolyOrthographicCameraElement as o, type PolyOrthographicCameraHandle as p, type PolyOrthographicCameraOptions as q, PolyPerspectiveCameraElement as r, type PolyPerspectiveCameraHandle as s, type PolyPerspectiveCameraOptions as t, PolyPlaneElement as u, PolyPolygonElement as v, PolyRingElement as w, PolySceneElement as x, type PolySceneOptions as y, PolySelectElement as z };
|