@openremote/or-rive-renderer 1.30.0-snapshot.20260902122509 → 1.30.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/package.json +15 -10
- package/custom-elements-jsx.d.ts +0 -231
- package/stories/or-rive-renderer.stories.ts +0 -71
- /package/{custom-elements.json → build/custom-elements.json} +0 -0
- /package/{dist → build/dist}/umd/937224e894d5c7f9.wasm +0 -0
- /package/{dist → build/dist}/umd/index.bundle.js +0 -0
- /package/{dist → build/dist}/umd/index.js +0 -0
- /package/{dist → build/dist}/umd/index.orbundle.js +0 -0
package/package.json
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openremote/or-rive-renderer",
|
|
3
|
-
"version": "1.30.
|
|
3
|
+
"version": "1.30.1",
|
|
4
4
|
"description": "A web component for displaying Rive animations using WebGL",
|
|
5
|
-
"customElements": "custom-elements.json",
|
|
6
|
-
"main": "dist/umd/index.bundle.js",
|
|
7
|
-
"module": "lib/index.js",
|
|
5
|
+
"customElements": "build/custom-elements.json",
|
|
6
|
+
"main": "build/dist/umd/index.bundle.js",
|
|
7
|
+
"module": "build/lib/index.js",
|
|
8
8
|
"exports": {
|
|
9
|
-
".": "./lib/index.js",
|
|
10
|
-
"./*": "./lib/*.js"
|
|
9
|
+
".": "./build/lib/index.js",
|
|
10
|
+
"./*": "./build/lib/*.js"
|
|
11
11
|
},
|
|
12
|
-
"types": "lib/index.d.ts",
|
|
12
|
+
"types": "build/lib/index.d.ts",
|
|
13
|
+
"files": [
|
|
14
|
+
"build/lib/**",
|
|
15
|
+
"build/dist/**",
|
|
16
|
+
"build/custom-elements.json"
|
|
17
|
+
],
|
|
13
18
|
"scripts": {
|
|
14
|
-
"clean": "npx tsc -b --clean && npx shx rm -rf
|
|
19
|
+
"clean": "npx tsc -b --clean && npx shx rm -rf build",
|
|
15
20
|
"analyze": "npx cem analyze --config ../custom-elements-manifest.config.mjs",
|
|
16
21
|
"build": "npx tsc -b",
|
|
17
22
|
"test": "npx tsc -b && npx playwright test",
|
|
@@ -21,13 +26,13 @@
|
|
|
21
26
|
"repository": "https://github.com/openremote/openremote",
|
|
22
27
|
"license": "AGPL-3.0-or-later",
|
|
23
28
|
"dependencies": {
|
|
24
|
-
"@openremote/or-element": "1.30.
|
|
29
|
+
"@openremote/or-element": "1.30.1",
|
|
25
30
|
"@rive-app/webgl2": "^2.38.1",
|
|
26
31
|
"lit": "^3.3.1",
|
|
27
32
|
"lodash.debounce": "^4.0.8"
|
|
28
33
|
},
|
|
29
34
|
"devDependencies": {
|
|
30
|
-
"@openremote/util": "1.30.
|
|
35
|
+
"@openremote/util": "1.30.1"
|
|
31
36
|
},
|
|
32
37
|
"publishConfig": {
|
|
33
38
|
"access": "public"
|
package/custom-elements-jsx.d.ts
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import type { OrRiveRenderer } from "./lib/index.d.ts";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* This type can be used to create scoped tags for your components.
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
*
|
|
8
|
-
* ```ts
|
|
9
|
-
* import type { ScopedElements } from "path/to/library/jsx-integration";
|
|
10
|
-
*
|
|
11
|
-
* declare module "my-library" {
|
|
12
|
-
* namespace JSX {
|
|
13
|
-
* interface IntrinsicElements
|
|
14
|
-
* extends ScopedElements<'test-', ''> {}
|
|
15
|
-
* }
|
|
16
|
-
* }
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* @deprecated Runtime scoped elements result in duplicate types and can confusing for developers. It is recommended to use the `prefix` and `suffix` options to generate new types instead.
|
|
20
|
-
*/
|
|
21
|
-
export type ScopedElements<
|
|
22
|
-
Prefix extends string = "",
|
|
23
|
-
Suffix extends string = "",
|
|
24
|
-
> = {
|
|
25
|
-
[
|
|
26
|
-
Key in keyof CustomElements as `${Prefix}${Key}${Suffix}`
|
|
27
|
-
]: CustomElements[Key];
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
type BaseProps<T extends HTMLElement> = {
|
|
31
|
-
/** Content added between the opening and closing tags of the element */
|
|
32
|
-
children?: any;
|
|
33
|
-
/** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
|
|
34
|
-
class?: string;
|
|
35
|
-
/** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
|
|
36
|
-
className?: string;
|
|
37
|
-
/** Takes an object where the key is the class name(s) and the value is a boolean expression. When true, the class is applied, and when false, it is removed. */
|
|
38
|
-
classList?: Record<string, boolean | undefined>;
|
|
39
|
-
/** Specifies the text direction of the element. */
|
|
40
|
-
dir?: "ltr" | "rtl";
|
|
41
|
-
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
42
|
-
exportparts?: string;
|
|
43
|
-
/** For <label> and <output>, lets you associate the label with some control. */
|
|
44
|
-
htmlFor?: string;
|
|
45
|
-
/** Specifies whether the element should be hidden. */
|
|
46
|
-
hidden?: boolean | string;
|
|
47
|
-
/** A unique identifier for the element. */
|
|
48
|
-
id?: string;
|
|
49
|
-
/** Keys tell React which array item each component corresponds to */
|
|
50
|
-
key?: string | number;
|
|
51
|
-
/** Specifies the language of the element. */
|
|
52
|
-
lang?: string;
|
|
53
|
-
/** Defines the element's semantic role for accessibility APIs. */
|
|
54
|
-
role?: string;
|
|
55
|
-
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
56
|
-
part?: string;
|
|
57
|
-
/** Use the ref attribute with a variable to assign a DOM element to the variable once the element is rendered. */
|
|
58
|
-
ref?: T | ((e: T) => void);
|
|
59
|
-
/** Adds a reference for a custom element slot */
|
|
60
|
-
slot?: string;
|
|
61
|
-
/** Prop for setting inline styles */
|
|
62
|
-
style?: Record<string, string | number>;
|
|
63
|
-
/** Overrides the default Tab button behavior. Avoid using values other than -1 and 0. */
|
|
64
|
-
tabIndex?: number;
|
|
65
|
-
/** Specifies the tooltip text for the element. */
|
|
66
|
-
title?: string;
|
|
67
|
-
/** Passing 'no' excludes the element content from being translated. */
|
|
68
|
-
translate?: "yes" | "no";
|
|
69
|
-
/** The popover global attribute is used to designate an element as a popover element. */
|
|
70
|
-
popover?: "auto" | "hint" | "manual";
|
|
71
|
-
/** Turns an element element into a popover control button; takes the ID of the popover element to control as its value. */
|
|
72
|
-
popovertarget?: "top" | "bottom" | "left" | "right" | "auto";
|
|
73
|
-
/** Specifies the action to be performed on a popover element being controlled by a control element. */
|
|
74
|
-
popovertargetaction?: "show" | "hide" | "toggle";
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
type BaseEvents = {};
|
|
78
|
-
|
|
79
|
-
export type OrRiveRendererProps = {
|
|
80
|
-
/** A string representing the URL or path to the public asset .riv file.
|
|
81
|
-
For more details, refer to Rive Parameters on how to properly use this property. */
|
|
82
|
-
url?: OrRiveRenderer["url"];
|
|
83
|
-
/** The string representing the artboard you want to display.
|
|
84
|
-
When not supplied, the default artboard from the .riv file is selected.
|
|
85
|
-
Docs: https://rive.app/docs/runtimes/web/artboards */
|
|
86
|
-
artboard?: OrRiveRenderer["artboard"];
|
|
87
|
-
/** A list of strings (`["My State Machine"]`) you wish to display.
|
|
88
|
-
Look up the Rive documentation for more info: https://rive.app/docs/runtimes/web/state-machines.
|
|
89
|
-
By default, the state machine will autoplay. */
|
|
90
|
-
stateMachines?: OrRiveRenderer["stateMachines"];
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export type OrRiveRendererSolidJsProps = {
|
|
94
|
-
/** A string representing the URL or path to the public asset .riv file.
|
|
95
|
-
For more details, refer to Rive Parameters on how to properly use this property. */
|
|
96
|
-
"prop:url"?: OrRiveRenderer["url"];
|
|
97
|
-
/** The string representing the artboard you want to display.
|
|
98
|
-
When not supplied, the default artboard from the .riv file is selected.
|
|
99
|
-
Docs: https://rive.app/docs/runtimes/web/artboards */
|
|
100
|
-
"prop:artboard"?: OrRiveRenderer["artboard"];
|
|
101
|
-
/** A list of strings (`["My State Machine"]`) you wish to display.
|
|
102
|
-
Look up the Rive documentation for more info: https://rive.app/docs/runtimes/web/state-machines.
|
|
103
|
-
By default, the state machine will autoplay. */
|
|
104
|
-
"prop:stateMachines"?: OrRiveRenderer["stateMachines"];
|
|
105
|
-
|
|
106
|
-
/** Set the innerHTML of the element */
|
|
107
|
-
innerHTML?: string;
|
|
108
|
-
/** Set the textContent of the element */
|
|
109
|
-
textContent?: string | number;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export type CustomElements = {
|
|
113
|
-
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* ## Attributes & Properties
|
|
117
|
-
*
|
|
118
|
-
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
119
|
-
*
|
|
120
|
-
* - `url`: A string representing the URL or path to the public asset .riv file.
|
|
121
|
-
* For more details, refer to Rive Parameters on how to properly use this property.
|
|
122
|
-
* - `artboard`: The string representing the artboard you want to display.
|
|
123
|
-
* When not supplied, the default artboard from the .riv file is selected.
|
|
124
|
-
* Docs: https://rive.app/docs/runtimes/web/artboards
|
|
125
|
-
* - `stateMachines`: A list of strings (`["My State Machine"]`) you wish to display.
|
|
126
|
-
* Look up the Rive documentation for more info: https://rive.app/docs/runtimes/web/state-machines.
|
|
127
|
-
* By default, the state machine will autoplay.
|
|
128
|
-
*
|
|
129
|
-
* ## Methods
|
|
130
|
-
*
|
|
131
|
-
* Methods that can be called to access component functionality.
|
|
132
|
-
*
|
|
133
|
-
* - `setValue(name: string, value?: any, type: string = typeof value) => Promise<void>`: Public function for updating data within the animation using "View Models".
|
|
134
|
-
* For example, if the animation has a state property named "myValue", you can use this function to update the value to "100".
|
|
135
|
-
* Full documentation can be found here: https://rive.app/docs/runtimes/web/data-binding
|
|
136
|
-
*/
|
|
137
|
-
"or-rive-renderer": Partial<
|
|
138
|
-
OrRiveRendererProps & BaseProps<OrRiveRenderer> & BaseEvents
|
|
139
|
-
>;
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
export type CustomElementsSolidJs = {
|
|
143
|
-
/**
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
* ## Attributes & Properties
|
|
147
|
-
*
|
|
148
|
-
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
149
|
-
*
|
|
150
|
-
* - `url`: A string representing the URL or path to the public asset .riv file.
|
|
151
|
-
* For more details, refer to Rive Parameters on how to properly use this property.
|
|
152
|
-
* - `artboard`: The string representing the artboard you want to display.
|
|
153
|
-
* When not supplied, the default artboard from the .riv file is selected.
|
|
154
|
-
* Docs: https://rive.app/docs/runtimes/web/artboards
|
|
155
|
-
* - `stateMachines`: A list of strings (`["My State Machine"]`) you wish to display.
|
|
156
|
-
* Look up the Rive documentation for more info: https://rive.app/docs/runtimes/web/state-machines.
|
|
157
|
-
* By default, the state machine will autoplay.
|
|
158
|
-
*
|
|
159
|
-
* ## Methods
|
|
160
|
-
*
|
|
161
|
-
* Methods that can be called to access component functionality.
|
|
162
|
-
*
|
|
163
|
-
* - `setValue(name: string, value?: any, type: string = typeof value) => Promise<void>`: Public function for updating data within the animation using "View Models".
|
|
164
|
-
* For example, if the animation has a state property named "myValue", you can use this function to update the value to "100".
|
|
165
|
-
* Full documentation can be found here: https://rive.app/docs/runtimes/web/data-binding
|
|
166
|
-
*/
|
|
167
|
-
"or-rive-renderer": Partial<
|
|
168
|
-
OrRiveRendererProps &
|
|
169
|
-
OrRiveRendererSolidJsProps &
|
|
170
|
-
BaseProps<OrRiveRenderer> &
|
|
171
|
-
BaseEvents
|
|
172
|
-
>;
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
export type CustomCssProperties = {};
|
|
176
|
-
|
|
177
|
-
declare module "react" {
|
|
178
|
-
namespace JSX {
|
|
179
|
-
interface IntrinsicElements extends CustomElements {}
|
|
180
|
-
}
|
|
181
|
-
export interface CSSProperties extends CustomCssProperties {}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
declare module "preact" {
|
|
185
|
-
namespace JSX {
|
|
186
|
-
interface IntrinsicElements extends CustomElements {}
|
|
187
|
-
}
|
|
188
|
-
export interface CSSProperties extends CustomCssProperties {}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
declare module "@builder.io/qwik" {
|
|
192
|
-
namespace JSX {
|
|
193
|
-
interface IntrinsicElements extends CustomElements {}
|
|
194
|
-
}
|
|
195
|
-
export interface CSSProperties extends CustomCssProperties {}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
declare module "@stencil/core" {
|
|
199
|
-
namespace JSX {
|
|
200
|
-
interface IntrinsicElements extends CustomElements {}
|
|
201
|
-
}
|
|
202
|
-
export interface CSSProperties extends CustomCssProperties {}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
declare module "hono/jsx" {
|
|
206
|
-
namespace JSX {
|
|
207
|
-
interface IntrinsicElements extends CustomElements {}
|
|
208
|
-
}
|
|
209
|
-
export interface CSSProperties extends CustomCssProperties {}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
declare module "react-native" {
|
|
213
|
-
namespace JSX {
|
|
214
|
-
interface IntrinsicElements extends CustomElements {}
|
|
215
|
-
}
|
|
216
|
-
export interface CSSProperties extends CustomCssProperties {}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
declare module "solid-js" {
|
|
220
|
-
namespace JSX {
|
|
221
|
-
interface IntrinsicElements extends CustomElementsSolidJs {}
|
|
222
|
-
}
|
|
223
|
-
export interface CSSProperties extends CustomCssProperties {}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
declare global {
|
|
227
|
-
namespace JSX {
|
|
228
|
-
interface IntrinsicElements extends CustomElements {}
|
|
229
|
-
}
|
|
230
|
-
export interface CSSProperties extends CustomCssProperties {}
|
|
231
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2026, OpenRemote Inc.
|
|
3
|
-
*
|
|
4
|
-
* This program is free software: you can redistribute it and/or modify
|
|
5
|
-
* it under the terms of the GNU Affero General Public License as
|
|
6
|
-
* published by the Free Software Foundation, either version 3 of the
|
|
7
|
-
* License, or (at your option) any later version.
|
|
8
|
-
*
|
|
9
|
-
* This program is distributed in the hope that it will be useful,
|
|
10
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
* GNU Affero General Public License for more details.
|
|
13
|
-
*
|
|
14
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
15
|
-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
-
*
|
|
17
|
-
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
18
|
-
*/
|
|
19
|
-
import { setCustomElementsManifest, type Meta, type StoryObj } from "@storybook/web-components";
|
|
20
|
-
import { getORStorybookHelpers } from "../../storybook-utils.js";
|
|
21
|
-
import customElements from "../custom-elements.json" with { type: "json" };
|
|
22
|
-
import packageJson from "../package.json" with { type: "json" };
|
|
23
|
-
import "../src/index";
|
|
24
|
-
import { html } from "lit";
|
|
25
|
-
|
|
26
|
-
const tagName = "or-rive-renderer";
|
|
27
|
-
type Story = StoryObj;
|
|
28
|
-
setCustomElementsManifest(customElements);
|
|
29
|
-
|
|
30
|
-
const { events, args, argTypes, template } = getORStorybookHelpers(tagName);
|
|
31
|
-
|
|
32
|
-
const meta: Meta = {
|
|
33
|
-
title: "Playground/or-rive-renderer",
|
|
34
|
-
component: tagName,
|
|
35
|
-
args,
|
|
36
|
-
argTypes,
|
|
37
|
-
render: (storyArgs) => template(storyArgs),
|
|
38
|
-
excludeStories: /^[a-z].*/,
|
|
39
|
-
parameters: {
|
|
40
|
-
actions: {
|
|
41
|
-
handles: events,
|
|
42
|
-
},
|
|
43
|
-
docs: {
|
|
44
|
-
subtitle: `<${tagName}>`,
|
|
45
|
-
description: "A Web Component for displaying `.riv` files from the [Rive](https://rive.app) ecosystem.",
|
|
46
|
-
story: {
|
|
47
|
-
height: "370px",
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const Primary: Story = {
|
|
54
|
-
render: (args) => html`
|
|
55
|
-
<style>
|
|
56
|
-
or-rive-renderer {
|
|
57
|
-
height: 256px;
|
|
58
|
-
}
|
|
59
|
-
</style>
|
|
60
|
-
${template(args)}
|
|
61
|
-
`,
|
|
62
|
-
args: {
|
|
63
|
-
url: "https://cdn.rive.app/animations/vehicles.riv",
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export const examples: Story[] = [];
|
|
68
|
-
|
|
69
|
-
export { customElements, packageJson };
|
|
70
|
-
|
|
71
|
-
export default meta;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|