@mappedin/viewer 0.35.2-826fca7.0 → 0.35.2-a875236.0

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 (23) hide show
  1. package/dist/index.js +59296 -59686
  2. package/dist/types/src/components/button/index.d.ts +5 -1
  3. package/dist/types/src/components/carousel/nav-chevrons.d.ts +1 -0
  4. package/dist/types/src/components/categories-view/active-category.d.ts +9 -0
  5. package/dist/types/src/components/categories-view/categories-view.stories.d.ts +4 -0
  6. package/dist/types/src/components/categories-view/categories.d.ts +10 -0
  7. package/dist/types/src/components/categories-view/category-item.d.ts +15 -0
  8. package/dist/types/src/components/categories-view/category-result-list.d.ts +9 -0
  9. package/dist/types/src/components/categories-view/index.d.ts +7 -0
  10. package/dist/types/src/components/categories-view/utils.d.ts +13 -0
  11. package/dist/types/src/components/categories-view/utils.test.d.ts +1 -0
  12. package/dist/types/src/components/category-icon/category-icon.stories.d.ts +2 -0
  13. package/dist/types/src/components/category-icon/index.d.ts +8 -0
  14. package/dist/types/src/components/common/fullscreen-overlay.d.ts +1 -1
  15. package/dist/types/src/components/directions/warning-text.d.ts +1 -1
  16. package/dist/types/src/components/legacy-metadata-card/card.d.ts +1 -0
  17. package/dist/types/src/components/search-results/search-result.d.ts +2 -1
  18. package/dist/types/src/components/with-content/index.d.ts +1 -1
  19. package/dist/types/src/lib/hooks/use-max-size-list.d.ts +18 -0
  20. package/dist/types/src/lib/hooks/use-max-size-list.test.d.ts +1 -0
  21. package/dist/types/src/lib/types/search.d.ts +2 -0
  22. package/dist/types/src/stores/root-store/index.d.ts +10 -3
  23. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  import { TTheme } from 'lib/types/theme';
2
2
  import { TFocusOutlineOptions, Untrasient } from '../common/utils';
