@eventvisor/catalog 0.0.2 → 0.21.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 (42) hide show
  1. package/CHANGELOG.md +114 -0
  2. package/LICENSE +21 -0
  3. package/components.json +22 -0
  4. package/dist/assets/index-B8NMB5dQ.js +24 -0
  5. package/dist/assets/index-DdncAyM-.css +1 -0
  6. package/dist/catalog.json +297 -0
  7. package/dist/img/logo-text.png +0 -0
  8. package/dist/img/logo.png +0 -0
  9. package/dist/index.html +13 -0
  10. package/index.html +12 -0
  11. package/package.json +37 -16
  12. package/public/catalog.json +297 -0
  13. package/public/img/logo-text.png +0 -0
  14. package/public/img/logo.png +0 -0
  15. package/src/blocks/alert.tsx +30 -0
  16. package/src/blocks/content.tsx +43 -0
  17. package/src/blocks/last-modified.tsx +26 -0
  18. package/src/blocks/links.tsx +42 -0
  19. package/src/blocks/markdown.tsx +10 -0
  20. package/src/blocks/navbar.tsx +46 -0
  21. package/src/blocks/page-attributes-view.tsx +127 -0
  22. package/src/blocks/page-attributes.tsx +80 -0
  23. package/src/blocks/page-destinations-view.tsx +134 -0
  24. package/src/blocks/page-destinations.tsx +80 -0
  25. package/src/blocks/page-effects-view.tsx +139 -0
  26. package/src/blocks/page-effects.tsx +80 -0
  27. package/src/blocks/page-events-view.tsx +147 -0
  28. package/src/blocks/page-events.tsx +80 -0
  29. package/src/blocks/pretty-date.tsx +52 -0
  30. package/src/blocks/properties.tsx +170 -0
  31. package/src/blocks/root.tsx +116 -0
  32. package/src/blocks/search-input.tsx +32 -0
  33. package/src/blocks/tabs.tsx +47 -0
  34. package/src/blocks/tag.tsx +13 -0
  35. package/src/contexts/index.ts +4 -0
  36. package/src/hooks/index.ts +98 -0
  37. package/src/main.tsx +13 -0
  38. package/src/styles.css +126 -0
  39. package/src/utils/index.ts +171 -0
  40. package/tsconfig.json +30 -0
  41. package/tsconfig.node.json +11 -0
  42. package/vite.config.ts +15 -0
