@digital-ai/dot-illustrations 2.0.24 → 2.0.26
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.
- package/demo/index.html +7 -5
- package/demo/script.js +100 -17
- package/illustrations/dark/global/time.svg +27 -0
- package/illustrations/light/global/time.svg +27 -0
- package/index.css +8 -0
- package/package.json +1 -1
package/demo/index.html
CHANGED
|
@@ -66,15 +66,17 @@
|
|
|
66
66
|
<h2 class="text-xl font-semibold mb-4 w-full text-center text-gray-900 dark:text-gray-100">Illustration preview</h2>
|
|
67
67
|
<div id="modal-image" class="mb-4"></div>
|
|
68
68
|
<div class="w-full flex flex-col gap-2 mb-2">
|
|
69
|
-
<
|
|
69
|
+
<div class="text-base font-semibold text-center text-gray-800 dark:text-gray-100 mb-1" id="modal-illustration-name"></div>
|
|
70
|
+
</div>
|
|
71
|
+
<div class="w-full flex flex-col gap-2 mb-2">
|
|
72
|
+
<label class="text-xs font-medium text-gray-500 dark:text-gray-400" for="modal-dot-code">Dot Code</label>
|
|
70
73
|
<div class="flex flex-row items-center gap-2">
|
|
71
|
-
<
|
|
72
|
-
<button id="modal-copy-
|
|
74
|
+
<textarea id="modal-dot-code" class="flex-1 px-2 py-1 border border-gray-300 dark:border-gray-700 rounded bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white text-xs font-mono resize-none" rows="2" readonly></textarea>
|
|
75
|
+
<button id="modal-copy-dot-code" class="button flex items-center justify-center px-2 py-1 text-xs text-gray-400 border border-gray-300 dark:border-gray-700 rounded bg-white dark:bg-gray-800 font-normal hover:bg-blue-100 dark:hover:bg-blue-900 transition relative text-center" title="Copy Dot Code">Copy Dot Code</button>
|
|
73
76
|
</div>
|
|
74
77
|
</div>
|
|
75
|
-
<div id="modal-description" class="w-full text-center text-sm text-gray-700 dark:text-gray-300 mb-4"></div>
|
|
76
78
|
<div class="w-full flex flex-col gap-2 mb-2">
|
|
77
|
-
<label class="text-xs font-medium text-gray-500 dark:text-gray-400" for="modal-code">Code</label>
|
|
79
|
+
<label class="text-xs font-medium text-gray-500 dark:text-gray-400" for="modal-code">HTML Code</label>
|
|
78
80
|
<div class="flex flex-row items-center gap-2">
|
|
79
81
|
<textarea id="modal-code" class="flex-1 px-2 py-1 border border-gray-300 dark:border-gray-700 rounded bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white text-xs font-mono resize-none" rows="2" readonly></textarea>
|
|
80
82
|
<button id="modal-copy-code" class="button flex items-center justify-center px-2 py-1 text-xs text-gray-400 border border-gray-300 dark:border-gray-700 rounded bg-white dark:bg-gray-800 font-normal hover:bg-blue-100 dark:hover:bg-blue-900 transition relative text-center">Copy Code</button>
|
package/demo/script.js
CHANGED
|
@@ -70,18 +70,19 @@ const origCopyText = window.copyText;
|
|
|
70
70
|
window.copyText = function(button) {
|
|
71
71
|
var parentDiv = button.closest('.copy-container');
|
|
72
72
|
var copyText = parentDiv.querySelector('.iconID');
|
|
73
|
-
var
|
|
74
|
-
|
|
73
|
+
var illustrationId = copyText.textContent;
|
|
74
|
+
var dotCode = `<DotIllustration illustrationId=\"${illustrationId}\" />`;
|
|
75
|
+
navigator.clipboard.writeText(dotCode).then(function() {
|
|
75
76
|
var tooltip = button.querySelector('.tooltiptext');
|
|
76
|
-
tooltip.innerHTML = "Copied
|
|
77
|
+
tooltip.innerHTML = "Copied Dot Code";
|
|
77
78
|
tooltip.style.visibility = 'visible';
|
|
78
79
|
setTimeout(function() {
|
|
79
|
-
tooltip.innerHTML = "Copy
|
|
80
|
+
tooltip.innerHTML = "Copy Dot Code";
|
|
80
81
|
tooltip.style.visibility = 'hidden';
|
|
81
82
|
}, 2000);
|
|
82
|
-
showToast('Copied
|
|
83
|
+
showToast('Copied Dot Code: ' + dotCode);
|
|
83
84
|
}, function(err) {
|
|
84
|
-
console.error('Failed to copy
|
|
85
|
+
console.error('Failed to copy dot code: ', err);
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
88
|
|
|
@@ -156,10 +157,71 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
156
157
|
|
|
157
158
|
// --- ILLUSTRATION DATA ---
|
|
158
159
|
const globalList = [
|
|
159
|
-
"add-new",
|
|
160
|
+
"add-new",
|
|
161
|
+
"ai",
|
|
162
|
+
"add-new-grid",
|
|
163
|
+
"add-team",
|
|
164
|
+
"add-user",
|
|
165
|
+
"assets",
|
|
166
|
+
"analysis-circle",
|
|
167
|
+
"community",
|
|
168
|
+
"commitrepo",
|
|
169
|
+
"chart",
|
|
170
|
+
"custom-dashboards",
|
|
171
|
+
"dependency-down",
|
|
172
|
+
"dependency-up",
|
|
173
|
+
"disconnected",
|
|
174
|
+
"done",
|
|
175
|
+
"dora-metrics-circle",
|
|
176
|
+
"download",
|
|
177
|
+
"empty",
|
|
178
|
+
"error-fourhundredfour",
|
|
179
|
+
"error-fivehundred",
|
|
180
|
+
"error-fivehundredthree",
|
|
181
|
+
"error-fourhundredthree",
|
|
182
|
+
"favorite","features",
|
|
183
|
+
"folder-versioning",
|
|
184
|
+
"forbiden-access",
|
|
185
|
+
"filter-empty",
|
|
186
|
+
"launch",
|
|
187
|
+
"no-files",
|
|
188
|
+
"no-filters",
|
|
189
|
+
"nothing-defined",
|
|
190
|
+
"password-token",
|
|
191
|
+
"protection-in-progress",
|
|
192
|
+
"reports","scan-document",
|
|
193
|
+
"survey",
|
|
194
|
+
"time",
|
|
195
|
+
"user",
|
|
196
|
+
"ui-ux-improvements",
|
|
197
|
+
"upload","work-item",
|
|
198
|
+
"workflows-main",
|
|
199
|
+
"research"
|
|
160
200
|
];
|
|
161
201
|
const dashboardsList = [
|
|
162
|
-
"analysis",
|
|
202
|
+
"analysis",
|
|
203
|
+
"automation",
|
|
204
|
+
"burn-down",
|
|
205
|
+
"burn-up",
|
|
206
|
+
"change-credit-score",
|
|
207
|
+
"change-data-quality",
|
|
208
|
+
"change-executive",
|
|
209
|
+
"change-impact-detection",
|
|
210
|
+
"change-impact-hotspots",
|
|
211
|
+
"change-failure-factors",
|
|
212
|
+
"change-failure-prediction",
|
|
213
|
+
"CRP-failure-prediction-monitoring",
|
|
214
|
+
"custom",
|
|
215
|
+
"defect",
|
|
216
|
+
"dependency",
|
|
217
|
+
"dora",
|
|
218
|
+
"executive",
|
|
219
|
+
"change-impact",
|
|
220
|
+
"item",
|
|
221
|
+
"late-task",
|
|
222
|
+
"onboarding",
|
|
223
|
+
"data-extraction",
|
|
224
|
+
"workflow"
|
|
163
225
|
];
|
|
164
226
|
const illustrations = [...globalList, ...dashboardsList, "my-new-illustration"];
|
|
165
227
|
|
|
@@ -199,7 +261,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
199
261
|
const modalIdInput = document.getElementById('modal-id-input');
|
|
200
262
|
const modalDescription = document.getElementById('modal-description');
|
|
201
263
|
const modalCode = document.getElementById('modal-code');
|
|
202
|
-
const modalCopyId = document.getElementById('modal-copy-id');
|
|
203
264
|
const modalCopyCode = document.getElementById('modal-copy-code');
|
|
204
265
|
const modalClose = document.getElementById('modal-close');
|
|
205
266
|
const modalCloseBottom = document.getElementById('modal-close-bottom');
|
|
@@ -219,11 +280,35 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
219
280
|
}
|
|
220
281
|
const svgPath = `illustrations/${themeClass}/${categoryFolder}/${illustration}.svg`;
|
|
221
282
|
modalImage.innerHTML = `<span class=\"dot-illustration\"><img src=\"${svgPath}\" class=\"${illustration} ${themeClass} ${categoryClass}\" style=\"width:286px;height:286px;object-fit:contain;\"/></span>`;
|
|
222
|
-
|
|
283
|
+
// Set the illustration name
|
|
284
|
+
const modalIllustrationName = document.getElementById('modal-illustration-name');
|
|
285
|
+
if (modalIllustrationName) modalIllustrationName.textContent = illustration;
|
|
286
|
+
// Set the Dot Code textarea value
|
|
287
|
+
const dotCodeString = `<DotIllustration illustrationId=\"${illustration}\" />`;
|
|
288
|
+
const modalDotCode = document.getElementById('modal-dot-code');
|
|
289
|
+
if (modalDotCode) modalDotCode.value = dotCodeString;
|
|
290
|
+
// Show the HTML code snippet in the modal
|
|
223
291
|
const codeString = `<span class=\"dot-illustration\"><img src=\"${svgPath}\" class=\"${illustration} ${themeClass} ${categoryClass}\"/></span>`;
|
|
224
292
|
modalCode.value = codeString;
|
|
225
293
|
modal.classList.add('active');
|
|
226
294
|
modal.classList.remove('hidden');
|
|
295
|
+
// Attach Copy Dot Code button event listener each time modal opens
|
|
296
|
+
const modalCopyDotCode = document.getElementById('modal-copy-dot-code');
|
|
297
|
+
if (modalCopyDotCode) {
|
|
298
|
+
modalCopyDotCode.onclick = function() {
|
|
299
|
+
if (modalDotCode) {
|
|
300
|
+
navigator.clipboard.writeText(modalDotCode.value).then(function() {
|
|
301
|
+
modalCopyDotCode.textContent = 'Copied!';
|
|
302
|
+
showToast('Copied Dot Code: ' + modalDotCode.value);
|
|
303
|
+
setTimeout(() => {
|
|
304
|
+
modalCopyDotCode.textContent = 'Copy Dot Code';
|
|
305
|
+
}, 2000);
|
|
306
|
+
}, function(err) {
|
|
307
|
+
console.error('Failed to copy dot code: ', err);
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
}
|
|
227
312
|
}
|
|
228
313
|
function closeModal() {
|
|
229
314
|
modal.classList.remove('active');
|
|
@@ -233,10 +318,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
233
318
|
modalCloseBottom.addEventListener('click', closeModal);
|
|
234
319
|
modal.addEventListener('click', (e) => { if (e.target === modal) closeModal(); });
|
|
235
320
|
document.addEventListener('keydown', (e) => { if (modal.classList.contains('active') && e.key === 'Escape') closeModal(); });
|
|
236
|
-
modalCopyId.addEventListener('click', () => {
|
|
237
|
-
navigator.clipboard.writeText(modalIdInput.value);
|
|
238
|
-
showToast('Copied ID: ' + modalIdInput.value);
|
|
239
|
-
});
|
|
240
321
|
modalCopyCode.addEventListener('click', () => {
|
|
241
322
|
navigator.clipboard.writeText(modalCode.value);
|
|
242
323
|
showToast('Copied code: ' + modalCode.value);
|
|
@@ -279,6 +360,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
279
360
|
const isFav = favs.includes(illustration);
|
|
280
361
|
const div = document.createElement("div");
|
|
281
362
|
div.setAttribute("class", "copy-container relative group flex flex-col items-center justify-between bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl shadow-lg p-2 md:p-3 transition-transform duration-200 hover:scale-105 hover:shadow-2xl h-[302px] w-full justify-center");
|
|
363
|
+
// Show the HTML code snippet in the card
|
|
364
|
+
const codeString = `<span class=\"dot-illustration\"><img src=\"${svgPath}\" class=\"${illustration} ${themeClass} ${categoryClass}\"/></span>`;
|
|
282
365
|
div.innerHTML = `
|
|
283
366
|
<button class="absolute top-2 right-2 z-10 p-1 rounded-full bg-white/80 dark:bg-gray-800/80 hover:bg-yellow-100 dark:hover:bg-yellow-300 transition" title="Toggle favourite" onclick="event.stopPropagation(); window.toggleFavourite && window.toggleFavourite('${illustration}')">
|
|
284
367
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="${isFav ? 'gold' : 'none'}" viewBox="0 0 24 24" stroke="gold">
|
|
@@ -293,15 +376,15 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
293
376
|
</div>
|
|
294
377
|
<div class="button-group flex flex-row items-center justify-center gap-2 mt-2">
|
|
295
378
|
<button id="CopyID" class="button flex items-center justify-center min-w-[80px] px-1.5 py-0.5 text-[11px] text-gray-400 border border-gray-300 dark:border-gray-700 rounded bg-white dark:bg-gray-800 font-normal hover:bg-blue-100 dark:hover:bg-blue-900 transition relative text-center" onmouseover="showTooltip(this)" onmouseout="hideTooltip(this)" onclick="copyText(this)">
|
|
296
|
-
Copy
|
|
297
|
-
<span class="tooltiptext left-1/2 -translate-x-1/2 bottom-10 shadow-md">Copy
|
|
379
|
+
Copy Dot Code
|
|
380
|
+
<span class="tooltiptext left-1/2 -translate-x-1/2 bottom-10 shadow-md">Copy Dot Code</span>
|
|
298
381
|
</button>
|
|
299
382
|
<button class="button flex items-center justify-center min-w-[80px] px-1.5 py-0.5 text-[11px] text-gray-400 border border-gray-300 dark:border-gray-700 rounded bg-white dark:bg-gray-800 font-normal hover:bg-blue-100 dark:hover:bg-blue-900 transition relative text-center" onmouseover="showTooltip(this)" onmouseout="hideTooltip(this)" onclick="copyCode(this)">
|
|
300
383
|
Copy Code
|
|
301
384
|
<span class="tooltiptext left-1/2 -translate-x-1/2 bottom-10 shadow-md">Copy Code</span>
|
|
302
385
|
</button>
|
|
303
386
|
</div>
|
|
304
|
-
<pre class="codeBlock"><code class="codeBlock"
|
|
387
|
+
<pre class="codeBlock"><code class="codeBlock">${codeString}</code></pre>
|
|
305
388
|
`;
|
|
306
389
|
list.appendChild(div);
|
|
307
390
|
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<svg width="249" height="249" viewBox="0 0 249 249" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<circle cx="124.019" cy="124.5" r="93" fill="#494F60" fill-opacity="0.3"/>
|
|
3
|
+
<circle cx="30.5632" cy="167.808" r="3.19118" fill="#494F60" fill-opacity="0.3"/>
|
|
4
|
+
<rect x="49.73" y="50.2109" width="148.578" height="148.578" rx="74.2891" fill="#3D465C"/>
|
|
5
|
+
<rect x="58.019" y="58.5" width="132" height="132" rx="66" fill="#555F77"/>
|
|
6
|
+
<g clip-path="url(#clip0_4440_5148)">
|
|
7
|
+
<rect x="62.5068" y="64.082" width="123.389" height="123.389" rx="61.6946" fill="#252D40"/>
|
|
8
|
+
<rect x="120.916" y="61.8945" width="6.57102" height="14.9673" rx="0.730114" fill="#8591AE"/>
|
|
9
|
+
<rect x="189.181" y="123.59" width="6.57102" height="14.9673" rx="0.730114" transform="rotate(90 189.181 123.59)" fill="#8591AE"/>
|
|
10
|
+
<rect x="120.916" y="176.883" width="6.57102" height="14.9673" rx="0.730114" fill="#8591AE"/>
|
|
11
|
+
<rect x="74.1885" y="123.59" width="6.57102" height="14.9673" rx="0.730114" transform="rotate(90 74.1885 123.59)" fill="#8591AE"/>
|
|
12
|
+
<rect x="81.4932" y="99.1797" width="5.84091" height="50.6592" rx="2.92045" transform="rotate(-54.7849 81.4932 99.1797)" fill="#AAB2C5"/>
|
|
13
|
+
<rect x="140.172" y="100.812" width="5.84091" height="26.0643" rx="2.92045" transform="rotate(36.7803 140.172 100.812)" fill="#AAB2C5"/>
|
|
14
|
+
<rect x="167.322" y="159.566" width="1.5513" height="53.2885" rx="0.775649" transform="rotate(128.345 167.322 159.566)" fill="#AAB2C5"/>
|
|
15
|
+
<rect x="116.353" y="117.93" width="15.6974" height="15.6974" rx="7.84872" fill="#AAB2C5"/>
|
|
16
|
+
<rect x="120.551" y="122.129" width="7.30114" height="7.30114" rx="3.65057" fill="#D6DCE8"/>
|
|
17
|
+
</g>
|
|
18
|
+
<circle cx="205.166" cy="47.9113" r="7.29412" fill="#494F60" fill-opacity="0.3"/>
|
|
19
|
+
<circle cx="212.916" cy="31.9545" r="4.10294" fill="#494F60" fill-opacity="0.3"/>
|
|
20
|
+
<circle cx="39.6809" cy="58.3982" r="3.19118" fill="#494F60" fill-opacity="0.3"/>
|
|
21
|
+
<circle cx="30.5628" cy="193.338" r="6.83824" fill="#494F60" fill-opacity="0.3"/>
|
|
22
|
+
<defs>
|
|
23
|
+
<clipPath id="clip0_4440_5148">
|
|
24
|
+
<rect x="62.5068" y="64.082" width="123.389" height="123.389" rx="61.6946" fill="white"/>
|
|
25
|
+
</clipPath>
|
|
26
|
+
</defs>
|
|
27
|
+
</svg>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<svg width="249" height="249" viewBox="0 0 249 249" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<circle cx="124.438" cy="124.5" r="93" fill="#94A8E1" fill-opacity="0.2"/>
|
|
3
|
+
<circle cx="30.9822" cy="167.808" r="3.19118" fill="#94A8E1" fill-opacity="0.2"/>
|
|
4
|
+
<rect x="50.1489" y="50.2109" width="148.578" height="148.578" rx="74.2891" fill="#D6DCE8"/>
|
|
5
|
+
<rect x="58.438" y="58.5" width="132" height="132" rx="66" fill="#CBD2E2"/>
|
|
6
|
+
<g clip-path="url(#clip0_4440_5208)">
|
|
7
|
+
<rect x="62.9258" y="64.082" width="123.389" height="123.389" rx="61.6946" fill="#F8F9FC"/>
|
|
8
|
+
<rect x="121.335" y="61.8945" width="6.57102" height="14.9673" rx="0.730114" fill="#CBD2E2"/>
|
|
9
|
+
<rect x="189.6" y="123.59" width="6.57102" height="14.9673" rx="0.730114" transform="rotate(90 189.6 123.59)" fill="#CBD2E2"/>
|
|
10
|
+
<rect x="121.335" y="176.883" width="6.57102" height="14.9673" rx="0.730114" fill="#CBD2E2"/>
|
|
11
|
+
<rect x="74.6074" y="123.59" width="6.57102" height="14.9673" rx="0.730114" transform="rotate(90 74.6074 123.59)" fill="#CBD2E2"/>
|
|
12
|
+
<rect x="81.9121" y="99.1797" width="5.84091" height="50.6592" rx="2.92045" transform="rotate(-54.7849 81.9121 99.1797)" fill="#8591AE"/>
|
|
13
|
+
<rect x="140.591" y="100.812" width="5.84091" height="26.0643" rx="2.92045" transform="rotate(36.7803 140.591 100.812)" fill="#8591AE"/>
|
|
14
|
+
<rect x="167.741" y="159.566" width="1.5513" height="53.2885" rx="0.775649" transform="rotate(128.345 167.741 159.566)" fill="#8591AE"/>
|
|
15
|
+
<rect x="116.771" y="117.93" width="15.6974" height="15.6974" rx="7.84872" fill="#8591AE"/>
|
|
16
|
+
<rect x="120.97" y="122.129" width="7.30114" height="7.30114" rx="3.65057" fill="#F8F9FC"/>
|
|
17
|
+
</g>
|
|
18
|
+
<circle cx="205.585" cy="47.9113" r="7.29412" fill="#94A8E1" fill-opacity="0.2"/>
|
|
19
|
+
<circle cx="213.335" cy="31.9545" r="4.10294" fill="#94A8E1" fill-opacity="0.2"/>
|
|
20
|
+
<circle cx="40.0999" cy="58.3982" r="3.19118" fill="#94A8E1" fill-opacity="0.2"/>
|
|
21
|
+
<circle cx="30.9818" cy="193.338" r="6.83824" fill="#94A8E1" fill-opacity="0.2"/>
|
|
22
|
+
<defs>
|
|
23
|
+
<clipPath id="clip0_4440_5208">
|
|
24
|
+
<rect x="62.9258" y="64.082" width="123.389" height="123.389" rx="61.6946" fill="white"/>
|
|
25
|
+
</clipPath>
|
|
26
|
+
</defs>
|
|
27
|
+
</svg>
|
package/index.css
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
/*Path: --------- './illustrations/light/global/*.svg ----- light */
|
|
3
3
|
/*Path: --------- './illustrations/dark/global/*.svg ------ dark */
|
|
4
4
|
|
|
5
|
+
.dot-illustration img.time.light.global-illustration {
|
|
6
|
+
content: url('./illustrations/light/global/time.svg');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.dot-illustration img.time.dark.global-illustration {
|
|
10
|
+
content: url('./illustrations/dark/global/time.svg');
|
|
11
|
+
}
|
|
12
|
+
|
|
5
13
|
.dot-illustration img.forbiden-access.light.global-illustration {
|
|
6
14
|
content: url('./illustrations/light/global/forbiden-access.svg');
|
|
7
15
|
}
|
package/package.json
CHANGED