@realsee/dnalogel 2.0.0-alpha.36 → 2.0.0-alpha.39

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.
Files changed (118) hide show
  1. package/dist/ItemLabelPlugin/index.js +60 -36
  2. package/dist/ItemLabelPlugin/typings.d.ts +4 -0
  3. package/dist/ModelViewPlugin/Plugin.d.ts +4 -4
  4. package/dist/ModelViewPlugin/index.js +2 -3
  5. package/dist/PanoRulerProPlugin/Controller.d.ts +15 -0
  6. package/dist/PanoRulerProPlugin/index.d.ts +8 -0
  7. package/dist/PanoRulerProPlugin/index.js +1006 -0
  8. package/dist/PanoRulerProPlugin/typings.d.ts +46 -0
  9. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -1
  10. package/dist/floorplan/ModelFloorplanPlugin/index.js +8 -1
  11. package/dist/index.d.ts +2 -0
  12. package/dist/index.es.js +1036 -243
  13. package/dist/index.js +1037 -242
  14. package/dist/index.umd.js +1037 -242
  15. package/dist/shared-utils/logger.d.ts +16 -0
  16. package/docs/assets/search.js +1 -1
  17. package/docs/classes/Magnifier.html +4 -4
  18. package/docs/classes/ModelRoomLabelController.html +4 -4
  19. package/docs/enums/CameraMovementEffect.html +2 -2
  20. package/docs/enums/DIRECTION.html +1 -1
  21. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
  22. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  23. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
  24. package/docs/enums/Rotation.html +2 -2
  25. package/docs/index.html +2 -2
  26. package/docs/interfaces/CSS3DRenderPluginExportType.html +2 -2
  27. package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
  28. package/docs/interfaces/FloorplanBounding.html +4 -4
  29. package/docs/interfaces/FloorplanData.html +2 -2
  30. package/docs/interfaces/FloorplanEntrance.html +7 -7
  31. package/docs/interfaces/FloorplanExtraObject.html +3 -3
  32. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  33. package/docs/interfaces/FloorplanFloorData.html +2 -2
  34. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  35. package/docs/interfaces/FloorplanObserver.html +2 -2
  36. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  37. package/docs/interfaces/FloorplanPosition.html +2 -2
  38. package/docs/interfaces/FloorplanRoomItem.html +6 -6
  39. package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
  40. package/docs/interfaces/FloorplanServerBounding.html +4 -4
  41. package/docs/interfaces/FloorplanServerComputedData.html +1 -1
  42. package/docs/interfaces/FloorplanServerData.html +2 -2
  43. package/docs/interfaces/FloorplanServerEntrance.html +7 -7
  44. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  45. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  46. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  47. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  48. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  49. package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
  50. package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
  51. package/docs/interfaces/ItemLabelPluginData.html +1 -1
  52. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
  53. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
  54. package/docs/interfaces/LineJson.html +1 -1
  55. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  56. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  57. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  58. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  59. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  60. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  61. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  62. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  63. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  64. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  65. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  66. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  67. package/docs/interfaces/ModelViewPluginExportType.html +1 -1
  68. package/docs/interfaces/OpenParameter.html +2 -2
  69. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  70. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  71. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  72. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  73. package/docs/interfaces/PanoMeasureParameterType.html +1 -1
  74. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  75. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  76. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  77. package/docs/interfaces/PanoRulerProPluginExportType.html +1 -0
  78. package/docs/interfaces/PanoRulerProPluginOptions.html +1 -0
  79. package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -0
  80. package/docs/interfaces/PanoRulerProPluginState.html +1 -0
  81. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  82. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  83. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  84. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
  85. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  86. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
  87. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  88. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
  89. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
  90. package/docs/interfaces/Point.html +1 -1
  91. package/docs/interfaces/PointJson.html +1 -1
  92. package/docs/interfaces/Room.html +1 -1
  93. package/docs/interfaces/RoomInfo.html +1 -1
  94. package/docs/interfaces/RoomLabel.html +7 -7
  95. package/docs/interfaces/RoomRules.html +1 -1
  96. package/docs/interfaces/Rooms.html +1 -1
  97. package/docs/modules.html +19 -17
  98. package/libs/ItemLabelPlugin/ItemLabelComponent.js +34 -21
  99. package/libs/ItemLabelPlugin/Plugin.js +16 -10
  100. package/libs/ItemLabelPlugin/typings.d.ts +4 -0
  101. package/libs/ItemLabelPlugin/utils/parseData.js +1 -1
  102. package/libs/ModelViewPlugin/Plugin.d.ts +4 -4
  103. package/libs/ModelViewPlugin/Plugin.js +2 -3
  104. package/libs/PanoRulerProPlugin/Controller.d.ts +15 -0
  105. package/libs/PanoRulerProPlugin/Controller.js +110 -0
  106. package/libs/PanoRulerProPlugin/RulerItem.js +314 -0
  107. package/libs/PanoRulerProPlugin/RulerItems.js +377 -0
  108. package/libs/PanoRulerProPlugin/index.d.ts +8 -0
  109. package/libs/PanoRulerProPlugin/index.js +8 -0
  110. package/libs/PanoRulerProPlugin/typings.d.ts +46 -0
  111. package/libs/PanoRulerProPlugin/typings.js +1 -0
  112. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -1
  113. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +8 -1
  114. package/libs/index.d.ts +2 -0
  115. package/libs/index.js +3 -0
  116. package/libs/shared-utils/logger.d.ts +16 -0
  117. package/libs/shared-utils/logger.js +47 -0
  118. package/package.json +1 -1
