utopia-ui 3.0.82 → 3.0.83

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.
@@ -3,9 +3,10 @@ export type { AssetsApi } from '#types/AssetsApi';
3
3
  /**
4
4
  * @category AppShell
5
5
  */
6
- export declare function AppShell({ appName, children, assetsApi, embedded, }: {
6
+ export declare function AppShell({ appName, children, assetsApi, embedded, openCollectiveApiKey, }: {
7
7
  appName: string;
8
8
  children: React.ReactNode;
9
9
  assetsApi: AssetsApi;
10
10
  embedded?: boolean;
11
+ openCollectiveApiKey?: string;
11
12
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import type { AssetsApi } from '#types/AssetsApi';
2
- export declare const SetAppState: ({ assetsApi, embedded, }: {
2
+ export declare const SetAppState: ({ assetsApi, embedded, openCollectiveApiKey, }: {
3
3
  assetsApi: AssetsApi;
4
4
  embedded?: boolean;
5
+ openCollectiveApiKey?: string;
5
6
  }) => import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,9 @@ interface AppState {
3
3
  assetsApi: AssetsApi;
4
4
  sideBarOpen: boolean;
5
5
  sideBarSlim: boolean;
6
+ showThemeControl: boolean;
6
7
  embedded: boolean;
8
+ openCollectiveApiKey: string;
7
9
  }
8
10
  type UseAppManagerResult = ReturnType<typeof useAppManager>;
9
11
  declare function useAppManager(): {
@@ -1,16 +1,37 @@
1
1
  import type { ItemsApi } from '#types/ItemsApi';
2
2
  import type { Permission } from '#types/Permission';
3
- /**
4
- * @category Types
5
- */
6
- export interface PermissionsProps {
7
- data?: Permission[];
8
- api?: ItemsApi<Permission>;
9
- adminRole?: string;
10
- }
11
3
  export type { Permission } from '#types/Permission';
12
4
  export type { ItemsApi } from '#types/ItemsApi';
13
5
  /**
6
+ * This Components injects Permissions comming from an {@link ItemsApi | `API`}
7
+ * ```tsx
8
+ * <Permissions api={itemsApiInstance} adminRole="8141dee8-8e10-48d0-baf1-680aea271298" />
9
+ * ```
10
+ * or from on {@link Permission| `Array`}
11
+ * ```tsx
12
+ * <Permissions data={permissions} adminRole="8141dee8-8e10-48d0-baf1-680aea271298" />
13
+ * ```
14
+ * Can be child of {@link AppShell | `AppShell`}
15
+ * ```tsx
16
+ * <AppShell>
17
+ * ...
18
+ * <Permissions api={itemsApiInstance} adminRole="8141dee8-8e10-48d0-baf1-680aea271298" />
19
+ * </AppShell>
20
+ * ```
21
+ * Or child of {@link UtopiaMap | `UtopiaMap`}
22
+ * ```tsx
23
+ * <UtopiaMap>
24
+ * ...
25
+ * <Permissions api={itemsApiInstance} adminRole="8141dee8-8e10-48d0-baf1-680aea271298" />
26
+ * </UtopiaMap>
27
+ * ```
14
28
  * @category Map
15
29
  */
16
- export declare function Permissions({ data, api, adminRole }: PermissionsProps): import("react/jsx-runtime").JSX.Element;
30
+ export declare function Permissions({ data, api, adminRole, }: {
31
+ /** Array with all the permissions inside */
32
+ data?: Permission[];
33
+ /** API to fetch all the permissions from a server */
34
+ api?: ItemsApi<Permission>;
35
+ /** UUID of the admin role which has always all the permissions */
36
+ adminRole?: string;
37
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,28 @@
1
1
  import type { ItemsApi } from '#types/ItemsApi';
2
2
  import type { Tag } from '#types/Tag';
3
3
  /**
4
+ * This Components injects Tags comming from an {@link ItemsApi | `API`}
5
+ * ```tsx
6
+ * <Tags api={tagsApi} />
7
+ * ```
8
+ * or from on {@link Tag| `Array`}
9
+ * ```tsx
10
+ * <Tags data={tags} />
11
+ * ```
12
+ * Can be child of {@link AppShell | `AppShell`}
13
+ * ```tsx
14
+ * <AppShell>
15
+ * ...
16
+ * <Tags api={tagsApi} />
17
+ * </AppShell>
18
+ * ```
19
+ * Or child of {@link UtopiaMap | `UtopiaMap`}
20
+ * ```tsx
21
+ * <UtopiaMap>
22
+ * ...
23
+ * <Tags api={tagsApi} />
24
+ * </UtopiaMap>
25
+ * ```
4
26
  * @category Map
5
27
  */
6
28
  export declare function Tags({ data, api }: {
@@ -1,6 +1,62 @@
1
- import type { UtopiaMapProps } from '#types/UtopiaMapProps';
1
+ import type { GeoJsonObject } from 'geojson';
2
2
  /**
3
+ * This component creates the map.
4
+ * ```tsx
5
+ * <UtopiaMap center={[50.6, 9.5]} zoom={5} height="100dvh" width="100dvw" />
6
+ * ```
7
+ * You can define its {@link Layer | `Layers`} as supcomponents.
8
+ * ```tsx
9
+ * <UtopiaMap center={[50.6, 15.5]} zoom={5} height="100dvh" width="100dvw">
10
+ * <Layer
11
+ * name="events"
12
+ * markerIcon="calendar"
13
+ * markerShape="square"
14
+ * markerDefaultColor="#700"
15
+ * data={events}
16
+ * />
17
+ * <Layer
18
+ * name="places"
19
+ * markerIcon="point"
20
+ * markerShape="circle"
21
+ * markerDefaultColor="#007"
22
+ * data={places}
23
+ * />
24
+ * </UtopiaMap>
25
+ * ```
26
+ * You can also pass {@link Tags | `Tags`} or {@link Permissions | `Permissions`} as subcomponents.
27
+ * ```tsx
28
+ * <UtopiaMap center={[50.6, 15.5]} zoom={5} height="100dvh" width="100dvw">
29
+ * ...
30
+ * <Tags data={tags} />
31
+ * <Permissions data={permissions} />
32
+ * </UtopiaMap>
33
+ * ```
3
34
  * @category Map
4
35
  */
5
- declare function UtopiaMap({ height, width, center, zoom, children, geo, showFilterControl, showGratitudeControl, showLayerControl, infoText, donationWidget, }: UtopiaMapProps): import("react/jsx-runtime").JSX.Element;
36
+ declare function UtopiaMap({ height, width, center, zoom, children, geo, showFilterControl, showGratitudeControl, showLayerControl, showThemeControl, defaultTheme, donationWidget, }: {
37
+ /** height of the map (default '500px') */
38
+ height?: string;
39
+ /** width of the map (default '100%') */
40
+ width?: string;
41
+ /** initial centered position of the map (default [50.6, 9.5]) */
42
+ center?: [number, number];
43
+ /** initial zoom level of the map (default 10) */
44
+ zoom?: number;
45
+ /** React child-components */
46
+ children?: React.ReactNode;
47
+ /** GeoJSON to display on the map */
48
+ geo?: GeoJsonObject;
49
+ /** show the filter control widget (default false) */
50
+ showFilterControl?: boolean;
51
+ /** show the gratitude control widget (default false) */
52
+ showLayerControl?: boolean;
53
+ /** show the layer control widget (default true) */
54
+ showGratitudeControl?: boolean;
55
+ /** show a widget to switch the theme */
56
+ showThemeControl: boolean;
57
+ /** the defaut theme */
58
+ defaultTheme: string;
59
+ /** ask to donate to the Utopia Project OpenCollective campaign (default false) */
60
+ donationWidget?: boolean;
61
+ }): import("react/jsx-runtime").JSX.Element;
6
62
  export { UtopiaMap };
@@ -1,2 +1,11 @@
1
- import type { UtopiaMapProps } from '#types/UtopiaMapProps';
2
- export declare function UtopiaMapInner({ children, geo, showFilterControl, showGratitudeControl, showLayerControl, donationWidget, }: UtopiaMapProps): import("react/jsx-runtime").JSX.Element;
1
+ import type { GeoJsonObject } from 'geojson';
2
+ export declare function UtopiaMapInner({ children, geo, showFilterControl, showGratitudeControl, showLayerControl, showThemeControl, defaultTheme, donationWidget, }: {
3
+ children?: React.ReactNode;
4
+ geo?: GeoJsonObject;
5
+ showFilterControl?: boolean;
6
+ showLayerControl?: boolean;
7
+ showGratitudeControl?: boolean;
8
+ donationWidget?: boolean;
9
+ showThemeControl?: boolean;
10
+ defaultTheme?: string;
11
+ }): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utopia-ui",
3
- "version": "3.0.82",
3
+ "version": "3.0.83",
4
4
  "description": "Reuseable React Components to build mapping apps for real life communities and networks",
5
5
  "repository": "https://github.com/utopia-os/utopia-ui",
6
6
  "homepage": "https://utopia-os.org/",
@@ -24,6 +24,7 @@
24
24
  "test:component": "cypress run --component --browser electron",
25
25
  "test:unit": "npm run test:unit:dev -- run --coverage",
26
26
  "test:unit:dev": "vitest",
27
+ "test:unit:update": "npm run test:unit:dev -- run --coverage -u",
27
28
  "docs:generate": "typedoc --includeVersion --navigation.includeCategories true --plugin typedoc-plugin-missing-exports --plugin typedoc-plugin-coverage src/index.tsx",
28
29
  "update": "npx npm-check-updates"
29
30
  },
@@ -38,6 +39,7 @@
38
39
  "@rollup/plugin-alias": "^5.1.1",
39
40
  "@rollup/plugin-node-resolve": "^16.0.0",
40
41
  "@rollup/plugin-typescript": "^12.1.2",
42
+ "@tailwindcss/postcss": "^4.0.14",
41
43
  "@testing-library/jest-dom": "^6.6.3",
42
44
  "@testing-library/react": "^16.2.0",
43
45
  "@types/geojson": "^7946.0.14",
@@ -49,9 +51,8 @@
49
51
  "@typescript-eslint/parser": "^5.62.0",
50
52
  "@vitejs/plugin-react": "^4.3.4",
51
53
  "@vitest/coverage-v8": "^3.0.5",
52
- "autoprefixer": "^10.4.14",
53
54
  "cypress": "^14.0.3",
54
- "daisyui": "^4.6.1",
55
+ "daisyui": "^5.0.6",
55
56
  "eslint": "^8.24.0",
56
57
  "eslint-config-prettier": "^9.1.0",
57
58
  "eslint-config-standard": "^17.1.0",
@@ -76,7 +77,7 @@
76
77
  "rollup-plugin-dts": "^6.1.1",
77
78
  "rollup-plugin-postcss": "^4.0.2",
78
79
  "rollup-plugin-svg": "^2.0.0",
79
- "tailwindcss": "^3.3.1",
80
+ "tailwindcss": "^4.0.14",
80
81
  "typedoc": "^0.27.6",
81
82
  "typedoc-plugin-coverage": "^3.4.1",
82
83
  "typedoc-plugin-missing-exports": "^3.1.0",