Skip to content

Commit

Permalink
update code onto latest @lume/element on classy-solid 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
trusktr committed Nov 21, 2023
1 parent 74945ec commit 699c9ec
Show file tree
Hide file tree
Showing 540 changed files with 20,705 additions and 6,155 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ dist/
src/lib

examples/models

cdn-install-example.html
2 changes: 1 addition & 1 deletion apps/docs
Submodule docs updated 44 files
+64 −21 README.md
+2 −0 _sidebar.md
+2 −0 _sidebar.src.md
+1 −5 api/behaviors/mesh-behaviors/geometries/MixedPlaneGeometryBehavior.md
+1 −5 api/behaviors/mesh-behaviors/materials/MixedPlaneMaterialBehavior.md
+2 −0 api/cameras/CameraRig.md
+1 −1 api/cameras/PerspectiveCamera.md
+2 −2 api/core/Scene.md
+4 −4 api/core/SharedAPI.md
+2 −2 api/core/Sizeable.md
+1 −1 api/lights/AmbientLight.md
+1 −1 api/lights/DirectionalLight.md
+2 −0 api/lights/Light.md
+1 −1 api/lights/PointLight.md
+1 −5 api/meshes/MixedPlane.md
+3 −3 api/xyz-values/XYZValues.md
+1 −0 dev-server.mjs
+0 −58 examples.old.md
+222 −0 examples/buttons-with-shadow.html
+1 −8 examples/buttons-with-shadow.md
+1 −114 examples/disco-helmet/README.md
+113 −0 examples/disco-helmet/disco-helmet.html
+5 −13 examples/hello-world/README.md
+37 −37 examples/nasa-astrobee-robot/README.md
+30 −0 examples/picture-frame.html
+1 −8 examples/picture-frame.md
+0 −273 guide/TODO-custom-element-names.md
+10 −20 guide/compatibility.md
+276 −0 guide/custom-element-names.md
+56 −0 guide/debugging.md
+579 −0 guide/includes/classy-solid.md
+1,296 −190 guide/includes/lume-element.md
+0 −544 guide/includes/lume-variable.md
+4 −1 guide/install/README.md
+1 −1 guide/install/cdn-install-example.html
+16 −23 guide/making-a-scene.md
+12 −10 guide/reactivity.md
+9 −3 guide/scene-graph.md
+15 −9 importmap.js
+211 −0 intro-example.html
+3 −4 js/PictureFrameScene.js
+3 −0 js/starPath.js
+129 −602 js/utils.js
+4 −4 package.json
2 changes: 1 addition & 1 deletion dist/LumeConfig.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion dist/LumeConfig.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/LumeConfig.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 49 additions & 1 deletion dist/behaviors/Behavior.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
import 'element-behaviors';
import type { ElementWithBehaviors } from 'element-behaviors';
import type { ElementWithBehaviors, PossibleBehaviorInstance } from 'element-behaviors';
import type { AnyConstructor } from 'lowclass/dist/utils.js';
/**
* Alias of the `@element` decorator used on custom elements for use on Behavior
* classes. If a name is passed in, it defines an element behavior instead of a
* custom element.
*
* Besides defining an element behavior instead of a custom element, it re-uses
* the `@element` implementation: sets up `observedAttributes`,
* `attributeChangedCallback`, and makes properties be Solid signals by
* composing `@reactive` and `@signal` decorators).
*
* Example (ignore backslashes):
*
* ```js
* \@behavior('my-behavior')
* class MyBehavior extends Behavior {
* \@numberAttribute foo = 123
* }
* ```
*/
export declare function behavior(name: string): <T extends AnyConstructor<PossibleBehaviorInstance>>(Class: T, context?: ClassDecoratorContext) => T;
export declare function behavior<T extends AnyConstructor<PossibleBehaviorInstance>>(Class: T, context?: ClassDecoratorContext): T;
declare const Behavior_base: {
new (...args: any[]): {
connectedCallback(): void;
disconnectedCallback(): void;
readonly observedObject: object;
_propChangedCallback(propName: PropertyKey, value: any): void;
"__#5@#isObserving": boolean;
"__#5@#observeProps"(): void;
"__#5@#unobserveProps"(): void;
__forwardedProps(): never[];
Expand All @@ -15,11 +38,36 @@ declare const Behavior_base: {
};
receivedProperties?: PropertyKey[] | undefined;
} & (new (...a: any[]) => import("./PropReceiver.js").PossiblyCustomElement);
/**
* @class Behavior
* Base class for all LUME behaviors.
*
* Features:
* - Sets `static awaitElementDefined` to `true`, which causes `elementBehaviors` to wait until the behavior's host element is upgraded if it might be a custom element (i.e. when the host element has a hyphen in its name).
* - Assigns the host element onto `this.element` for convenience.
* - Calls a subclass's `requiredElementType` method which should return the type (constructor) of allowed elements that the behavior can be hosted on. If the element is not instanceof the `requiredElementType()`, then an error is shown in console. For TypeScript users, it enforces the type of `.element` in subclass code.
* - Forwards the properties specified in `receivedProperties` from `observedObject` to `this` any time `receivedProperties` on `observedObject` change. Useful for forwarding JS properties from the host element to the behavior. This functionality comes from the [`PropReceiver`](./PropReceiver) class.
*
* @extends PropReceiver
*/
export declare abstract class Behavior extends Behavior_base {
#private;
static awaitElementDefined: boolean;
element: Element;
constructor(element: ElementWithBehaviors);
/**
* @method requiredElementType - A subclass can override this method in
* order to enforce that the behavior can be applied only on certain types
* of elements by returning an array of constructors. An error will be
* thrown if `this.element` is not an instanceof one of the constructors.
*
* If the element's tag name has a hyphen in it, the logic will consider it
* to possibly be a custom element and will wait for it to be upgraded
* before performing the check; if the custom element is not upgraded within
* a second, an error is thrown.
*
* @returns {[typeof Element]}
*/
requiredElementType(): {
new (): Element;
prototype: Element;
Expand Down
2 changes: 1 addition & 1 deletion dist/behaviors/Behavior.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions dist/behaviors/Behavior.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/behaviors/Behavior.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 699c9ec

Please sign in to comment.