@codefluss/rive 0.0.1-alpha.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 ADDED
@@ -0,0 +1,74 @@
1
+ # @codefluss/rive
2
+
3
+ Rive animation plugin with advanced interactive features.
4
+
5
+ ## Features
6
+
7
+ - Rive animation playback
8
+ - State machine support for interactive animations
9
+ - Multiple artboard support
10
+ - Input triggers for user interaction
11
+ - Fit modes (cover, contain, fill)
12
+ - Design system integration
13
+ - SSR compatible with client-side hydration
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ pnpm add @codefluss/rive
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ### Editor Mode
24
+
25
+ ```tsx
26
+ import { RiveComponent } from '@codefluss/rive';
27
+
28
+ <RiveComponent
29
+ data={riveData}
30
+ language='en'
31
+ isSelected={false}
32
+ isEditorMode={true}
33
+ dependencies={{ designSystem, utils }}
34
+ />;
35
+ ```
36
+
37
+ ### SSR Mode
38
+
39
+ ```tsx
40
+ import { RiveRenderer } from '@codefluss/rive/renderer';
41
+
42
+ <RiveRenderer
43
+ elementId='rive-1'
44
+ data={riveData}
45
+ language='en'
46
+ dependencies={{ designSystem, utils }}
47
+ />;
48
+ ```
49
+
50
+ ## Properties
51
+
52
+ | Property | Type | Description |
53
+ | ------------------------ | ----------------------------------------------------------------------- | --------------------------------- |
54
+ | `src` | `string` | URL to Rive animation file (.riv) |
55
+ | `artboard` | `string` | Artboard name to display |
56
+ | `stateMachine` | `string` | State machine name to use |
57
+ | `animations` | `string[]` | Animation names to play |
58
+ | `autoplay` | `boolean` | Start playing on load |
59
+ | `fit` | `'cover' \| 'contain' \| 'fill' \| 'fitWidth' \| 'fitHeight' \| 'none'` | Fit mode |
60
+ | `alignment` | `string` | Animation alignment |
61
+ | `inputs` | `RiveInput[]` | State machine inputs |
62
+ | `layout.spacingPresetId` | `string` | Spacing preset from design system |
63
+
64
+ ## State Machine Inputs
65
+
66
+ Rive supports various input types for interactive animations:
67
+
68
+ - **Boolean**: Toggle states
69
+ - **Number**: Numeric values
70
+ - **Trigger**: One-shot events
71
+
72
+ ## License
73
+
74
+ MIT
@@ -0,0 +1,4 @@
1
+ export { default as RiveComponent } from './rive-component';
2
+ export { riveConfig, defaultRiveData } from './rive-config';
3
+ export type { RiveData, RiveComponentProps } from './rive-config';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,YAAY,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { default as RiveComponent } from './rive-component';
2
+ export { riveConfig, defaultRiveData } from './rive-config';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function cn(...inputs: (string | undefined | null | false)[]): string;
2
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AACA,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC,EAAE,GAAG,MAAM,CAE3E"}
@@ -0,0 +1,5 @@
1
+ // Simple className utility function
2
+ export function cn(...inputs) {
3
+ return inputs.filter(Boolean).join(' ');
4
+ }
5
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,MAAM,UAAU,EAAE,CAAC,GAAG,MAA6C;IACjE,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,183 @@
1
+ {
2
+ "plugin": {
3
+ "name": "Rive Animation",
4
+ "description": "Interaktive Rive Animation mit Datei-Upload und erweiterten Maus-Interaktionen"
5
+ },
6
+ "properties": {
7
+ "src": {
8
+ "label": "Animationsdatei",
9
+ "placeholder": "Rive-Datei hochladen",
10
+ "description": "Wählen Sie eine Rive Animationsdatei von Ihrem Computer aus"
11
+ },
12
+ "artboard": {
13
+ "label": "Artboard",
14
+ "placeholder": "Standard",
15
+ "description": "Spezifischer Artboard der Animation"
16
+ },
17
+ "stateMachines": {
18
+ "label": "State Machines",
19
+ "placeholder": "StateMachine",
20
+ "description": "Kommagetrennte Liste der State Machines zur Steuerung"
21
+ },
22
+ "width": {
23
+ "label": "Breite",
24
+ "placeholder": "400",
25
+ "description": "Animationsbreite in Pixeln"
26
+ },
27
+ "height": {
28
+ "label": "Höhe",
29
+ "placeholder": "400",
30
+ "description": "Animationshöhe in Pixeln"
31
+ },
32
+ "fit": {
33
+ "label": "Anpassungsmodus",
34
+ "description": "Wie die Animation in ihren Container passt"
35
+ },
36
+ "alignment": {
37
+ "label": "Ausrichtung",
38
+ "description": "Animationsausrichtung innerhalb ihres Containers"
39
+ },
40
+ "loop": {
41
+ "label": "Endlosschleife",
42
+ "description": "Endlose Wiedergabe aktivieren"
43
+ },
44
+ "autoplay": {
45
+ "label": "Automatische Wiedergabe",
46
+ "description": "Animation automatisch beim Laden abspielen"
47
+ },
48
+ "mouseInteraction.enabled": {
49
+ "label": "Maus-Interaktion aktivieren",
50
+ "description": "Mausgestützte Interaktionssteuerungen aktivieren"
51
+ },
52
+ "mouseInteraction.followMouse": {
53
+ "label": "Maus folgen",
54
+ "description": "Animation folgt der Mausbewegung"
55
+ },
56
+ "mouseInteraction.sensitivity": {
57
+ "label": "Maus-Empfindlichkeit",
58
+ "placeholder": "1.0",
59
+ "description": "Wie empfindlich die Animation auf Mausbewegungen reagiert"
60
+ },
61
+ "mouseInteraction.hoverEffects": {
62
+ "label": "Hover-Effekte",
63
+ "description": "Spezialeffekte beim Überfahren der Animation aktivieren"
64
+ },
65
+ "mouseInteraction.clickActions": {
66
+ "label": "Klick-Aktionen",
67
+ "description": "Spezialaktionen beim Klicken auf die Animation aktivieren"
68
+ },
69
+ "stateMachineInputs.hover": {
70
+ "label": "Hover-State Input",
71
+ "placeholder": "isHovering",
72
+ "description": "State Machine Input Name für Hover-Zustand"
73
+ },
74
+ "stateMachineInputs.click": {
75
+ "label": "Klick-State Input",
76
+ "placeholder": "onTap",
77
+ "description": "State Machine Input Name für Klick-Aktion"
78
+ },
79
+ "stateMachineInputs.mousePosition.x": {
80
+ "label": "Maus-X Input",
81
+ "placeholder": "mouseX",
82
+ "description": "State Machine Input Name für X-Mausposition"
83
+ },
84
+ "stateMachineInputs.mousePosition.y": {
85
+ "label": "Maus-Y Input",
86
+ "placeholder": "mouseY",
87
+ "description": "State Machine Input Name für Y-Mausposition"
88
+ },
89
+ "accessibility.label": {
90
+ "label": "Barrierefreies Label",
91
+ "placeholder": "Interaktive Animation",
92
+ "description": "Screen Reader Label für die Animation"
93
+ },
94
+ "accessibility.description": {
95
+ "label": "Barrierefreie Beschreibung",
96
+ "placeholder": "Interaktive Rive Animation mit Maus-Interaktionen",
97
+ "description": "Detaillierte Beschreibung für Screen Reader"
98
+ },
99
+ "accessibility.role": {
100
+ "label": "Barrierefreie Rolle",
101
+ "placeholder": "img",
102
+ "description": "ARIA-Rolle für das Animationselement"
103
+ },
104
+ "advanced.className": {
105
+ "label": "CSS-Klassen",
106
+ "placeholder": "custom-animation my-style",
107
+ "description": "Zusätzliche CSS-Klassennamen für Styling"
108
+ },
109
+ "advanced.id": {
110
+ "label": "Element-ID",
111
+ "placeholder": "unique-id",
112
+ "description": "Eindeutiger Identifikator für das Element"
113
+ },
114
+ "advanced.ariaLabel": {
115
+ "label": "ARIA-Label",
116
+ "placeholder": "Beschreibendes Label für Screen Reader",
117
+ "description": "Zusätzliches Barrierefreiheits-Label"
118
+ },
119
+ "advanced.tabIndex": {
120
+ "label": "Tab-Index",
121
+ "placeholder": "0",
122
+ "description": "Navigationsreihenfolge für Tastaturzugang"
123
+ }
124
+ },
125
+ "categories": {
126
+ "content": "Inhalt",
127
+ "style": "Stil",
128
+ "interactivity": "Interaktivität",
129
+ "state": "Zustandssteuerung",
130
+ "advanced": "Erweitert"
131
+ },
132
+ "priorities": {
133
+ "quick": "Schnell",
134
+ "common": "Häufig",
135
+ "advanced": "Erweitert"
136
+ },
137
+ "upload": {
138
+ "title": "Rive-Datei hochladen",
139
+ "description": "Wählen Sie eine Rive Animationsdatei von Ihrem Computer aus",
140
+ "button": "Datei auswählen",
141
+ "dragText": "Ziehen Sie Ihre Rive-Datei hierher oder klicken Sie zur Auswahl",
142
+ "supportedFormats": "Unterstütztes Format: .riv",
143
+ "invalidFormat": "Bitte laden Sie eine gültige Rive .riv Datei hoch",
144
+ "fileTooLarge": "Datei ist zu groß. Maximale Größe ist 10MB.",
145
+ "uploadSuccess": "Datei erfolgreich hochgeladen!",
146
+ "uploadError": "Fehler beim Hochladen der Datei. Bitte versuchen Sie es erneut.",
147
+ "fileReady": "Bereit zum Rendern",
148
+ "loadedFile": "Geladen: {filename}"
149
+ },
150
+ "interactivity": {
151
+ "enabled": "Maus-Interaktion aktiv",
152
+ "followMouse": "Maus folgen",
153
+ "hoverEffects": "Hover-Effekte",
154
+ "clickActions": "Klick-Aktionen",
155
+ "sensitivity": "Empfindlichkeit",
156
+ "stateMachines": "State Machines",
157
+ "mousePosition": "Mausposition: ({x}, {y})"
158
+ },
159
+ "controls": {
160
+ "play": "Abspielen",
161
+ "pause": "Pausieren",
162
+ "stop": "Stopp"
163
+ },
164
+ "fitModes": {
165
+ "contain": "Enthalten",
166
+ "cover": "Abdecken",
167
+ "fill": "Füllen",
168
+ "fitWidth": "Breite anpassen",
169
+ "fitHeight": "Höhe anpassen",
170
+ "none": "Keine"
171
+ },
172
+ "alignments": {
173
+ "center": "Zentriert",
174
+ "topLeft": "Oben Links",
175
+ "topCenter": "Oben Zentriert",
176
+ "topRight": "Oben Rechts",
177
+ "centerLeft": "Zentriert Links",
178
+ "centerRight": "Zentriert Rechts",
179
+ "bottomLeft": "Unten Links",
180
+ "bottomCenter": "Unten Zentriert",
181
+ "bottomRight": "Unten Rechts"
182
+ }
183
+ }
@@ -0,0 +1,183 @@
1
+ {
2
+ "plugin": {
3
+ "name": "Rive Animation",
4
+ "description": "Interactive Rive animation with file upload and advanced mouse interactions"
5
+ },
6
+ "properties": {
7
+ "src": {
8
+ "label": "Animation File",
9
+ "placeholder": "Upload Rive file",
10
+ "description": "Select a Rive animation file from your computer"
11
+ },
12
+ "artboard": {
13
+ "label": "Artboard",
14
+ "placeholder": "Default",
15
+ "description": "Specific artboard to use from the animation"
16
+ },
17
+ "stateMachines": {
18
+ "label": "State Machines",
19
+ "placeholder": "StateMachine",
20
+ "description": "Comma-separated list of state machines to control"
21
+ },
22
+ "width": {
23
+ "label": "Width",
24
+ "placeholder": "400",
25
+ "description": "Animation width in pixels"
26
+ },
27
+ "height": {
28
+ "label": "Height",
29
+ "placeholder": "400",
30
+ "description": "Animation height in pixels"
31
+ },
32
+ "fit": {
33
+ "label": "Fit Mode",
34
+ "description": "How the animation fits within its container"
35
+ },
36
+ "alignment": {
37
+ "label": "Alignment",
38
+ "description": "Animation alignment within its container"
39
+ },
40
+ "loop": {
41
+ "label": "Loop Animation",
42
+ "description": "Enable infinite loop playback"
43
+ },
44
+ "autoplay": {
45
+ "label": "Autoplay",
46
+ "description": "Play animation automatically when loaded"
47
+ },
48
+ "mouseInteraction.enabled": {
49
+ "label": "Enable Mouse Interaction",
50
+ "description": "Enable mouse-based interaction controls"
51
+ },
52
+ "mouseInteraction.followMouse": {
53
+ "label": "Follow Mouse",
54
+ "description": "Animation follows mouse cursor movement"
55
+ },
56
+ "mouseInteraction.sensitivity": {
57
+ "label": "Mouse Sensitivity",
58
+ "placeholder": "1.0",
59
+ "description": "How responsive the animation is to mouse movement"
60
+ },
61
+ "mouseInteraction.hoverEffects": {
62
+ "label": "Hover Effects",
63
+ "description": "Enable special effects when hovering over animation"
64
+ },
65
+ "mouseInteraction.clickActions": {
66
+ "label": "Click Actions",
67
+ "description": "Enable special actions when clicking on animation"
68
+ },
69
+ "stateMachineInputs.hover": {
70
+ "label": "Hover State Input",
71
+ "placeholder": "isHovering",
72
+ "description": "State machine input name for hover state"
73
+ },
74
+ "stateMachineInputs.click": {
75
+ "label": "Click State Input",
76
+ "placeholder": "onTap",
77
+ "description": "State machine input name for click action"
78
+ },
79
+ "stateMachineInputs.mousePosition.x": {
80
+ "label": "Mouse X Input",
81
+ "placeholder": "mouseX",
82
+ "description": "State machine input name for X mouse position"
83
+ },
84
+ "stateMachineInputs.mousePosition.y": {
85
+ "label": "Mouse Y Input",
86
+ "placeholder": "mouseY",
87
+ "description": "State machine input name for Y mouse position"
88
+ },
89
+ "accessibility.label": {
90
+ "label": "Accessibility Label",
91
+ "placeholder": "Interactive Animation",
92
+ "description": "Screen reader label for the animation"
93
+ },
94
+ "accessibility.description": {
95
+ "label": "Accessibility Description",
96
+ "placeholder": "Interactive Rive animation with mouse interactions",
97
+ "description": "Detailed description for screen readers"
98
+ },
99
+ "accessibility.role": {
100
+ "label": "Accessibility Role",
101
+ "placeholder": "img",
102
+ "description": "ARIA role for the animation element"
103
+ },
104
+ "advanced.className": {
105
+ "label": "CSS Classes",
106
+ "placeholder": "custom-animation my-style",
107
+ "description": "Additional CSS class names for styling"
108
+ },
109
+ "advanced.id": {
110
+ "label": "Element ID",
111
+ "placeholder": "unique-id",
112
+ "description": "Unique identifier for the element"
113
+ },
114
+ "advanced.ariaLabel": {
115
+ "label": "ARIA Label",
116
+ "placeholder": "Descriptive label for screen readers",
117
+ "description": "Additional accessibility label"
118
+ },
119
+ "advanced.tabIndex": {
120
+ "label": "Tab Index",
121
+ "placeholder": "0",
122
+ "description": "Navigation order for keyboard access"
123
+ }
124
+ },
125
+ "categories": {
126
+ "content": "Content",
127
+ "style": "Style",
128
+ "interactivity": "Interactivity",
129
+ "state": "State Control",
130
+ "advanced": "Advanced"
131
+ },
132
+ "priorities": {
133
+ "quick": "Quick",
134
+ "common": "Common",
135
+ "advanced": "Advanced"
136
+ },
137
+ "upload": {
138
+ "title": "Upload Rive File",
139
+ "description": "Select a Rive animation file from your computer",
140
+ "button": "Choose File",
141
+ "dragText": "Drag and drop your Rive file here, or click to select",
142
+ "supportedFormats": "Supported format: .riv",
143
+ "invalidFormat": "Please upload a valid Rive .riv file",
144
+ "fileTooLarge": "File is too large. Maximum size is 10MB.",
145
+ "uploadSuccess": "File uploaded successfully!",
146
+ "uploadError": "Failed to upload file. Please try again.",
147
+ "fileReady": "Ready to render",
148
+ "loadedFile": "Loaded: {filename}"
149
+ },
150
+ "interactivity": {
151
+ "enabled": "Mouse Interaction Active",
152
+ "followMouse": "Mouse Follow",
153
+ "hoverEffects": "Hover Effects",
154
+ "clickActions": "Click Actions",
155
+ "sensitivity": "Sensitivity",
156
+ "stateMachines": "State Machines",
157
+ "mousePosition": "Mouse Position: ({x}, {y})"
158
+ },
159
+ "controls": {
160
+ "play": "Play",
161
+ "pause": "Pause",
162
+ "stop": "Stop"
163
+ },
164
+ "fitModes": {
165
+ "contain": "Contain",
166
+ "cover": "Cover",
167
+ "fill": "Fill",
168
+ "fitWidth": "Fit Width",
169
+ "fitHeight": "Fit Height",
170
+ "none": "None"
171
+ },
172
+ "alignments": {
173
+ "center": "Center",
174
+ "topLeft": "Top Left",
175
+ "topCenter": "Top Center",
176
+ "topRight": "Top Right",
177
+ "centerLeft": "Center Left",
178
+ "centerRight": "Center Right",
179
+ "bottomLeft": "Bottom Left",
180
+ "bottomCenter": "Bottom Center",
181
+ "bottomRight": "Bottom Right"
182
+ }
183
+ }