@buerli.io/core 0.5.0-beta.1 → 0.5.0-beta.3
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/build/cjs/geometry/ThreeGeometryCreator.js +321 -0
- package/build/cjs/geometry/index.js +17 -0
- package/build/cjs/graphic/filters.js +25 -0
- package/build/cjs/index.js +25 -0
- package/build/cjs/store/index.js +37 -0
- package/build/cjs/store/states/buerli.js +98 -0
- package/build/cjs/store/states/cad.js +35 -0
- package/build/cjs/store/states/drawing.js +47 -0
- package/build/cjs/store/states/geometry.js +139 -0
- package/build/cjs/store/states/graphic.js +115 -0
- package/build/cjs/store/states/interaction.js +55 -0
- package/build/cjs/store/states/message.js +25 -0
- package/build/cjs/store/states/plugin.js +115 -0
- package/build/cjs/store/states/selection.js +258 -0
- package/build/cjs/store/states/structure.js +239 -0
- package/build/cjs/store/store.js +9 -0
- package/build/cjs/store/subscribtion/selection.js +46 -0
- package/build/cjs/store/subscribtion/subscribeToDrawing.js +13 -0
- package/build/cjs/types/IGraphicPackage.js +49 -0
- package/build/cjs/types/IStructurePatch.js +2 -0
- package/build/cjs/types/IStructureTree.js +27 -0
- package/build/cjs/types/InteractionInfo.js +11 -0
- package/build/cjs/types/index.js +20 -0
- package/build/cjs/utils/Math.js +91 -0
- package/build/cjs/utils/Measure.js +560 -0
- package/build/cjs/utils/Timing.js +34 -0
- package/build/{geometry → esm/geometry}/ThreeGeometryCreator.js +0 -0
- package/build/{geometry → esm/geometry}/index.js +0 -0
- package/build/{graphic → esm/graphic}/filters.js +0 -0
- package/build/{index.js → esm/index.js} +0 -0
- package/build/{store → esm/store}/index.js +0 -0
- package/build/{store → esm/store}/states/buerli.js +0 -0
- package/build/{store → esm/store}/states/cad.js +0 -0
- package/build/{store → esm/store}/states/drawing.js +0 -0
- package/build/{store → esm/store}/states/geometry.js +0 -0
- package/build/{store → esm/store}/states/graphic.js +0 -0
- package/build/{store → esm/store}/states/interaction.js +0 -0
- package/build/{store → esm/store}/states/message.js +0 -0
- package/build/{store → esm/store}/states/plugin.js +0 -0
- package/build/{store → esm/store}/states/selection.js +0 -0
- package/build/{store → esm/store}/states/structure.js +0 -0
- package/build/{store → esm/store}/store.js +0 -0
- package/build/{store → esm/store}/subscribtion/selection.js +0 -0
- package/build/{store → esm/store}/subscribtion/subscribeToDrawing.js +0 -0
- package/build/{types → esm/types}/IGraphicPackage.js +0 -0
- package/build/{types → esm/types}/IStructurePatch.js +0 -0
- package/build/{types → esm/types}/IStructureTree.js +0 -0
- package/build/{types → esm/types}/InteractionInfo.js +0 -0
- package/build/{types → esm/types}/index.js +0 -0
- package/build/{utils → esm/utils}/Math.js +0 -0
- package/build/{utils → esm/utils}/Measure.js +0 -0
- package/build/{utils → esm/utils}/Timing.js +0 -0
- package/build/{geometry → types/geometry}/ThreeGeometryCreator.d.ts +0 -0
- package/build/{geometry → types/geometry}/index.d.ts +0 -0
- package/build/{graphic → types/graphic}/filters.d.ts +0 -0
- package/build/types/index.d.ts +37 -4
- package/build/{store → types/store}/index.d.ts +0 -0
- package/build/{store → types/store}/states/buerli.d.ts +0 -0
- package/build/{store → types/store}/states/cad.d.ts +0 -0
- package/build/{store → types/store}/states/drawing.d.ts +0 -0
- package/build/{store → types/store}/states/geometry.d.ts +0 -0
- package/build/{store → types/store}/states/graphic.d.ts +0 -0
- package/build/{store → types/store}/states/interaction.d.ts +0 -0
- package/build/{store → types/store}/states/message.d.ts +0 -0
- package/build/{store → types/store}/states/plugin.d.ts +0 -0
- package/build/{store → types/store}/states/selection.d.ts +0 -0
- package/build/{store → types/store}/states/structure.d.ts +0 -0
- package/build/{store → types/store}/store.d.ts +0 -0
- package/build/{store → types/store}/subscribtion/selection.d.ts +0 -0
- package/build/{store → types/store}/subscribtion/subscribeToDrawing.d.ts +0 -0
- package/build/types/{IGraphicPackage.d.ts → types/IGraphicPackage.d.ts} +0 -0
- package/build/types/{IStructurePatch.d.ts → types/IStructurePatch.d.ts} +0 -0
- package/build/types/{IStructureTree.d.ts → types/IStructureTree.d.ts} +0 -0
- package/build/types/{InteractionInfo.d.ts → types/InteractionInfo.d.ts} +0 -0
- package/build/types/types/index.d.ts +4 -0
- package/build/{utils → types/utils}/Math.d.ts +0 -0
- package/build/{utils → types/utils}/Measure.d.ts +0 -0
- package/build/{utils → types/utils}/Timing.d.ts +0 -0
- package/package.json +7 -7
- package/build/index.d.ts +0 -37
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Timing = void 0;
|
|
4
|
+
const uuid_1 = require("uuid");
|
|
5
|
+
const cache = {};
|
|
6
|
+
const start = (key = (0, uuid_1.v4)()) => {
|
|
7
|
+
cache[key] = { startTime: performance.now(), previousTime: performance.now() };
|
|
8
|
+
return key;
|
|
9
|
+
};
|
|
10
|
+
const measure = (key, mode = 'fromStart') => {
|
|
11
|
+
if (!cache[key])
|
|
12
|
+
return Number.NaN;
|
|
13
|
+
const curr = performance.now();
|
|
14
|
+
const prev = mode === 'fromPrevious' ? cache[key].previousTime : cache[key].startTime;
|
|
15
|
+
cache[key] = Object.assign(Object.assign({}, cache[key]), { previousTime: curr });
|
|
16
|
+
return curr - prev;
|
|
17
|
+
};
|
|
18
|
+
const stop = (key) => {
|
|
19
|
+
if (!cache[key])
|
|
20
|
+
return Number.NaN;
|
|
21
|
+
const curr = performance.now();
|
|
22
|
+
const prev = cache[key].startTime;
|
|
23
|
+
delete cache[key];
|
|
24
|
+
return curr - prev;
|
|
25
|
+
};
|
|
26
|
+
const dump = (key, message = '', mode = 'fromStart') => {
|
|
27
|
+
console.info(`${message ? message : key + ':'} ${measure(key, mode).toFixed(2)}ms`);
|
|
28
|
+
};
|
|
29
|
+
exports.Timing = {
|
|
30
|
+
start,
|
|
31
|
+
stop,
|
|
32
|
+
measure,
|
|
33
|
+
dump,
|
|
34
|
+
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,4 +1,37 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
1
|
+
export * from './store';
|
|
2
|
+
export * from './geometry';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './utils/Math';
|
|
5
|
+
export * from './utils/Measure';
|
|
6
|
+
export * from './utils/Timing';
|
|
7
|
+
export * from './store/subscribtion/subscribeToDrawing';
|
|
8
|
+
export * from './graphic/filters';
|
|
9
|
+
/**
|
|
10
|
+
* Because babel typescript tools can not handle the type definitions
|
|
11
|
+
* in an other way, they have to be re-exported as you can see in this code region.
|
|
12
|
+
*
|
|
13
|
+
* Please have a look at https://github.com/awv-informatik/buerli/pull/129 for more information.
|
|
14
|
+
*/
|
|
15
|
+
import { BuerliState as BS } from './store/states/buerli';
|
|
16
|
+
export declare type BuerliState = BS;
|
|
17
|
+
import { DrawingAPI as DrawingAPI1, DrawingID as DrawingID1, DrawingState as DrawingState1 } from './store/states/drawing';
|
|
18
|
+
export declare type DrawingID = DrawingID1;
|
|
19
|
+
export declare type DrawingState = DrawingState1;
|
|
20
|
+
export declare type DrawingAPI = DrawingAPI1;
|
|
21
|
+
import { GeometryConfig as GeometryConfig1, GeometryBounds as GeometryBounds1 } from './store/states/geometry';
|
|
22
|
+
export declare type GeometryConfig = GeometryConfig1;
|
|
23
|
+
export declare type GeometryBounds = GeometryBounds1;
|
|
24
|
+
import { Plugin as Plugin1, PluginDescription as PluginDescription1, PluginID as PluginID1, PluginState as PluginState1 } from './store/states/plugin';
|
|
25
|
+
export declare type Plugin = Plugin1;
|
|
26
|
+
export declare type PluginDescription<InternalState = any> = PluginDescription1<InternalState>;
|
|
27
|
+
export declare type PluginID = PluginID1;
|
|
28
|
+
export declare type PluginState<InternalState extends Record<any, any> = any> = PluginState1<InternalState>;
|
|
29
|
+
import { SeletedItemData, SelectedItem as SelectedItem1, SelectionFilter as SelectionFilter1, SelectionScope as SelectionScope1, Selector as Selector1, SelectorID as SelectorID1, CustomSelect as CustomSelect1 } from './store/states/selection';
|
|
30
|
+
export declare type SelectedItem<T extends SeletedItemData<any> = any> = SelectedItem1<T>;
|
|
31
|
+
export declare type SelectionFilter = SelectionFilter1;
|
|
32
|
+
export declare type SelectionScope = SelectionScope1;
|
|
33
|
+
export declare type Selector<T extends SeletedItemData<any> = any> = Selector1<T>;
|
|
34
|
+
export declare type SelectorID = SelectorID1;
|
|
35
|
+
export declare type CustomSelect = CustomSelect1;
|
|
36
|
+
import { Message as Message1 } from './store/states/message';
|
|
37
|
+
export declare type Message = Message1;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buerli.io/core",
|
|
3
|
-
"version": "0.5.0-beta.
|
|
3
|
+
"version": "0.5.0-beta.3",
|
|
4
4
|
"description": "buerli state management",
|
|
5
5
|
"author": "AWV Informatik AG <info@awv-informatik.ch>",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"repository": {},
|
|
8
|
-
"main": "build/index.js",
|
|
9
|
-
"module": "build/index.js",
|
|
10
|
-
"types": "build/index.d.ts",
|
|
8
|
+
"main": "build/cjs/index.js",
|
|
9
|
+
"module": "build/esm/index.js",
|
|
10
|
+
"types": "build/types/index.d.ts",
|
|
11
11
|
"sideEffects": false,
|
|
12
12
|
"scripts": {
|
|
13
13
|
"ver": "npm version",
|
|
14
|
-
"prepack": "npm run clean && npm run build",
|
|
15
|
-
"clean": "rimraf ./build && rimraf ./coverage && rimraf
|
|
14
|
+
"prepack": "npm run clean && npm run build -- --sourceMap false && npm run build:cjs -- --sourceMap false",
|
|
15
|
+
"clean": "rimraf ./build* && rimraf ./coverage && rimraf tsconfig.tsbuildinfo",
|
|
16
16
|
"build": "tsc -v && tsc",
|
|
17
|
-
"build:
|
|
17
|
+
"build:cjs": "tsc --target es2017 --module commonjs --composite false --declaration false --declarationDir null --outDir ./build/cjs",
|
|
18
18
|
"lint": "eslint \"./src/**/*.ts?(x)\"",
|
|
19
19
|
"test": "jest",
|
|
20
20
|
"coverage": "npm run clean && npm run build && npm run jestLite -- --coverage",
|
package/build/index.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export * from './store';
|
|
2
|
-
export * from './geometry';
|
|
3
|
-
export * from './types';
|
|
4
|
-
export * from './utils/Math';
|
|
5
|
-
export * from './utils/Measure';
|
|
6
|
-
export * from './utils/Timing';
|
|
7
|
-
export * from './store/subscribtion/subscribeToDrawing';
|
|
8
|
-
export * from './graphic/filters';
|
|
9
|
-
/**
|
|
10
|
-
* Because babel typescript tools can not handle the type definitions
|
|
11
|
-
* in an other way, they have to be re-exported as you can see in this code region.
|
|
12
|
-
*
|
|
13
|
-
* Please have a look at https://github.com/awv-informatik/buerli/pull/129 for more information.
|
|
14
|
-
*/
|
|
15
|
-
import { BuerliState as BS } from './store/states/buerli';
|
|
16
|
-
export declare type BuerliState = BS;
|
|
17
|
-
import { DrawingAPI as DrawingAPI1, DrawingID as DrawingID1, DrawingState as DrawingState1 } from './store/states/drawing';
|
|
18
|
-
export declare type DrawingID = DrawingID1;
|
|
19
|
-
export declare type DrawingState = DrawingState1;
|
|
20
|
-
export declare type DrawingAPI = DrawingAPI1;
|
|
21
|
-
import { GeometryConfig as GeometryConfig1, GeometryBounds as GeometryBounds1 } from './store/states/geometry';
|
|
22
|
-
export declare type GeometryConfig = GeometryConfig1;
|
|
23
|
-
export declare type GeometryBounds = GeometryBounds1;
|
|
24
|
-
import { Plugin as Plugin1, PluginDescription as PluginDescription1, PluginID as PluginID1, PluginState as PluginState1 } from './store/states/plugin';
|
|
25
|
-
export declare type Plugin = Plugin1;
|
|
26
|
-
export declare type PluginDescription<InternalState = any> = PluginDescription1<InternalState>;
|
|
27
|
-
export declare type PluginID = PluginID1;
|
|
28
|
-
export declare type PluginState<InternalState extends Record<any, any> = any> = PluginState1<InternalState>;
|
|
29
|
-
import { SeletedItemData, SelectedItem as SelectedItem1, SelectionFilter as SelectionFilter1, SelectionScope as SelectionScope1, Selector as Selector1, SelectorID as SelectorID1, CustomSelect as CustomSelect1 } from './store/states/selection';
|
|
30
|
-
export declare type SelectedItem<T extends SeletedItemData<any> = any> = SelectedItem1<T>;
|
|
31
|
-
export declare type SelectionFilter = SelectionFilter1;
|
|
32
|
-
export declare type SelectionScope = SelectionScope1;
|
|
33
|
-
export declare type Selector<T extends SeletedItemData<any> = any> = Selector1<T>;
|
|
34
|
-
export declare type SelectorID = SelectorID1;
|
|
35
|
-
export declare type CustomSelect = CustomSelect1;
|
|
36
|
-
import { Message as Message1 } from './store/states/message';
|
|
37
|
-
export declare type Message = Message1;
|