package/src/styles.css ADDED
@@ -0,0 +1,126 @@
1
+ @import "tailwindcss";
2
+ @import "tw-animate-css";
3
+
4
+ @plugin "@tailwindcss/typography";
5
+
6
+ @custom-variant dark (&:is(.dark *));
7
+
8
+ @theme inline {
9
+ --radius-sm: calc(var(--radius) - 4px);
10
+ --radius-md: calc(var(--radius) - 2px);
11
+ --radius-lg: var(--radius);
12
+ --radius-xl: calc(var(--radius) + 4px);
13
+ --color-background: var(--background);
14
+ --color-foreground: var(--foreground);
15
+ --color-card: var(--card);
16
+ --color-card-foreground: var(--card-foreground);
17
+ --color-popover: var(--popover);
18
+ --color-popover-foreground: var(--popover-foreground);
19
+ --color-primary: var(--primary);
20
+ --color-primary-foreground: var(--primary-foreground);
21
+ --color-secondary: var(--secondary);
22
+ --color-secondary-foreground: var(--secondary-foreground);
23
+ --color-muted: var(--muted);
24
+ --color-muted-foreground: var(--muted-foreground);
25
+ --color-accent: var(--accent);
26
+ --color-accent-foreground: var(--accent-foreground);
27
+ --color-destructive: var(--destructive);
28
+ --color-border: var(--border);
29
+ --color-input: var(--input);
30
+ --color-ring: var(--ring);
31
+ --color-chart-1: var(--chart-1);
32
+ --color-chart-2: var(--chart-2);
33
+ --color-chart-3: var(--chart-3);
34
+ --color-chart-4: var(--chart-4);
35
+ --color-chart-5: var(--chart-5);
36
+ --color-sidebar: var(--sidebar);
37
+ --color-sidebar-foreground: var(--sidebar-foreground);
38
+ --color-sidebar-primary: var(--sidebar-primary);
39
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
40
+ --color-sidebar-accent: var(--sidebar-accent);
41
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
42
+ --color-sidebar-border: var(--sidebar-border);
43
+ --color-sidebar-ring: var(--sidebar-ring);
44
+ }
45
+
46
+ :root {
47
+ --radius: 0.625rem;
48
+ --background: oklch(1 0 0);
49
+ --foreground: oklch(0.145 0 0);
50
+ --card: oklch(1 0 0);
51
+ --card-foreground: oklch(0.145 0 0);
52
+ --popover: oklch(1 0 0);
53
+ --popover-foreground: oklch(0.145 0 0);
54
+ --primary: oklch(0.205 0 0);
55
+ --primary-foreground: oklch(0.985 0 0);
56
+ --secondary: oklch(0.97 0 0);
57
+ --secondary-foreground: oklch(0.205 0 0);
58
+ --muted: oklch(0.97 0 0);
59
+ --muted-foreground: oklch(0.556 0 0);
60
+ --accent: oklch(0.97 0 0);
61
+ --accent-foreground: oklch(0.205 0 0);
62
+ --destructive: oklch(0.577 0.245 27.325);
63
+ --border: oklch(0.922 0 0);
64
+ --input: oklch(0.922 0 0);
65
+ --ring: oklch(0.708 0 0);
66
+ --chart-1: oklch(0.646 0.222 41.116);
67
+ --chart-2: oklch(0.6 0.118 184.704);
68
+ --chart-3: oklch(0.398 0.07 227.392);
69
+ --chart-4: oklch(0.828 0.189 84.429);
70
+ --chart-5: oklch(0.769 0.188 70.08);
71
+ --sidebar: oklch(0.985 0 0);
72
+ --sidebar-foreground: oklch(0.145 0 0);
73
+ --sidebar-primary: oklch(0.205 0 0);
74
+ --sidebar-primary-foreground: oklch(0.985 0 0);
75
+ --sidebar-accent: oklch(0.97 0 0);
76
+ --sidebar-accent-foreground: oklch(0.205 0 0);
77
+ --sidebar-border: oklch(0.922 0 0);
78
+ --sidebar-ring: oklch(0.708 0 0);
79
+ }
80
+
81
+ .dark {
82
+ --background: oklch(0.145 0 0);
83
+ --foreground: oklch(0.985 0 0);
84
+ --card: oklch(0.205 0 0);
85
+ --card-foreground: oklch(0.985 0 0);
86
+ --popover: oklch(0.205 0 0);
87
+ --popover-foreground: oklch(0.985 0 0);
88
+ --primary: oklch(0.922 0 0);
89
+ --primary-foreground: oklch(0.205 0 0);
90
+ --secondary: oklch(0.269 0 0);
91
+ --secondary-foreground: oklch(0.985 0 0);
92
+ --muted: oklch(0.269 0 0);
93
+ --muted-foreground: oklch(0.708 0 0);
94
+ --accent: oklch(0.269 0 0);
95
+ --accent-foreground: oklch(0.985 0 0);
96
+ --destructive: oklch(0.704 0.191 22.216);
97
+ --border: oklch(1 0 0 / 10%);
98
+ --input: oklch(1 0 0 / 15%);
99
+ --ring: oklch(0.556 0 0);
100
+ --chart-1: oklch(0.488 0.243 264.376);
101
+ --chart-2: oklch(0.696 0.17 162.48);
102
+ --chart-3: oklch(0.769 0.188 70.08);
103
+ --chart-4: oklch(0.627 0.265 303.9);
104
+ --chart-5: oklch(0.645 0.246 16.439);
105
+ --sidebar: oklch(0.205 0 0);
106
+ --sidebar-foreground: oklch(0.985 0 0);
107
+ --sidebar-primary: oklch(0.488 0.243 264.376);
108
+ --sidebar-primary-foreground: oklch(0.985 0 0);
109
+ --sidebar-accent: oklch(0.269 0 0);
110
+ --sidebar-accent-foreground: oklch(0.985 0 0);
111
+ --sidebar-border: oklch(1 0 0 / 10%);
112
+ --sidebar-ring: oklch(0.556 0 0);
113
+ }
114
+
115
+ @layer base {
116
+ * {
117
+ @apply border-border outline-ring/50;
118
+ }
119
+ body {
120
+ @apply bg-background text-foreground;
121
+ }
122
+ }
123
+
124
+ body {
125
+ background-color: var(--color-zinc-200);
126
+ }
@@ -0,0 +1,171 @@
1
+ export interface Query {
2
+ keyword: string;
3
+ tags: string[];
4
+ archived?: boolean;
5
+ }
6
+
7
+ export function parseSearchQuery(queryString: string) {
8
+ const query: Query = {
9
+ keyword: "",
10
+ tags: [],
11
+ archived: undefined,
12
+ };
13
+
14
+ const parts = queryString.split(" ");
15
+
16
+ for (const part of parts) {
17
+ if (part.startsWith("tag:")) {
18
+ const tag = part.replace("tag:", "");
19
+
20
+ if (tag.length > 0) {
21
+ query.tags.push(tag);
22
+ }
23
+ } else if (part.startsWith("archived:")) {
24
+ const archived = part.replace("archived:", "");
25
+
26
+ if (archived === "true") {
27
+ query.archived = true;
28
+ } else if (archived === "false") {
29
+ query.archived = false;
30
+ }
31
+ } else {
32
+ if (part.length > 0) {
33
+ query.keyword = part;
34
+ }
35
+ }
36
+ }
37
+
38
+ return query;
39
+ }
40
+
41
+ export function getEventsByQuery(q: string, events: any[]) {
42
+ const query = parseSearchQuery(q);
43
+
44
+ const filteredEvents = events
45
+ .filter((event) => {
46
+ let matched = true;
47
+
48
+ if (
49
+ query.keyword.length > 0 &&
50
+ event.name.toLowerCase().indexOf(query.keyword.toLowerCase()) === -1
51
+ ) {
52
+ matched = false;
53
+ }
54
+
55
+ if (query.tags.length > 0) {
56
+ for (const tag of query.tags) {
57
+ if (event.tags.every((t: string) => t.toLowerCase() !== tag.toLowerCase())) {
58
+ matched = false;
59
+ }
60
+ }
61
+ }
62
+
63
+ if (typeof query.archived === "boolean") {
64
+ if (query.archived && event.archived !== query.archived) {
65
+ matched = false;
66
+ }
67
+
68
+ if (!query.archived && event.archived === true) {
69
+ matched = false;
70
+ }
71
+ }
72
+
73
+ return matched;
74
+ })
75
+ .sort((a, b) => a.name.localeCompare(b.name));
76
+
77
+ return filteredEvents;
78
+ }
79
+
80
+ export function getAttributesByQuery(q: string, attributes: any[]) {
81
+ const query = parseSearchQuery(q);
82
+
83
+ const filteredAttributes = attributes
84
+ .filter((attribute) => {
85
+ let matched = true;
86
+
87
+ if (
88
+ query.keyword.length > 0 &&
89
+ attribute.name.toLowerCase().indexOf(query.keyword.toLowerCase()) === -1
90
+ ) {
91
+ matched = false;
92
+ }
93
+
94
+ if (typeof query.archived === "boolean") {
95
+ if (query.archived && attribute.archived !== query.archived) {
96
+ matched = false;
97
+ }
98
+
99
+ if (!query.archived && attribute.archived === true) {
100
+ matched = false;
101
+ }
102
+ }
103
+
104
+ return matched;
105
+ })
106
+ .sort((a, b) => a.name.localeCompare(b.name));
107
+
108
+ return filteredAttributes;
109
+ }
110
+
111
+ export function getDestinationsByQuery(q: string, destinations: any[]) {
112
+ const query = parseSearchQuery(q);
113
+
114
+ const filteredDestinations = destinations
115
+ .filter((destination) => {
116
+ let matched = true;
117
+
118
+ if (
119
+ query.keyword.length > 0 &&
120
+ destination.name.toLowerCase().indexOf(query.keyword.toLowerCase()) === -1
121
+ ) {
122
+ matched = false;
123
+ }
124
+
125
+ if (typeof query.archived === "boolean") {
126
+ if (query.archived && destination.archived !== query.archived) {
127
+ matched = false;
128
+ }
129
+
130
+ if (!query.archived && destination.archived === true) {
131
+ matched = false;
132
+ }
133
+ }
134
+
135
+ return matched;
136
+ })
137
+ .sort((a, b) => a.name.localeCompare(b.name));
138
+
139
+ return filteredDestinations;
140
+ }
141
+
142
+ export function getEffectsByQuery(q: string, effects: any[]) {
143
+ const query = parseSearchQuery(q);
144
+
145
+ const filteredEffects = effects
146
+ .filter((effect) => {
147
+ let matched = true;
148
+
149
+ if (
150
+ query.keyword.length > 0 &&
151
+ effect.name.toLowerCase().indexOf(query.keyword.toLowerCase()) === -1
152
+ ) {
153
+ matched = false;
154
+ }
155
+
156
+ if (typeof query.archived === "boolean") {
157
+ if (query.archived && effect.archived !== query.archived) {
158
+ matched = false;
159
+ }
160
+
161
+ if (!query.archived && effect.archived === true) {
162
+ matched = false;
163
+ }
164
+ }
165
+
166
+ return matched;
167
+ })
168
+ .sort((a, b) => a.name.localeCompare(b.name));
169
+
170
+ return filteredEffects;
171
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "useDefineForClassFields": true,
5
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
6
+ "module": "ESNext",
7
+ "skipLibCheck": true,
8
+
9
+ /* Bundler mode */
10
+ "moduleResolution": "bundler",
11
+ "allowImportingTsExtensions": true,
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "noEmit": true,
15
+ "jsx": "react-jsx",
16
+
17
+ /* Linting */
18
+ "strict": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "noFallthroughCasesInSwitch": true,
22
+
23
+ "baseUrl": ".",
24
+ "paths": {
25
+ "@/*": ["./src/*"]
26
+ }
27
+ },
28
+ "include": ["src"],
29
+ "references": [{ "path": "./tsconfig.node.json" }]
30
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "skipLibCheck": true,
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "allowSyntheticDefaultImports": true,
8
+ "strict": true
9
+ },
10
+ "include": ["vite.config.ts"]
11
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from "vite";
2
+ import react from "@vitejs/plugin-react";
3
+ import tailwindcss from "@tailwindcss/vite";
4
+
5
+ import path from "path";
6
+
7
+ // https://vite.dev/config/
8
+ export default defineConfig({
9
+ plugins: [react(), tailwindcss()],
10
+ resolve: {
11
+ alias: {
12
+ "@": path.resolve(__dirname, "./src"),
13
+ },
14
+ },
15
+ });