@progressive-development/pd-contact 0.9.2 → 1.0.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.
@@ -0,0 +1,240 @@
1
+ const trim = (s) => s.trim();
2
+ const stripAt = (s) => s.replace(/^@/, "");
3
+ const ensureHttps = (url) => /^https?:\/\//i.test(url) ? url : `https://${url}`;
4
+ const SOCIAL_PROVIDERS = [
5
+ // --- Social ---
6
+ {
7
+ id: "instagram",
8
+ label: "Instagram",
9
+ aliases: ["insta", "ig"],
10
+ category: "Social",
11
+ icon: "📸",
12
+ brandColor: "#E4405F",
13
+ inputKind: "username",
14
+ placeholder: "@deinname",
15
+ pattern: /^[A-Za-z0-9._]{1,30}$/,
16
+ normalize: (raw) => stripAt(trim(raw)),
17
+ toUrl: (input) => `https://instagram.com/${stripAt(trim(input))}`
18
+ },
19
+ {
20
+ id: "tiktok",
21
+ label: "TikTok",
22
+ aliases: ["tiktok"],
23
+ category: "Social",
24
+ icon: "🎵",
25
+ brandColor: "#000000",
26
+ inputKind: "username",
27
+ placeholder: "@deinname",
28
+ pattern: /^[A-Za-z0-9._]{2,24}$/,
29
+ normalize: (raw) => stripAt(trim(raw)),
30
+ toUrl: (input) => `https://www.tiktok.com/@${stripAt(trim(input))}`
31
+ },
32
+ {
33
+ id: "facebook",
34
+ label: "Facebook",
35
+ aliases: ["fb", "facebook page"],
36
+ category: "Social",
37
+ icon: "📘",
38
+ brandColor: "#1877F2",
39
+ inputKind: "url",
40
+ placeholder: "facebook.com/deinprofil",
41
+ pattern: /^https?:\/\/(www\.)?facebook\.com\/.+/i,
42
+ toUrl: (input) => ensureHttps(trim(input))
43
+ },
44
+ {
45
+ id: "x",
46
+ label: "X (Twitter)",
47
+ aliases: ["twitter"],
48
+ category: "Social",
49
+ icon: "X",
50
+ brandColor: "#000000",
51
+ inputKind: "username",
52
+ placeholder: "@deinname",
53
+ pattern: /^[A-Za-z0-9_]{1,15}$/,
54
+ normalize: (raw) => stripAt(trim(raw)),
55
+ toUrl: (input) => `https://x.com/${stripAt(trim(input))}`
56
+ },
57
+ {
58
+ id: "youtube",
59
+ label: "YouTube",
60
+ aliases: ["yt", "youtube channel"],
61
+ category: "Streaming",
62
+ icon: "▶️",
63
+ brandColor: "#FF0000",
64
+ inputKind: "url",
65
+ placeholder: "youtube.com/@deinname oder Kanal-URL",
66
+ pattern: /^https?:\/\/(www\.)?youtube\.com\/.+/i,
67
+ toUrl: (input) => ensureHttps(trim(input))
68
+ },
69
+ {
70
+ id: "twitch",
71
+ label: "Twitch",
72
+ aliases: ["twitch tv"],
73
+ category: "Streaming",
74
+ icon: "🎮",
75
+ brandColor: "#9146FF",
76
+ inputKind: "username",
77
+ placeholder: "deinname",
78
+ pattern: /^[A-Za-z0-9_]{4,25}$/,
79
+ normalize: (raw) => trim(raw),
80
+ toUrl: (input) => `https://twitch.tv/${trim(input)}`
81
+ },
82
+ // --- Music / DJ ---
83
+ {
84
+ id: "soundcloud",
85
+ label: "SoundCloud",
86
+ aliases: ["sc"],
87
+ category: "Music",
88
+ icon: "☁️",
89
+ brandColor: "#FF5500",
90
+ inputKind: "username",
91
+ placeholder: "deinname",
92
+ pattern: /^[A-Za-z0-9-_.]{3,40}$/,
93
+ normalize: (raw) => trim(raw).replace(/^https?:\/\/(www\.)?soundcloud\.com\//i, ""),
94
+ toUrl: (input) => `https://soundcloud.com/${trim(input)}`
95
+ },
96
+ {
97
+ id: "mixcloud",
98
+ label: "Mixcloud",
99
+ aliases: ["mix cloud"],
100
+ category: "Music",
101
+ icon: "📻",
102
+ brandColor: "#5000FF",
103
+ inputKind: "username",
104
+ placeholder: "deinname",
105
+ pattern: /^[A-Za-z0-9-_.]{3,40}$/,
106
+ normalize: (raw) => trim(raw).replace(/^https?:\/\/(www\.)?mixcloud\.com\//i, ""),
107
+ toUrl: (input) => `https://www.mixcloud.com/${trim(input)}/`
108
+ },
109
+ {
110
+ id: "hearthis",
111
+ label: "HearThis.at",
112
+ aliases: ["hearthis"],
113
+ category: "Music",
114
+ icon: "🔊",
115
+ brandColor: "#D61C1C",
116
+ inputKind: "username",
117
+ placeholder: "deinname",
118
+ pattern: /^[A-Za-z0-9-_.]{3,40}$/,
119
+ normalize: (raw) => trim(raw).replace(/^https?:\/\/(www\.)?hearthis\.at\//i, ""),
120
+ toUrl: (input) => `https://hearthis.at/${trim(input)}/`
121
+ },
122
+ {
123
+ id: "beatport",
124
+ label: "Beatport (Artist)",
125
+ aliases: ["beat port"],
126
+ category: "DJ/Booking",
127
+ icon: "🎧",
128
+ brandColor: "#A8E00F",
129
+ inputKind: "url",
130
+ placeholder: "beatport.com/artist/... oder /profile/...",
131
+ pattern: /^https?:\/\/(www\.)?beatport\.com\/(artist|profile)\/.+/i,
132
+ toUrl: (input) => ensureHttps(trim(input))
133
+ },
134
+ {
135
+ id: "residentadvisor",
136
+ label: "Resident Advisor",
137
+ aliases: ["ra", "ra.co"],
138
+ category: "DJ/Booking",
139
+ icon: "🟢",
140
+ brandColor: "#BADA55",
141
+ inputKind: "url",
142
+ placeholder: "ra.co/dj/deinname",
143
+ pattern: /^https?:\/\/(www\.)?ra\.co\/dj\/.+/i,
144
+ toUrl: (input) => ensureHttps(trim(input))
145
+ },
146
+ {
147
+ id: "spotify",
148
+ label: "Spotify (Artist)",
149
+ aliases: ["spotify artist"],
150
+ category: "Music",
151
+ icon: "🟢",
152
+ brandColor: "#1DB954",
153
+ inputKind: "id",
154
+ placeholder: "Artist-ID oder vollständige URL",
155
+ pattern: /^[0-9A-Za-z]{22}$|^https?:\/\/open\.spotify\.com\/artist\/[0-9A-Za-z]{22}/i,
156
+ normalize: (raw) => {
157
+ const s = trim(raw);
158
+ const m = s.match(/artist\/([0-9A-Za-z]{22})/);
159
+ return m ? m[1] : s;
160
+ },
161
+ toUrl: (input) => {
162
+ const id = trim(input).match(/^[0-9A-Za-z]{22}$/) ? input : input.match(/artist\/([0-9A-Za-z]{22})/)?.[1] ?? input;
163
+ return `https://open.spotify.com/artist/${id}`;
164
+ }
165
+ },
166
+ {
167
+ id: "applemusic",
168
+ label: "Apple Music",
169
+ aliases: ["itunes", "apple music artist"],
170
+ category: "Music",
171
+ icon: "🎵",
172
+ brandColor: "#FA2D48",
173
+ inputKind: "url",
174
+ placeholder: "music.apple.com/... (Artist-Link)",
175
+ pattern: /^https?:\/\/music\.apple\.com\/.+/i,
176
+ toUrl: (input) => ensureHttps(trim(input))
177
+ },
178
+ {
179
+ id: "deezer",
180
+ label: "Deezer (Artist)",
181
+ aliases: ["deezer"],
182
+ category: "Music",
183
+ icon: "🎶",
184
+ brandColor: "#00C7F2",
185
+ inputKind: "url",
186
+ placeholder: "deezer.com/artist/...",
187
+ pattern: /^https?:\/\/(www\.)?deezer\.com\/.+/i,
188
+ toUrl: (input) => ensureHttps(trim(input))
189
+ },
190
+ {
191
+ id: "bandcamp",
192
+ label: "Bandcamp",
193
+ aliases: ["band camp"],
194
+ category: "Music",
195
+ icon: "💿",
196
+ brandColor: "#629AA9",
197
+ inputKind: "url",
198
+ placeholder: "deinname.bandcamp.com",
199
+ pattern: /^https?:\/\/[A-Za-z0-9-]+\.bandcamp\.com(\/.*)?$/i,
200
+ toUrl: (input) => ensureHttps(trim(input))
201
+ },
202
+ {
203
+ id: "discogs",
204
+ label: "Discogs",
205
+ aliases: ["disc ogs"],
206
+ category: "Catalog",
207
+ icon: "📀",
208
+ brandColor: "#333333",
209
+ inputKind: "url",
210
+ placeholder: "discogs.com/artist/... oder /user/...",
211
+ pattern: /^https?:\/\/(www\.)?discogs\.com\/(artist|user)\/.+/i,
212
+ toUrl: (input) => ensureHttps(trim(input))
213
+ },
214
+ {
215
+ id: "mixesdb",
216
+ label: "MixesDB",
217
+ aliases: ["mixes db"],
218
+ category: "Catalog",
219
+ icon: "📂",
220
+ brandColor: "#FFB000",
221
+ inputKind: "url",
222
+ placeholder: "mixesdb.com/... (Profil-URL)",
223
+ pattern: /^https?:\/\/(www\.)?mixesdb\.com\/.+/i,
224
+ toUrl: (input) => ensureHttps(trim(input))
225
+ },
226
+ {
227
+ id: "linkedin",
228
+ label: "LinkedIn",
229
+ aliases: ["li"],
230
+ category: "Social",
231
+ icon: "🔗",
232
+ brandColor: "#0A66C2",
233
+ inputKind: "url",
234
+ placeholder: "linkedin.com/in/deinname",
235
+ pattern: /^https?:\/\/(www\.)?linkedin\.com\/.+/i,
236
+ toUrl: (input) => ensureHttps(trim(input))
237
+ }
238
+ ];
239
+
240
+ export { SOCIAL_PROVIDERS };
@@ -0,0 +1,7 @@
1
+ import { PdSocialmedia } from './pd-socialmedia/PdSocialmedia.js';
2
+
3
+ if (!customElements.get("pd-socialmedia")) {
4
+ customElements.define("pd-socialmedia", PdSocialmedia);
5
+ }
6
+
7
+ export { PdSocialmedia };
package/dist/types.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { SocialEntry } from '@progressive-development/pd-page';
2
+ export type { SocialEntry };
1
3
  export declare const C_TYPE = "type";
2
4
  export declare const C_COMPANY = "companyName";
3
5
  export declare const C_BTWNR = "vatNr";
@@ -11,6 +13,10 @@ export declare const C_ADDITIONAL = "additionalHint";
11
13
  export declare const C_PROPERTY_DATE = "propertyDate";
12
14
  export declare const C_PHONE1 = "phone1";
13
15
  export declare const C_EMAIL = "email";
16
+ export declare const C_TITLE_NAME = "titleName";
17
+ export declare const C_LOGO = "logo";
18
+ export declare const C_WEBSITE = "website";
19
+ export declare const C_SOCIAL_MEDIA = "socialMedia";
14
20
  export interface PdContactData {
15
21
  business?: boolean;
16
22
  companyName?: string;
@@ -29,6 +35,10 @@ export interface PdContactData {
29
35
  btw?: string;
30
36
  kbc?: string;
31
37
  bank?: string;
38
+ titleName?: string;
39
+ logo?: string;
40
+ website?: string;
41
+ socialMedia?: SocialEntry[];
32
42
  }
33
43
  export interface PdContactMatch {
34
44
  zip?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,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": "0.9.2",
3
+ "version": "1.0.0",
4
4
  "description": "Progressive Development Contact component",
5
5
  "author": "PD Progressive Development",
6
- "license": "SEE LICENSE IN LICENSE",
6
+ "license": "MIT",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
7
10
  "main": "./dist/index.js",
8
11
  "module": "./dist/index.js",
9
12
  "type": "module",
@@ -25,9 +28,9 @@
25
28
  "lit": "^3.3.1",
26
29
  "@lit/localize": "^0.12.2",
27
30
  "tslib": "^2.8.1",
28
- "@progressive-development/pd-shared-styles": "0.3.0",
29
- "@progressive-development/pd-icon": "0.9.2",
30
- "@progressive-development/pd-forms": "0.9.2"
31
+ "@progressive-development/pd-icon": "1.0.0",
32
+ "@progressive-development/pd-shared-styles": "0.3.1",
33
+ "@progressive-development/pd-forms": "1.0.0"
31
34
  },
32
35
  "customElements": "custom-elements.json",
33
36
  "keywords": [