@@ -0,0 +1,46 @@
1
+ export declare type PanoRulerProPluginDatas = {
2
+ data: PanoRulerProPluginData[];
3
+ version: number;
4
+ };
5
+ export interface PanoRulerProPluginData {
6
+ panoIndex: number;
7
+ roomName: string;
8
+ lines: Line[];
9
+ }
10
+ interface Line {
11
+ start: number[];
12
+ end: number[];
13
+ state: boolean;
14
+ children?: Line[];
15
+ }
16
+ export interface PanoRulerProPluginOptions {
17
+ distanceText?: (distance: number) => string;
18
+ className?: string;
19
+ }
20
+ export interface PanoRulerProPluginState {
21
+ enabled: boolean;
22
+ loaded: boolean;
23
+ options: PanoRulerProPluginOptions;
24
+ }
25
+ export interface PanoRulerProPluginParameterType {
26
+ data?: PanoRulerProPluginDatas;
27
+ options?: PanoRulerProPluginOptions;
28
+ }
29
+ export interface PanoRulerProPluginExportType {
30
+ enable: () => void;
31
+ disable: () => void;
32
+ load: (serverData: PanoRulerProPluginDatas) => void;
33
+ state: PanoRulerProPluginState;
34
+ }
35
+ export interface RulerItemProp {
36
+ width: number;
37
+ left: number;
38
+ top: number;
39
+ rotateDeg: number;
40
+ state: boolean;
41
+ children: any[];
42
+ labelOffset: number;
43
+ labelElement: string;
44
+ visible: boolean;
45
+ }
46
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -2,7 +2,7 @@ import type { BaseOptions } from '../../base/BasePlugin';
2
2
  import type { Five } from '@realsee/five';
3
3
  import type { ShowState } from '../utils/correctFiveState';
4
4
  import type { FloorplanServerData } from '../typings/floorplanServerData';
5
- import type { State, EventMap, ShowOptions, HideOptions, Parameters, PluginData, PluginServerData } from './typing';
5
+ import type { State, Config, EventMap, ShowOptions, HideOptions, Parameters, PluginData, PluginServerData } from './typing';
6
6
  import * as BasePlugin from '../../base/BasePluginWithData';
7
7
  export declare class Controller extends BasePlugin.Controller<State, EventMap, PluginServerData, PluginData> {
8
8
  name: string;
@@ -57,6 +57,7 @@ export declare class Controller extends BasePlugin.Controller<State, EventMap, P
57
57
  hide: (options?: Partial<HideOptions>) => Promise<void>;
58
58
  /** 更改插件 State */
59
59
  setState(state: Partial<State>, options?: BaseOptions): void;
60
+ changeConfigs(_config: Partial<Config>, userAction?: boolean): void;
60
61
  /** 更新户型图大小 */
61
62
  updateSize: () => void;
62
63
  protected formatData(serverData: PluginServerData): Promise<PluginData>;
@@ -449,7 +449,7 @@ export class Controller extends BasePlugin.Controller {
449
449
  const fiveCurrentState = this.five.getCurrentState();
450
450
  if (shouldFloorplanHideWithPose(fiveCurrentState)) {
451
451
  this.updateState({ visible: false }, userAction);
452
- this._hide({ userAction });
452
+ this._hide({ userAction, isAutoHide: true });
453
453
  }
454
454
  }
455
455
  });
@@ -622,6 +622,13 @@ export class Controller extends BasePlugin.Controller {
622
622
  state.visible ? this._show(options) : this._hide(options);
623
623
  }
624
624
  }
625
+ changeConfigs(_config, userAction = true) {
626
+ const config = Object.assign(Object.assign({}, this.state.config), _config);
627
+ this.updateState({ config }, userAction);
628
+ if (!this.container)
629
+ return;
630
+ this.render();
631
+ }
625
632
  async formatData(serverData) {
626
633
  return await formatData(serverData.data);
627
634
  }
