@operato/scene-firebase 10.0.0-beta.2 → 10.0.0-beta.30
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 +28 -10
- package/dist/firebase.d.ts +73 -73
- package/dist/firebase.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,15 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @operato/scene-firebase
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Firebase datasource component for things-scene.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<!-- AUTOGEN_BEGIN: do not edit between markers (run scripts/regenerate-readmes.mjs to update) -->
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
| ---- | --------------------------- | -------------- | ------ |
|
|
9
|
-
| UMD | things-scene-firebase.js | modern browser | O |
|
|
10
|
-
| UMD | things-scene-firebase-ie.js | ie 11 | O |
|
|
11
|
-
| ESM | things-scene-firebase.mjs | modern browser | O |
|
|
7
|
+
## Components
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
- `Firebase`
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
yarn add @operato/scene-firebase
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { Firebase } from '@operato/scene-firebase'
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Build
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
yarn build
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Output: ESM module at `dist/index.js` (single bundle, no UMD/IE legacy).
|
|
30
|
+
|
|
31
|
+
_Version: 10.0.0-beta.2_
|
|
32
|
+
|
|
33
|
+
<!-- AUTOGEN_END -->
|
package/dist/firebase.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentNature, Shape } from '@hatiolab/things-scene';
|
|
2
2
|
declare global {
|
|
3
3
|
var firebase: any;
|
|
4
4
|
}
|
|
@@ -35,7 +35,7 @@ declare const Firebase_base: (new (...args: any[]) => {
|
|
|
35
35
|
get disposed(): boolean;
|
|
36
36
|
isLayer(): boolean;
|
|
37
37
|
isGroup(): boolean;
|
|
38
|
-
isContainer(): this is import("@hatiolab/things-scene
|
|
38
|
+
isContainer(): this is import("@hatiolab/things-scene").Container;
|
|
39
39
|
isLine(): boolean;
|
|
40
40
|
isRoot(): boolean;
|
|
41
41
|
isRootModel(): boolean;
|
|
@@ -51,9 +51,9 @@ declare const Firebase_base: (new (...args: any[]) => {
|
|
|
51
51
|
get(property: any): any;
|
|
52
52
|
set(props: any, propval?: any): any;
|
|
53
53
|
getState(property: any): any;
|
|
54
|
-
setState(props:
|
|
54
|
+
setState(props: Partial<import("@hatiolab/things-scene").State> | string, propval?: any): any;
|
|
55
55
|
get model(): any;
|
|
56
|
-
get state():
|
|
56
|
+
get state(): import("@hatiolab/things-scene").State;
|
|
57
57
|
get hierarchy(): any;
|
|
58
58
|
get volatile(): never[];
|
|
59
59
|
_applyProps(target: any, props: any, options: any): any;
|
|
@@ -95,7 +95,7 @@ declare const Firebase_base: (new (...args: any[]) => {
|
|
|
95
95
|
prerender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
96
96
|
render(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
97
97
|
postrender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
98
|
-
prepare(resolve: (component: Component) => void, reject: (reason: any) => void): void;
|
|
98
|
+
prepare(resolve: (component: import("@hatiolab/things-scene").Component) => void, reject: (reason: any) => void): void;
|
|
99
99
|
prepareIf(condition: boolean): void;
|
|
100
100
|
drawText(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
101
101
|
drawStroke(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
@@ -146,16 +146,16 @@ declare const Firebase_base: (new (...args: any[]) => {
|
|
|
146
146
|
get started(): boolean;
|
|
147
147
|
set started(v: boolean): any;
|
|
148
148
|
get controls(): import("@hatiolab/things-scene").Control[] | undefined;
|
|
149
|
-
findFirst(finder: string | ((c: Component) => boolean), ...others: any[]): Component | undefined;
|
|
150
|
-
findAll(s: string | ((c: Component) => boolean), ...others: any[]): any[] | undefined;
|
|
151
|
-
capture(x: number, y: number, except?: (c: Component) => boolean): any;
|
|
149
|
+
findFirst(finder: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): import("@hatiolab/things-scene").Component | undefined;
|
|
150
|
+
findAll(s: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): any[] | undefined;
|
|
151
|
+
capture(x: number, y: number, except?: (c: import("@hatiolab/things-scene").Component) => boolean): any;
|
|
152
152
|
findAnchor(name: string): any;
|
|
153
|
-
isDescendible(container: Component): boolean;
|
|
153
|
+
isDescendible(container: import("@hatiolab/things-scene").Component): boolean;
|
|
154
154
|
getContext(component?: unknown): any;
|
|
155
|
-
get root(): Component;
|
|
156
|
-
get rootModel(): Component;
|
|
157
|
-
get parent(): Component;
|
|
158
|
-
set parent(v: Component): any;
|
|
155
|
+
get root(): import("@hatiolab/things-scene").Component;
|
|
156
|
+
get rootModel(): import("@hatiolab/things-scene").Component;
|
|
157
|
+
get parent(): import("@hatiolab/things-scene").Component;
|
|
158
|
+
set parent(v: import("@hatiolab/things-scene").Component): any;
|
|
159
159
|
get anchors(): import("@hatiolab/things-scene").Anchor[];
|
|
160
160
|
get scalable(): boolean;
|
|
161
161
|
get stuck(): boolean;
|
|
@@ -181,20 +181,20 @@ declare const Firebase_base: (new (...args: any[]) => {
|
|
|
181
181
|
ondropfile(transfered: FileList, files: string[]): void;
|
|
182
182
|
transcoordS2P(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
183
183
|
transcoordP2S(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
184
|
-
transcoordS2T(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
185
|
-
transcoordT2P(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
186
|
-
transcoordT2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
187
|
-
transcoordS2TR(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
188
|
-
transcoordS2O(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
189
|
-
transcoordC2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
190
|
-
transcoordS2C(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
184
|
+
transcoordS2T(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
185
|
+
transcoordT2P(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
186
|
+
transcoordT2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
187
|
+
transcoordS2TR(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
188
|
+
transcoordS2O(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
189
|
+
transcoordC2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
190
|
+
transcoordS2C(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
191
191
|
toParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
192
192
|
fromParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
193
|
-
toScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
194
|
-
fromScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
195
|
-
toLocal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
196
|
-
toGlobal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
197
|
-
toOther(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
193
|
+
toScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
194
|
+
fromScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
195
|
+
toLocal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
196
|
+
toGlobal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
197
|
+
toOther(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
198
198
|
on(name: string | object, callback: Function, context?: any): any;
|
|
199
199
|
off(name?: string | object, callback?: Function, context?: any): any;
|
|
200
200
|
once(name: string | object, callback: Function, context?: any): any;
|
|
@@ -204,24 +204,24 @@ declare const Firebase_base: (new (...args: any[]) => {
|
|
|
204
204
|
onchange(after: Record<string, any>, before: Record<string, any>): void;
|
|
205
205
|
calculateBounds?(): void;
|
|
206
206
|
oncreate_element?(element: HTMLElement): void;
|
|
207
|
-
removeComponent(component: Component, ghost?: boolean): void;
|
|
208
|
-
addComponent(component: Component, ghost?: boolean): void;
|
|
209
|
-
insertComponentAt(component: Component, index: number, ghost?: boolean): void;
|
|
210
|
-
getOverlay(component: Component): HTMLElement | undefined;
|
|
211
|
-
findById(id: string): Component | undefined;
|
|
212
|
-
findByRefid(ref: string | number): Component | undefined;
|
|
213
|
-
findAllById(id: string): Component[];
|
|
207
|
+
removeComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
|
|
208
|
+
addComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
|
|
209
|
+
insertComponentAt(component: import("@hatiolab/things-scene").Component, index: number, ghost?: boolean): void;
|
|
210
|
+
getOverlay(component: import("@hatiolab/things-scene").Component): HTMLElement | undefined;
|
|
211
|
+
findById(id: string): import("@hatiolab/things-scene").Component | undefined;
|
|
212
|
+
findByRefid(ref: string | number): import("@hatiolab/things-scene").Component | undefined;
|
|
213
|
+
findAllById(id: string): import("@hatiolab/things-scene").Component[];
|
|
214
214
|
resize(): void;
|
|
215
215
|
fit(type?: string): void;
|
|
216
|
-
get components(): Component[] | undefined;
|
|
216
|
+
get components(): import("@hatiolab/things-scene").Component[] | undefined;
|
|
217
217
|
get layout(): any;
|
|
218
218
|
get auxOverlay(): HTMLElement | undefined;
|
|
219
219
|
get isReady(): boolean;
|
|
220
220
|
get unitScale(): number;
|
|
221
|
-
get selected(): Component[];
|
|
222
|
-
set selected(_v: Component[]): any;
|
|
223
|
-
get focused(): Component | null;
|
|
224
|
-
set focused(_v: Component | null): any;
|
|
221
|
+
get selected(): import("@hatiolab/things-scene").Component[];
|
|
222
|
+
set selected(_v: import("@hatiolab/things-scene").Component[]): any;
|
|
223
|
+
get focused(): import("@hatiolab/things-scene").Component | null;
|
|
224
|
+
set focused(_v: import("@hatiolab/things-scene").Component | null): any;
|
|
225
225
|
get hasSameParentForAllSelected(): boolean;
|
|
226
226
|
set hasSameParentForAllSelected(_v: boolean): any;
|
|
227
227
|
get fitMode(): string | undefined;
|
|
@@ -278,7 +278,7 @@ declare const Firebase_base: (new (...args: any[]) => {
|
|
|
278
278
|
get disposed(): boolean;
|
|
279
279
|
isLayer(): boolean;
|
|
280
280
|
isGroup(): boolean;
|
|
281
|
-
isContainer(): this is import("@hatiolab/things-scene
|
|
281
|
+
isContainer(): this is import("@hatiolab/things-scene").Container;
|
|
282
282
|
isLine(): boolean;
|
|
283
283
|
isRoot(): boolean;
|
|
284
284
|
isRootModel(): boolean;
|
|
@@ -294,9 +294,9 @@ declare const Firebase_base: (new (...args: any[]) => {
|
|
|
294
294
|
get(property: any): any;
|
|
295
295
|
set(props: any, propval?: any): any;
|
|
296
296
|
getState(property: any): any;
|
|
297
|
-
setState(props:
|
|
297
|
+
setState(props: Partial<import("@hatiolab/things-scene").State> | string, propval?: any): any;
|
|
298
298
|
get model(): any;
|
|
299
|
-
get state():
|
|
299
|
+
get state(): import("@hatiolab/things-scene").State;
|
|
300
300
|
get hierarchy(): any;
|
|
301
301
|
get volatile(): never[];
|
|
302
302
|
_applyProps(target: any, props: any, options: any): any;
|
|
@@ -332,7 +332,7 @@ declare const Firebase_base: (new (...args: any[]) => {
|
|
|
332
332
|
draw(context?: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
333
333
|
prerender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
334
334
|
postrender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
335
|
-
prepare(resolve: (component: Component) => void, reject: (reason: any) => void): void;
|
|
335
|
+
prepare(resolve: (component: import("@hatiolab/things-scene").Component) => void, reject: (reason: any) => void): void;
|
|
336
336
|
prepareIf(condition: boolean): void;
|
|
337
337
|
drawText(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
338
338
|
drawStroke(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
@@ -383,16 +383,16 @@ declare const Firebase_base: (new (...args: any[]) => {
|
|
|
383
383
|
get started(): boolean;
|
|
384
384
|
set started(v: boolean): any;
|
|
385
385
|
get controls(): import("@hatiolab/things-scene").Control[] | undefined;
|
|
386
|
-
findFirst(finder: string | ((c: Component) => boolean), ...others: any[]): Component | undefined;
|
|
387
|
-
findAll(s: string | ((c: Component) => boolean), ...others: any[]): any[] | undefined;
|
|
388
|
-
capture(x: number, y: number, except?: (c: Component) => boolean): any;
|
|
386
|
+
findFirst(finder: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): import("@hatiolab/things-scene").Component | undefined;
|
|
387
|
+
findAll(s: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): any[] | undefined;
|
|
388
|
+
capture(x: number, y: number, except?: (c: import("@hatiolab/things-scene").Component) => boolean): any;
|
|
389
389
|
findAnchor(name: string): any;
|
|
390
|
-
isDescendible(container: Component): boolean;
|
|
390
|
+
isDescendible(container: import("@hatiolab/things-scene").Component): boolean;
|
|
391
391
|
getContext(component?: unknown): any;
|
|
392
|
-
get root(): Component;
|
|
393
|
-
get rootModel(): Component;
|
|
394
|
-
get parent(): Component;
|
|
395
|
-
set parent(v: Component): any;
|
|
392
|
+
get root(): import("@hatiolab/things-scene").Component;
|
|
393
|
+
get rootModel(): import("@hatiolab/things-scene").Component;
|
|
394
|
+
get parent(): import("@hatiolab/things-scene").Component;
|
|
395
|
+
set parent(v: import("@hatiolab/things-scene").Component): any;
|
|
396
396
|
get scalable(): boolean;
|
|
397
397
|
get stuck(): boolean;
|
|
398
398
|
get capturable(): boolean;
|
|
@@ -417,20 +417,20 @@ declare const Firebase_base: (new (...args: any[]) => {
|
|
|
417
417
|
ondropfile(transfered: FileList, files: string[]): void;
|
|
418
418
|
transcoordS2P(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
419
419
|
transcoordP2S(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
420
|
-
transcoordS2T(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
421
|
-
transcoordT2P(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
422
|
-
transcoordT2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
423
|
-
transcoordS2TR(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
424
|
-
transcoordS2O(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
425
|
-
transcoordC2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
426
|
-
transcoordS2C(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
420
|
+
transcoordS2T(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
421
|
+
transcoordT2P(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
422
|
+
transcoordT2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
423
|
+
transcoordS2TR(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
424
|
+
transcoordS2O(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
425
|
+
transcoordC2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
426
|
+
transcoordS2C(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
427
427
|
toParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
428
428
|
fromParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
429
|
-
toScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
430
|
-
fromScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
431
|
-
toLocal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
432
|
-
toGlobal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
433
|
-
toOther(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
429
|
+
toScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
430
|
+
fromScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
431
|
+
toLocal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
432
|
+
toGlobal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
433
|
+
toOther(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
434
434
|
on(name: string | object, callback: Function, context?: any): any;
|
|
435
435
|
off(name?: string | object, callback?: Function, context?: any): any;
|
|
436
436
|
once(name: string | object, callback: Function, context?: any): any;
|
|
@@ -440,24 +440,24 @@ declare const Firebase_base: (new (...args: any[]) => {
|
|
|
440
440
|
onchange(after: Record<string, any>, before: Record<string, any>): void;
|
|
441
441
|
calculateBounds?(): void;
|
|
442
442
|
oncreate_element?(element: HTMLElement): void;
|
|
443
|
-
removeComponent(component: Component, ghost?: boolean): void;
|
|
444
|
-
addComponent(component: Component, ghost?: boolean): void;
|
|
445
|
-
insertComponentAt(component: Component, index: number, ghost?: boolean): void;
|
|
446
|
-
getOverlay(component: Component): HTMLElement | undefined;
|
|
447
|
-
findById(id: string): Component | undefined;
|
|
448
|
-
findByRefid(ref: string | number): Component | undefined;
|
|
449
|
-
findAllById(id: string): Component[];
|
|
443
|
+
removeComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
|
|
444
|
+
addComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
|
|
445
|
+
insertComponentAt(component: import("@hatiolab/things-scene").Component, index: number, ghost?: boolean): void;
|
|
446
|
+
getOverlay(component: import("@hatiolab/things-scene").Component): HTMLElement | undefined;
|
|
447
|
+
findById(id: string): import("@hatiolab/things-scene").Component | undefined;
|
|
448
|
+
findByRefid(ref: string | number): import("@hatiolab/things-scene").Component | undefined;
|
|
449
|
+
findAllById(id: string): import("@hatiolab/things-scene").Component[];
|
|
450
450
|
resize(): void;
|
|
451
451
|
fit(type?: string): void;
|
|
452
|
-
get components(): Component[] | undefined;
|
|
452
|
+
get components(): import("@hatiolab/things-scene").Component[] | undefined;
|
|
453
453
|
get layout(): any;
|
|
454
454
|
get auxOverlay(): HTMLElement | undefined;
|
|
455
455
|
get isReady(): boolean;
|
|
456
456
|
get unitScale(): number;
|
|
457
|
-
get selected(): Component[];
|
|
458
|
-
set selected(_v: Component[]): any;
|
|
459
|
-
get focused(): Component | null;
|
|
460
|
-
set focused(_v: Component | null): any;
|
|
457
|
+
get selected(): import("@hatiolab/things-scene").Component[];
|
|
458
|
+
set selected(_v: import("@hatiolab/things-scene").Component[]): any;
|
|
459
|
+
get focused(): import("@hatiolab/things-scene").Component | null;
|
|
460
|
+
set focused(_v: import("@hatiolab/things-scene").Component | null): any;
|
|
461
461
|
get hasSameParentForAllSelected(): boolean;
|
|
462
462
|
set hasSameParentForAllSelected(_v: boolean): any;
|
|
463
463
|
get fitMode(): string | undefined;
|
package/dist/firebase.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firebase.js","sourceRoot":"","sources":["../src/firebase.ts"],"names":[],"mappings":"AAAA;;GAEG;;;AAEH,OAAO,EAA8B,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAMnH,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,QAAQ;SACnB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,aAAa;YACpB,IAAI,EA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M,CAAC,OAAiC;QACtC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE9C,OAAO,CAAC,SAAS,EAAE,CAAA;QACnB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,UAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;IACnE,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAA;AArGoB,QAAQ;IAD5B,cAAc,CAAC,UAAU,CAAC;GACN,QAAQ,CAqG5B;eArGoB,QAAQ","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { Component, ComponentNature, DataSource, error, RectPath, Shape, sceneComponent } from '@hatiolab/things-scene'\nimport { initializeApp, deleteApp } from 'firebase/app'\nimport { getDatabase, ref, child, onValue } from 'firebase/database'\nimport { getAuth, onAuthStateChanged, signInAnonymously, signInWithEmailAndPassword, signOut } from 'firebase/auth'\n\ndeclare global {\n var firebase: any\n}\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'string',\n label: 'api-key',\n name: 'apiKey',\n property: 'apiKey'\n },\n {\n type: 'string',\n label: 'auth-domain',\n name: 'authDomain',\n property: 'authDomain'\n },\n {\n type: 'string',\n label: 'database-url',\n name: 'databaseURL',\n property: 'databaseURL'\n },\n {\n type: 'string',\n label: 'project-id',\n name: 'projectId',\n property: 'projectId'\n },\n {\n type: 'string',\n label: 'storage-bucket',\n name: 'storageBucket',\n property: 'storageBucket'\n },\n {\n type: 'string',\n label: 'messaging-sender-id',\n name: 'messagingSenderId',\n property: 'messagingSenderId'\n },\n {\n type: 'string',\n label: 'child-data-path',\n name: 'childDataPath',\n property: 'childDataPath'\n },\n {\n type: 'string',\n label: 'email-id',\n name: 'email',\n property: 'email'\n },\n {\n type: 'string',\n label: 'password',\n name: 'password',\n property: 'password'\n }\n ]\n // help: 'scene/component/firebase'\n}\n\nconst FIREBASE_IMAGE =\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAMAAAAKE/YAAAABiVBMVEVHcEz/01z/vkLztDj/xkr1szn9wEX7v0j5uD//11n1sjf/w0b9vUT/xUb/sS3poSb/rST/tTrxqSv/sjD/tjjsoyT/qx7/tTbpoST/ryn/00r/riX/tDT/tz7/rynpoibooCXpnSj/0UL/rSL/zzv/xE7/0UL/sjHuqyXuqybtqCfqpCb/00r/qhv/zjb/0UL/zjj/zTT/sS//ryf/uEH4skL/1lf/uUD/yir/zC//yyz/yy7/yy3/zDD1ggv1ggz2gw31gQr0gAn+pAz1fQv/0Sr+ogr0gAz/4UT9pg73lw73gAz9og3/zynvbQD/zSn4mg77oA36nQ38zVPudA33jg3wkxD0lA7ucQr1iAz8yVD2uSjwbwDzsyf/0y/7wir/4EH5vij/0C7wrif4kgD+yCvxjA7ubgj9xSjpgQr8yULydQD/qBT/pAn/pxL/pg//qRf/phH/pQ7/oQT/phD/qBb/qx3/pQ3/pAv/2ED/zDH/pA3/tz//ySf+pQ/+0lT/yyv/ySP/yinifeuoAAAAOHRSTlMAFFwZRQgrDiHhNFE8a7py7INK/nfS3o+WnXr+ZqGusIZZnNDJA7vR7fjlvq705o3Z89/GrcqI9AO1jy8AAApzSURBVHhe7NjdjtJQFIZhqYUZhWkgm0i04onBOZETROem1tr/uy3M+HvlMhuKbamcEfZK+l7Bk6ZZ/dIXZ+vq6urqGs3XQ2rmuyfGnia0zDHjWisWkULPLUjpihUp9Bctd/HsjpB5MebyOT2+oYO+zcCjnZzQQcc7ri9nPToHD+Q+kDMy6JmVh3J2SwX94YgGmFNBf7SyrEhf0zD3lrw0O7BrImNJQml27jGNSaCjitmB/koCPeEHsy/PIhLHQ1TMAPk9ieMhqmbQFHZTf8yrZoBitSAwl3jNDMJNg0cPJdTMAAQm6pQ3zGAh+N30VlTNvsc09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AAAABJRU5ErkJggg=='\n\nvar idx = 0\n\n@sceneComponent('firebase')\nexport default class Firebase extends DataSource(RectPath(Shape)) {\n private static _image: HTMLImageElement\n private _firebase_app: any\n private _firebase_auth: any\n private _firebase_ref: any\n\n static get image() {\n if (!Firebase._image) {\n Firebase._image = new Image()\n Firebase._image.src = FIREBASE_IMAGE\n }\n\n return Firebase._image\n }\n\n added() {\n if (!this.app.isViewMode || this._firebase_app) {\n return\n }\n\n try {\n this._initFirebase()\n } catch (err) {\n error(err)\n }\n }\n\n _onValue(snapshot: any) {\n this.data = snapshot.val()\n }\n\n _initFirebase() {\n var {\n apiKey,\n authDomain,\n databaseURL,\n projectId,\n storageBucket,\n messagingSenderId,\n childDataPath,\n email,\n password\n } = this.state\n\n var self = this\n\n this._firebase_app = initializeApp(\n { apiKey, authDomain, databaseURL, projectId, storageBucket, messagingSenderId },\n 'FBAPP-' + ++idx\n )\n this._firebase_auth = getAuth(this._firebase_app)\n\n onAuthStateChanged(this._firebase_auth, (firebaseUser: any) => {\n if (firebaseUser) {\n console.log('logged in', firebaseUser)\n const database = getDatabase(this._firebase_app)\n const parent = ref(database)\n self._firebase_ref = child(parent, childDataPath)\n onValue(self._firebase_ref, self._onValue.bind(self))\n } else {\n console.log('not logged in.')\n }\n })\n\n var promise = email\n ? signInWithEmailAndPassword(this._firebase_auth, email, password)\n : signInAnonymously(this._firebase_auth)\n\n promise.catch((e: Error) => console.log(e.message))\n }\n\n dispose() {\n if (this._firebase_app) {\n try {\n this._firebase_ref && this._firebase_ref.off('value', this._onValue, this)\n this._firebase_auth && signOut(this._firebase_auth)\n this._firebase_app && deleteApp(this._firebase_app)\n\n console.log('disposed - firebase')\n } catch (e) {\n console.error(e)\n }\n }\n\n delete this._firebase_auth\n delete this._firebase_ref\n delete this._firebase_app\n\n super.dispose()\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n this.drawImage(context, Firebase.image, left, top, width, height)\n }\n\n get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import { ComponentNature, DataSource, error, RectPath, Shape, sceneComponent } from '@hatiolab/things-scene'\n\nimport { initializeApp, deleteApp } from 'firebase/app'\nimport { getDatabase, ref, child, onValue } from 'firebase/database'\nimport { getAuth, onAuthStateChanged, signInAnonymously, signInWithEmailAndPassword, signOut } from 'firebase/auth'\n\ndeclare global {\n var firebase: any\n}\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'string',\n label: 'api-key',\n name: 'apiKey',\n property: 'apiKey'\n },\n {\n type: 'string',\n label: 'auth-domain',\n name: 'authDomain',\n property: 'authDomain'\n },\n {\n type: 'string',\n label: 'database-url',\n name: 'databaseURL',\n property: 'databaseURL'\n },\n {\n type: 'string',\n label: 'project-id',\n name: 'projectId',\n property: 'projectId'\n },\n {\n type: 'string',\n label: 'storage-bucket',\n name: 'storageBucket',\n property: 'storageBucket'\n },\n {\n type: 'string',\n label: 'messaging-sender-id',\n name: 'messagingSenderId',\n property: 'messagingSenderId'\n },\n {\n type: 'string',\n label: 'child-data-path',\n name: 'childDataPath',\n property: 'childDataPath'\n },\n {\n type: 'string',\n label: 'email-id',\n name: 'email',\n property: 'email'\n },\n {\n type: 'string',\n label: 'password',\n name: 'password',\n property: 'password'\n }\n ]\n // help: 'scene/component/firebase'\n}\n\nconst FIREBASE_IMAGE =\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAMAAAAKE/YAAAABiVBMVEVHcEz/01z/vkLztDj/xkr1szn9wEX7v0j5uD//11n1sjf/w0b9vUT/xUb/sS3poSb/rST/tTrxqSv/sjD/tjjsoyT/qx7/tTbpoST/ryn/00r/riX/tDT/tz7/rynpoibooCXpnSj/0UL/rSL/zzv/xE7/0UL/sjHuqyXuqybtqCfqpCb/00r/qhv/zjb/0UL/zjj/zTT/sS//ryf/uEH4skL/1lf/uUD/yir/zC//yyz/yy7/yy3/zDD1ggv1ggz2gw31gQr0gAn+pAz1fQv/0Sr+ogr0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mvqn8LibI8nWpf36QVaeGVqbTrYuGVfnmeWZqXOJ0jG/naVnro98AujJxassmbk+kvxenj+7zDwbym2+WyskgX572fyMeqf8brfsUhyEoTB6QRxLKQiC4FsVEKzdQH+e72O4CwhGjAjdRGHoyqeZ6XChTMFWYzPgWcHhksOXvndGkmUIL5MDpG2t1JR3FqJuEx+GEayrTumpnAWeqrUHw1ls5VHp4wTOhOcq/oBxiEq5V/ujpb8oK5MsIhiPcFNrtbfqjNRsQhgVP61qre05I3J/o5GDdy1SawvvmfuzwTI2RY7vTNhV8RJsEZWNVr2U+zsTXmQZgR24SD3Wnbk/q+R5kLSd0qM0yP1ZJ19szUaOcWfi/uyziuVBDbsz9zcdWdEc1ABn7m9CcvP90/q1t8H9Tc1tbF67szD9BfAOPmLZKdo94cz7t/XgXUSlJHzSmfAytL/hY9No7OfM/WXwZvykrRH7OHN/DuCZsRG7Hs5iwP7ZGJsdF/nImUx/C3AAHhvCh863/ZPcnyOYscHHzkjcn0MESXVC/bczUtOG4CTm+4d078z9uUj+MzZ32tyfu4QbUyQ7f+/fChzHvxYpkH6VSRYZuAx//+pPgVfEmftznuW6lbJpZFWkAfwfvCxN0jDyYRgzMzMzM1/dCbx3RzPDJwAAAABJRU5ErkJggg=='\n\nvar idx = 0\n\n@sceneComponent('firebase')\nexport default class Firebase extends DataSource(RectPath(Shape)) {\n private static _image: HTMLImageElement\n private _firebase_app: any\n private _firebase_auth: any\n private _firebase_ref: any\n\n static get image() {\n if (!Firebase._image) {\n Firebase._image = new Image()\n Firebase._image.src = FIREBASE_IMAGE\n }\n\n return Firebase._image\n }\n\n added() {\n if (!this.app.isViewMode || this._firebase_app) {\n return\n }\n\n try {\n this._initFirebase()\n } catch (err) {\n error(err)\n }\n }\n\n _onValue(snapshot: any) {\n this.data = snapshot.val()\n }\n\n _initFirebase() {\n var {\n apiKey,\n authDomain,\n databaseURL,\n projectId,\n storageBucket,\n messagingSenderId,\n childDataPath,\n email,\n password\n } = this.state\n\n var self = this\n\n this._firebase_app = initializeApp(\n { apiKey, authDomain, databaseURL, projectId, storageBucket, messagingSenderId },\n 'FBAPP-' + ++idx\n )\n this._firebase_auth = getAuth(this._firebase_app)\n\n onAuthStateChanged(this._firebase_auth, (firebaseUser: any) => {\n if (firebaseUser) {\n console.log('logged in', firebaseUser)\n const database = getDatabase(this._firebase_app)\n const parent = ref(database)\n self._firebase_ref = child(parent, childDataPath)\n onValue(self._firebase_ref, self._onValue.bind(self))\n } else {\n console.log('not logged in.')\n }\n })\n\n var promise = email\n ? signInWithEmailAndPassword(this._firebase_auth, email, password)\n : signInAnonymously(this._firebase_auth)\n\n promise.catch((e: Error) => console.log(e.message))\n }\n\n dispose() {\n if (this._firebase_app) {\n try {\n this._firebase_ref && this._firebase_ref.off('value', this._onValue, this)\n this._firebase_auth && signOut(this._firebase_auth)\n this._firebase_app && deleteApp(this._firebase_app)\n\n console.log('disposed - firebase')\n } catch (e) {\n console.error(e)\n }\n }\n\n delete this._firebase_auth\n delete this._firebase_ref\n delete this._firebase_app\n\n super.dispose()\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n this.drawImage(context, Firebase.image, left, top, width, height)\n }\n\n get nature() {\n return NATURE\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/scene-firebase",
|
|
3
3
|
"description": "Firebase datasource component for things-scene.",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "10.0.0-beta.
|
|
5
|
+
"version": "10.0.0-beta.30",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.js",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"prettier --write"
|
|
60
60
|
]
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "06b35b1726ec4f27ee76657ce341c6c6f3ba1b3a"
|
|
63
63
|
}
|