3
- export declare const clickableStyle: import("styled-components").RuleSet<object>;
3
+ export declare const clickableStyle: readonly [import("styled-components").RuleSet<object>, import("styled-components").RuleSet<object>];
4
4
  export type TOnClickOrPressPayload = {
5
5
  type: 'click';
6
6
  event: React.MouseEvent<HTMLDivElement>;
@@ -24,6 +24,10 @@ type TButtonProps = {
24
24
  * If true, the button will be styled as if it is :focus-visible, even when it is not.
25
25
  */
26
26
  pseudoFocus?: boolean;
27
+ /**
28
+ * What hover and active styling set to use.
29
+ */
30
+ clickableStyling?: keyof typeof clickableStyle;
27
31
  } & Untrasient<TFocusOutlineOptions>;
28
32
  /**
29
33
  * Webkit has a bug where the relatedTarget of a focus event is null for buttons. In
@@ -272,6 +272,7 @@ export declare const SideNavButton: import("styled-components").IStyledComponent
272
272
  theme?: TTheme | undefined;
273
273
  disabled?: boolean | undefined;
274
274
  pseudoFocus?: boolean | undefined;
275
+ clickableStyling?: keyof typeof import("../button").clickableStyle | undefined;
275
276
  outlineOffset?: number | undefined;
276
277
  outlineColor?: string | undefined;
277
278
  outlineWidth?: number | undefined;
@@ -0,0 +1,9 @@
1
+ import { TCategory } from '../../lib/types/search';
2
+ import { ComponentProps } from 'react';
3
+ import CategoryResultList from './category-result-list';
4
+ type TActiveCategoryProps = ComponentProps<typeof CategoryResultList> & {
5
+ category: TCategory;
6
+ onBackClick?: () => void;
7
+ };
8
+ declare const ActiveCategory: React.FC<TActiveCategoryProps>;
9
+ export default ActiveCategory;
@@ -0,0 +1,4 @@
1
+ import { Story } from '@ladle/react';
2
+ export declare const Item: Story;
3
+ export declare const Content: Story;
4
+ export declare const Default: Story;
@@ -0,0 +1,10 @@
1
+ import { TCategory } from '../../lib/types/search';
2
+ type TCategoriesProps = {
3
+ categories: TCategory[];
4
+ activeCategoryId?: string;
5
+ onCategoryClick?: (categoryId: string) => void;
6
+ onResultClick?: (ids: string[]) => void;
7
+ onBackClick?: () => void;
8
+ };
9
+ declare const Categories: import("react").ForwardRefExoticComponent<TCategoriesProps & import("react").RefAttributes<HTMLDivElement>>;
10
+ export default Categories;
@@ -0,0 +1,15 @@
1
+ import CategoryIcon from '../category-icon';
2
+ import { ComponentProps } from 'react';
3
+ type TCategoryItemProps = {
4
+ name: string;
5
+ className?: string;
6
+ icon?: ComponentProps<typeof CategoryIcon>['icon'];
7
+ onClick?: () => void;
8
+ textStyle?: React.CSSProperties;
9
+ style?: React.CSSProperties;
10
+ pseudoFocus?: boolean;
11
+ tabIndex?: number;
12
+ left?: React.ReactNode;
13
+ };
14
+ declare const CategoryItem: import("react").ForwardRefExoticComponent<TCategoryItemProps & import("react").RefAttributes<HTMLLIElement>>;
15
+ export default CategoryItem;
@@ -0,0 +1,9 @@
1
+ import { TCategory } from '../../lib/types/search';
2
+ type TListItem = TCategory['results'][number] | TCategory;
3
+ type TCategoryResultListProps = {
4
+ results: TListItem[];
5
+ onCategoryClick?: (categoryId: string) => void;
6
+ onResultClick?: (ids: string[]) => void;
7
+ };
8
+ declare const CategoryResultList: React.FC<TCategoryResultListProps>;
9
+ export default CategoryResultList;
@@ -0,0 +1,7 @@
1
+ import { ComponentProps } from 'react';
2
+ import Categories from './categories';
3
+ type TCategoriesViewProps = {
4
+ visible: boolean;
5
+ } & ComponentProps<typeof Categories>;
6
+ declare const CategoriesView: React.FC<TCategoriesViewProps>;
7
+ export default CategoriesView;
@@ -0,0 +1,13 @@
1
+ import { TCategory } from '../../lib/types/search';
2
+ export declare const CATEGORY_CARD_TOP_BOTTOM_PADDING = 8;
3
+ export declare const CATEGORY_ITEM_HEIGHT = 40;
4
+ export declare const MAX_CATEGORIES_DESKTOP: 6.5;
5
+ export declare const MAX_CATEGORIES_MOBILE: 4.5;
6
+ export declare const useActiveCategory: (categories: TCategory[], activeCategoryId: string | undefined) => {
7
+ activeCategory: TCategory | undefined;
8
+ rootCategories: TCategory[];
9
+ results: ({
10
+ label: string;
11
+ ids: string[];
12
+ } | TCategory)[];
13
+ };
@@ -0,0 +1,2 @@
1
+ import { Story } from '@ladle/react';
2
+ export declare const Default: Story;
@@ -0,0 +1,8 @@
1
+ type TCategoryIconProps = {
2
+ className?: string;
3
+ icon?: string | React.ReactElement;
4
+ size?: number;
5
+ style?: React.CSSProperties;
6
+ };
7
+ declare const CategoryIcon: React.FC<TCategoryIconProps>;
8
+ export default CategoryIcon;
@@ -13,7 +13,6 @@ export declare const FullscreenOverlay: import("styled-components").IStyledCompo
13
13
  children?: import("react").ReactNode | Iterable<import("react").ReactNode>;
14
14
  nonce?: string | undefined | undefined;
15
15
  tabIndex?: number | undefined | undefined;
16
- onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
17
16
  key?: import("react").Key | null | undefined;
18
17
  defaultChecked?: boolean | undefined | undefined;
19
18
  defaultValue?: string | number | readonly string[] | undefined;
@@ -194,6 +193,7 @@ export declare const FullscreenOverlay: import("styled-components").IStyledCompo
194
193
  onWaitingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
195
194
  onAuxClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
196
195
  onAuxClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
196
+ onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
197
197
  onClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
198
198
  onContextMenu?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
199
199
  onContextMenuCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
@@ -14,7 +14,6 @@ declare const WarningText: import("styled-components").IStyledComponent<"web", i
14
14
  children?: import("react").ReactNode | Iterable<import("react").ReactNode>;
15
15
  nonce?: string | undefined | undefined;
16
16
  tabIndex?: number | undefined | undefined;
17
- onClick?: import("react").MouseEventHandler<HTMLParagraphElement> | undefined;
18
17
  key?: import("react").Key | null | undefined;
19
18
  defaultChecked?: boolean | undefined | undefined;
20
19
  defaultValue?: string | number | readonly string[] | undefined;
@@ -195,6 +194,7 @@ declare const WarningText: import("styled-components").IStyledComponent<"web", i
195
194
  onWaitingCapture?: import("react").ReactEventHandler<HTMLParagraphElement> | undefined;
196
195
  onAuxClick?: import("react").MouseEventHandler<HTMLParagraphElement> | undefined;
197
196
  onAuxClickCapture?: import("react").MouseEventHandler<HTMLParagraphElement> | undefined;
197
+ onClick?: import("react").MouseEventHandler<HTMLParagraphElement> | undefined;
198
198
  onClickCapture?: import("react").MouseEventHandler<HTMLParagraphElement> | undefined;
199
199
  onContextMenu?: import("react").MouseEventHandler<HTMLParagraphElement> | undefined;
200
200
  onContextMenuCapture?: import("react").MouseEventHandler<HTMLParagraphElement> | undefined;
@@ -1,6 +1,7 @@
1
1
  import React, { ComponentProps } from 'react';
2
2
  import { TOnClickOrPressPayload } from '../button';
3
3
  import DetailsSection from './details-section';
4
+ export declare const METADATA_CARD_WIDTH_DESKTOP = 320;
4
5
  export type TMetadataCardProps = {
5
6
  name: ComponentProps<typeof DetailsSection>['name'];
6
7
  description?: ComponentProps<typeof DetailsSection>['description'];
@@ -1,6 +1,6 @@
1
1
  import { TSearchResult } from '../../lib/types/search';
2
2
  import { TTheme } from '../../lib/types/theme';
3
- export declare const SEARCH_RESULT_MAX_WIDTH_DESKTOP: 320;
3
+ export declare const SEARCH_RESULT_MAX_WIDTH_DESKTOP = 320;
4
4
  export declare const SEARCH_RESULT_HEIGHT: 38;
5
5
  export declare const SEARCH_RESULT_HEIGHT_WITH_MATCH_DETAILS: 48;
6
6
  export declare const ResultWrapper: import("styled-components").IStyledComponent<"web", {
@@ -276,6 +276,7 @@ export declare const ResultWrapper: import("styled-components").IStyledComponent
276
276
  theme?: TTheme | undefined;
277
277
  disabled?: boolean | undefined;
278
278
  pseudoFocus?: boolean | undefined;
279
+ clickableStyling?: keyof typeof import("../button").clickableStyle | undefined;
279
280
  outlineOffset?: number | undefined;
280
281
  outlineColor?: string | undefined;
281
282
  outlineWidth?: number | undefined;
@@ -13,7 +13,6 @@ declare const Wrapper: import("styled-components").IStyledComponent<"web", {
13
13
  children?: import("react").ReactNode | Iterable<import("react").ReactNode>;
14
14
  nonce?: string | undefined | undefined;
15
15
  tabIndex?: number | undefined | undefined;
16
- onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
17
16
  key?: import("react").Key | null | undefined;
18
17
  defaultChecked?: boolean | undefined | undefined;
19
18
  defaultValue?: string | number | readonly string[] | undefined;
@@ -194,6 +193,7 @@ declare const Wrapper: import("styled-components").IStyledComponent<"web", {
194
193
  onWaitingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
195
194
  onAuxClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
196
195
  onAuxClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
196
+ onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
197
197
  onClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
198
198
  onContextMenu?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
199
199
  onContextMenuCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
@@ -0,0 +1,18 @@
1
+ import { VariableSizeList } from 'react-window';
2
+ type TUseMaxHeightListProps<T> = {
3
+ maxSize: number;
4
+ itemSize: number | ((index: number) => number);
5
+ items: T[];
6
+ ref?: React.RefObject<VariableSizeList>;
7
+ };
8
+ /**
9
+ * Returns some props that can be used with a react-window list to have the list grow naturally
10
+ * until a max size is reached. Optionally, a VariableSizeList ref can be provided to reset the
11
+ * list cache when the items change.
12
+ */
13
+ declare const useMaxSizeList: <T>({ maxSize, itemSize, items, ref }: TUseMaxHeightListProps<T>) => {
14
+ size: number;
15
+ totalSize: number;
16
+ itemSize: number[];
17
+ };
18
+ export default useMaxSizeList;
@@ -16,6 +16,8 @@ export type TSearchResult = {
16
16
  export type TCategory = {
17
17
  id: string;
18
18
  name: string;
19
+ icon?: string;
20
+ parent?: string;
19
21
  results: {
20
22
  label: string;
21
23
  ids: string[];
@@ -107,7 +107,7 @@ declare class RootStore {
107
107
  get initialPitch(): number | undefined;
108
108
  get initialBearing(): number | undefined;
109
109
  get exteriorDoors(): {
110
- "__#17@#private": any;
110
+ "__#15@#private": any;
111
111
  readonly __type: "door";
112
112
  readonly name: string;
113
113
  readonly externalId: string;
@@ -115,6 +115,13 @@ declare class RootStore {
115
115
  readonly floor: Floor;
116
116
  readonly center: Coordinate;
117
117
  readonly isExterior: boolean;
118
+ readonly geoJSON: {
119
+ properties: null;
120
+ type: import("@mappedin/mvf").FeatureType;
121
+ geometry: import("@mappedin/mvf").LineString;
122
+ };
123
+ readonly focusTarget: Coordinate;
124
+ readonly anchorTarget: Coordinate;
118
125
  toJSON(): {
119
126
  id: string;
120
127
  name: string;
@@ -128,7 +135,7 @@ declare class RootStore {
128
135
  destroy(): void;
129
136
  readonly id: string;
130
137
  links: {
131
- "__#24@#private": any;
138
+ "__#22@#private": any;
132
139
  readonly url: string;
133
140
  readonly name: string | undefined;
134
141
  toJSON(): {
@@ -140,7 +147,7 @@ declare class RootStore {
140
147
  readonly id: string;
141
148
  }[];
142
149
  images: {
143
- "__#25@#private": any;
150
+ "__#23@#private": any;
144
151
  readonly url: string | undefined;
145
152
  readonly name: string | undefined;
146
153
  readonly altText: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mappedin/viewer",
3
- "version": "0.35.2-826fca7.0",
3
+ "version": "0.35.2-a875236.0",
4
4
  "type": "module",
5
5
  "browser": "./dist/index.js",
6
6
  "license": "UNLICENSED",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@ladle/react": "^2.17.2",
21
- "@mappedin/mappedin-js": "6.0.1-beta.24",
21
+ "@mappedin/mappedin-js": "6.0.1-beta.29",
22
22
  "@mappedin/mvf": "2.0.1-a2db810.0",
23
23
  "@mappedin/self-serve-icons": "1.70.1-alpha.bl-SRV-2032.1739993160",
24
24
  "@testing-library/jest-dom": "^6.6.2",