package/libs/index.d.ts CHANGED
@@ -7,9 +7,11 @@ export * from './ModelChassisCompassPlugin';
7
7
  export * from './ModelEntryDoorGuidePlugin';
8
8
  export * from './CameraMovementPlugin';
9
9
  export * from './PanoRulerPlugin';
10
+ export * from './PanoRulerProPlugin';
10
11
  export * from './PanoCompassPlugin';
11
12
  export * from './PanoMeasurePlugin';
12
13
  export * from './PanoSpatialTagPlugin';
13
14
  export * from './ModelItemLabelPlugin';
14
15
  export * from './ModelTVVideoPlugin';
15
16
  export * from './ItemLabelPlugin';
17
+ export declare const DnalogelVersion = "2.0.0-alpha.38";
package/libs/index.js CHANGED
@@ -12,6 +12,8 @@ export * from './ModelEntryDoorGuidePlugin';
12
12
  export * from './CameraMovementPlugin';
13
13
  // 全景标尺
14
14
  export * from './PanoRulerPlugin';
15
+ // 全景标尺Pro版
16
+ export * from './PanoRulerProPlugin';
15
17
  // 全景指南针
16
18
  export * from './PanoCompassPlugin';
17
19
  // pc 全景测量工具
@@ -24,3 +26,4 @@ export * from './ModelItemLabelPlugin';
24
26
  export * from './ModelTVVideoPlugin';
25
27
  // 物品标签
26
28
  export * from './ItemLabelPlugin';
29
+ export const DnalogelVersion = '2.0.0-alpha.38';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * 输出格式化日志
3
+ */
4
+ export declare enum LOG_LEVEL {
5
+ info = "INFO",
6
+ log = "LOG",
7
+ error = "ERROR",
8
+ warn = "WARN"
9
+ }
10
+ export declare const logger: {
11
+ log: (...args: any[]) => void;
12
+ info: (...args: any[]) => void;
13
+ error: (...args: any[]) => void;
14
+ warn: (...args: any[]) => void;
15
+ };
16
+ export default logger;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * 输出格式化日志
3
+ */
4
+ // 获取当前时间
5
+ const getTime = () => {
6
+ const date = new Date();
7
+ const year = date.getFullYear();
8
+ const month = (date.getMonth() + 1).toString().padStart(2, '0'); //月份是从0开始的
9
+ const day = date.getDate().toString().padStart(2, '0');
10
+ const hour = date.getHours().toString().padStart(2, '0');
11
+ const min = date.getMinutes().toString().padStart(2, '0');
12
+ const sec = date.getSeconds().toString().padStart(2, '0');
13
+ const ms = date.getMilliseconds();
14
+ return `[${year}-${month}-${day} ${hour}:${min}:${sec}.${ms}]`;
15
+ };
16
+ export var LOG_LEVEL;
17
+ (function (LOG_LEVEL) {
18
+ LOG_LEVEL["info"] = "INFO";
19
+ LOG_LEVEL["log"] = "LOG";
20
+ LOG_LEVEL["error"] = "ERROR";
21
+ LOG_LEVEL["warn"] = "WARN";
22
+ })(LOG_LEVEL || (LOG_LEVEL = {}));
23
+ // 输出日志
24
+ const echo = (logLevel, args = []) => {
25
+ args.unshift(`@realsee/dnalogel ${getTime()} <${logLevel}> `);
26
+ switch (logLevel) {
27
+ case LOG_LEVEL.info:
28
+ return console.info(...args);
29
+ case LOG_LEVEL.error:
30
+ return console.error(...args);
31
+ case LOG_LEVEL.warn:
32
+ return console.warn(...args);
33
+ default:
34
+ return console.log(...args);
35
+ }
36
+ };
37
+ const log = (...args) => echo(LOG_LEVEL.log, args);
38
+ const info = (...args) => echo(LOG_LEVEL.info, args);
39
+ const error = (...args) => echo(LOG_LEVEL.error, args);
40
+ const warn = (...args) => echo(LOG_LEVEL.warn, args);
41
+ export const logger = {
42
+ log,
43
+ info,
44
+ error,
45
+ warn,
46
+ };
47
+ export default logger;
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "repository": "https://github.com/realsee-developer/dnalogel.git",
9
9
  "description": "如视 VR 看房插件合集",
10
10
  "private": false,
11
- "version": "2.0.0-alpha.36",
11
+ "version": "2.0.0-alpha.39",
12
12
  "license": "SEE LICENSE IN TERMS.txt",
13
13
  "scripts": {
14
14
  "build": "yarn run tsb && yarn run build:rollup && yarn run build:components && yarn build:docs",