@customviews-js/customviews 1.1.6 → 1.1.8

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @customviews-js/customviews v1.1.6
2
+ * @customviews-js/customviews v1.1.8
3
3
  * (c) 2025 Chan Ger Teck
4
4
  * Released under the MIT License.
5
5
  */
@@ -269,102 +269,6 @@ class VisibilityManager {
269
269
  }
270
270
  }
271
271
 
272
- /** --- Icon utilities --- */
273
- function ensureFontAwesomeInjected() {
274
- const isFontAwesomeLoaded = Array.from(document.styleSheets).some(sheet => sheet.href && (sheet.href.includes('font-awesome') || sheet.href.includes('fontawesome')));
275
- if (isFontAwesomeLoaded)
276
- return;
277
- const link = document.createElement('link');
278
- link.rel = 'stylesheet';
279
- link.href = 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css';
280
- link.setAttribute('data-customviews-fontawesome', 'true');
281
- document.head.appendChild(link);
282
- }
283
- function replaceIconShortcodes(text) {
284
- // Matches :fa-*, :fas-*, :fab-* etc.
285
- return text.replace(/:(fa[b|s|r]?)-([\w-]+):/g, (_, style, icon) => {
286
- // style = fa, fas, fab, far, etc.
287
- // Default to "fa" if only "fa-" is given
288
- return `<i class="${style} fa-${icon}"></i>`;
289
- });
290
- }
291
- /** --- Basic renderers --- */
292
- function renderImage(el, asset) {
293
- if (!asset.src)
294
- return;
295
- el.innerHTML = '';
296
- const img = document.createElement('img');
297
- img.src = asset.src;
298
- img.alt = asset.alt || '';
299
- // Apply custom styling if provided
300
- if (asset.className) {
301
- img.className = asset.className;
302
- }
303
- if (asset.style) {
304
- img.setAttribute('style', asset.style);
305
- }
306
- // Default styles (can be overridden by asset.style)
307
- img.style.maxWidth = img.style.maxWidth || '100%';
308
- img.style.height = img.style.height || 'auto';
309
- img.style.display = img.style.display || 'block';
310
- el.appendChild(img);
311
- }
312
- function renderText(el, asset) {
313
- if (asset.content != null) {
314
- el.textContent = asset.content;
315
- }
316
- // Apply custom styling if provided
317
- if (asset.className) {
318
- el.className = asset.className;
319
- }
320
- if (asset.style) {
321
- el.setAttribute('style', asset.style);
322
- }
323
- }
324
- function renderHtml(el, asset) {
325
- if (asset.content != null) {
326
- el.innerHTML = asset.content;
327
- }
328
- // Apply custom styling if provided
329
- if (asset.className) {
330
- el.className = asset.className;
331
- }
332
- if (asset.style) {
333
- el.setAttribute('style', asset.style);
334
- }
335
- }
336
- /** --- Unified asset renderer --- */
337
- function detectAssetType(asset) {
338
- // If src exists, it's an image
339
- if (asset.src)
340
- return 'image';
341
- // If content contains HTML tags, it's HTML
342
- if (asset.content && /<[^>]+>/.test(asset.content)) {
343
- return 'html';
344
- }
345
- return 'text';
346
- }
347
- function renderAssetInto(el, assetId, assetsManager) {
348
- const asset = assetsManager.get(assetId);
349
- if (!asset)
350
- return;
351
- const type = asset.type || detectAssetType(asset);
352
- switch (type) {
353
- case 'image':
354
- renderImage(el, asset);
355
- break;
356
- case 'text':
357
- renderText(el, asset);
358
- break;
359
- case 'html':
360
- renderHtml(el, asset);
361
- break;
362
- default:
363
- el.innerHTML = asset.content || String(asset);
364
- console.warn('[CustomViews] Unknown asset type:', type);
365
- }
366
- }
367
-
368
272
  // Constants for selectors
369
273
  const TABGROUP_SELECTOR = 'cv-tabgroup';
370
274
  const TAB_SELECTOR = 'cv-tab';
@@ -451,37 +355,35 @@ class TabManager {
451
355
  tabEl.classList.remove('cv-visible');
452
356
  }
453
357
  }
358
+ /**
359
+ * Extract header and body content from header component syntax: <cv-tab-header> and <cv-tab-body>
360
+ * Returns null if using old attribute-based syntax.
361
+ *
362
+ * @param tabEl The <cv-tab> element to inspect
363
+ * @returns Object with extracted content, or null if new syntax not used
364
+ */
365
+ static extractTabContent(tabEl) {
366
+ // Look for direct children
367
+ let headerEl = tabEl.querySelector(':scope > cv-tab-header');
368
+ if (!headerEl) {
369
+ return null;
370
+ }
371
+ const headerHTML = headerEl.innerHTML.trim();
372
+ // Find body element
373
+ let bodyEl = tabEl.querySelector(':scope > cv-tab-body');
374
+ // Fallback: try finding both header and body
375
+ // without :scope (in case of DOM manipulation) by iterating through tabEl.children if needed
376
+ return {
377
+ headerHTML,
378
+ bodyEl
379
+ };
380
+ }
454
381
  /**
455
382
  * Build navigation for tab groups with nav="auto" (one-time setup)
456
383
  */
457
384
  static buildNavs(rootEl, cfgGroups, onTabClick, onTabDoubleClick) {
458
385
  // Find all cv-tabgroup elements with nav="auto" or no nav attribute
459
386
  const tabGroups = rootEl.querySelectorAll(NAV_AUTO_SELECTOR);
460
- // Check if any tab headers contain Font Awesome shortcodes
461
- // Inject Font Awesome CSS only if needed
462
- let hasFontAwesomeShortcodes = false;
463
- tabGroups.forEach((groupEl) => {
464
- const groupId = groupEl.getAttribute('id');
465
- if (!groupId)
466
- return;
467
- const tabElements = Array.from(groupEl.children).filter((child) => child.tagName.toLowerCase() === 'cv-tab');
468
- // Check for Font Awesome shortcodes in tab headers
469
- tabElements.forEach((tabEl) => {
470
- const rawTabId = tabEl.getAttribute('id');
471
- if (!rawTabId)
472
- return;
473
- const splitIds = this.splitTabIds(rawTabId);
474
- const tabId = splitIds[0] || rawTabId;
475
- const header = tabEl.getAttribute('header') || this.getTabLabel(tabId, groupId, cfgGroups) || tabId || '';
476
- if (/:fa-[\w-]+:/.test(header)) {
477
- hasFontAwesomeShortcodes = true;
478
- }
479
- });
480
- });
481
- // Inject Font Awesome only if shortcodes are found
482
- if (hasFontAwesomeShortcodes) {
483
- ensureFontAwesomeInjected();
484
- }
485
387
  tabGroups.forEach((groupEl) => {
486
388
  const groupId = groupEl.getAttribute('id');
487
389
  if (!groupId)
@@ -516,23 +418,30 @@ class TabManager {
516
418
  const splitIds = this.splitTabIds(rawTabId);
517
419
  // If multiple IDs, use the first as primary
518
420
  const tabId = splitIds[0] || rawTabId;
519
- // Get header for this tab (single header, not multiple)
520
- const headerAttr = tabEl.getAttribute('header') || '';
421
+ // Get header for this tab - prefer new syntax over old attribute syntax
422
+ const extractedHeaderAndBody = this.extractTabContent(tabEl);
521
423
  let header = '';
522
- if (headerAttr) {
523
- // Single header provided on the element
524
- header = headerAttr;
424
+ // use <cv-tab-header> content if available
425
+ if (extractedHeaderAndBody && extractedHeaderAndBody.headerHTML) {
426
+ header = extractedHeaderAndBody.headerHTML;
525
427
  }
526
428
  else {
527
- // Use config label or id as fallback
528
- header = this.getTabLabel(tabId, groupId, cfgGroups) || tabId || '';
429
+ // use header attribute if available
430
+ const headerAttr = tabEl.getAttribute('header') || '';
431
+ if (headerAttr) {
432
+ header = headerAttr;
433
+ }
434
+ else {
435
+ // Use config label or id as fallback
436
+ header = this.getTabLabel(tabId, groupId, cfgGroups) || tabId || '';
437
+ }
529
438
  }
530
439
  // Create a single nav link for this tab element
531
440
  const listItem = document.createElement('li');
532
441
  listItem.className = 'nav-item';
533
442
  const navLink = document.createElement('a');
534
443
  navLink.className = 'nav-link';
535
- navLink.innerHTML = replaceIconShortcodes(header);
444
+ navLink.innerHTML = header;
536
445
  navLink.href = '#';
537
446
  navLink.setAttribute('data-tab-id', tabId);
538
447
  navLink.setAttribute('data-raw-tab-id', rawTabId);
@@ -769,6 +678,83 @@ class AssetsManager {
769
678
  }
770
679
  }
771
680
 
681
+ /** --- Basic renderers --- */
682
+ function renderImage(el, asset) {
683
+ if (!asset.src)
684
+ return;
685
+ el.innerHTML = '';
686
+ const img = document.createElement('img');
687
+ img.src = asset.src;
688
+ img.alt = asset.alt || '';
689
+ // Apply custom styling if provided
690
+ if (asset.className) {
691
+ img.className = asset.className;
692
+ }
693
+ if (asset.style) {
694
+ img.setAttribute('style', asset.style);
695
+ }
696
+ // Default styles (can be overridden by asset.style)
697
+ img.style.maxWidth = img.style.maxWidth || '100%';
698
+ img.style.height = img.style.height || 'auto';
699
+ img.style.display = img.style.display || 'block';
700
+ el.appendChild(img);
701
+ }
702
+ function renderText(el, asset) {
703
+ if (asset.content != null) {
704
+ el.textContent = asset.content;
705
+ }
706
+ // Apply custom styling if provided
707
+ if (asset.className) {
708
+ el.className = asset.className;
709
+ }
710
+ if (asset.style) {
711
+ el.setAttribute('style', asset.style);
712
+ }
713
+ }
714
+ function renderHtml(el, asset) {
715
+ if (asset.content != null) {
716
+ el.innerHTML = asset.content;
717
+ }
718
+ // Apply custom styling if provided
719
+ if (asset.className) {
720
+ el.className = asset.className;
721
+ }
722
+ if (asset.style) {
723
+ el.setAttribute('style', asset.style);
724
+ }
725
+ }
726
+ /** --- Unified asset renderer --- */
727
+ function detectAssetType(asset) {
728
+ // If src exists, it's an image
729
+ if (asset.src)
730
+ return 'image';
731
+ // If content contains HTML tags, it's HTML
732
+ if (asset.content && /<[^>]+>/.test(asset.content)) {
733
+ return 'html';
734
+ }
735
+ return 'text';
736
+ }
737
+ function renderAssetInto(el, assetId, assetsManager) {
738
+ const asset = assetsManager.get(assetId);
739
+ if (!asset)
740
+ return;
741
+ const type = asset.type || detectAssetType(asset);
742
+ switch (type) {
743
+ case 'image':
744
+ renderImage(el, asset);
745
+ break;
746
+ case 'text':
747
+ renderText(el, asset);
748
+ break;
749
+ case 'html':
750
+ renderHtml(el, asset);
751
+ break;
752
+ default:
753
+ el.innerHTML = asset.content || String(asset);
754
+ console.warn('[CustomViews] Unknown asset type:', type);
755
+ }
756
+ }
757
+
772
758
  // Constants for selectors
773
759
  const TOGGLE_DATA_SELECTOR = "[data-cv-toggle], [data-customviews-toggle]";
774
760
  const TOGGLE_ELEMENT_SELECTOR = "cv-toggle";
@@ -836,166 +822,188 @@ class ToggleManager {
836
822
  /**
837
823
  * Styles for toggle visibility and animations
838
824
  */
839
- const TOGGLE_STYLES = `
840
- /* Core toggle visibility transitions */
841
- [data-cv-toggle], [data-customviews-toggle], cv-toggle {
842
- transition: opacity 150ms ease,
843
- transform 150ms ease,
844
- max-height 200ms ease,
845
- margin 150ms ease;
846
- will-change: opacity, transform, max-height, margin;
847
- }
848
-
849
- .cv-visible {
850
- opacity: 1 !important;
851
- transform: translateY(0) !important;
852
- max-height: var(--cv-max-height, 9999px) !important;
853
- }
854
-
855
- .cv-hidden {
856
- opacity: 0 !important;
857
- transform: translateY(-4px) !important;
858
- pointer-events: none !important;
859
- padding-top: 0 !important;
860
- padding-bottom: 0 !important;
861
- border-top-width: 0 !important;
862
- border-bottom-width: 0 !important;
863
- max-height: 0 !important;
864
- margin-top: 0 !important;
865
- margin-bottom: 0 !important;
866
- overflow: hidden !important;
867
- }
825
+ const TOGGLE_STYLES = `
826
+ /* Core toggle visibility transitions */
827
+ [data-cv-toggle], [data-customviews-toggle], cv-toggle {
828
+ transition: opacity 150ms ease,
829
+ transform 150ms ease,
830
+ max-height 200ms ease,
831
+ margin 150ms ease;
832
+ will-change: opacity, transform, max-height, margin;
833
+ }
834
+
835
+ .cv-visible {
836
+ opacity: 1 !important;
837
+ transform: translateY(0) !important;
838
+ max-height: var(--cv-max-height, 9999px) !important;
839
+ }
840
+
841
+ .cv-hidden {
842
+ opacity: 0 !important;
843
+ transform: translateY(-4px) !important;
844
+ pointer-events: none !important;
845
+ padding-top: 0 !important;
846
+ padding-bottom: 0 !important;
847
+ border-top-width: 0 !important;
848
+ border-bottom-width: 0 !important;
849
+ max-height: 0 !important;
850
+ margin-top: 0 !important;
851
+ margin-bottom: 0 !important;
852
+ overflow: hidden !important;
853
+ }
868
854
  `;
869
855
 
870
856
  /**
871
857
  * Styles for tab groups and tab navigation
872
858
  */
873
- const TAB_STYLES = `
874
- /* Tab navigation styles - Bootstrap-style tabs matching MarkBind */
875
- .cv-tabs-nav {
876
- display: flex;
877
- flex-wrap: wrap;
878
- padding-left: 0;
879
- margin-top: 0.5rem;
880
- margin-bottom: 1rem;
881
- list-style: none;
882
- border-bottom: 1px solid #dee2e6;
883
- }
884
-
885
- .cv-tabs-nav .nav-item {
886
- margin-bottom: -1px;
887
- list-style: none;
888
- display: inline-block;
889
- }
890
-
891
- .cv-tabs-nav .nav-link {
892
- display: block;
893
- padding: 0.5rem 1rem;
894
- color: #495057;
895
- text-decoration: none;
896
- background-color: transparent;
897
- border: 1px solid transparent;
898
- border-top-left-radius: 0.25rem;
899
- border-top-right-radius: 0.25rem;
900
- transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
901
- cursor: pointer;
902
- }
903
-
904
- .cv-tabs-nav .nav-link:hover,
905
- .cv-tabs-nav .nav-link:focus {
906
- border-color: #e9ecef #e9ecef #dee2e6;
907
- isolation: isolate;
908
- }
909
-
910
- .cv-tabs-nav .nav-link.active {
911
- color: #495057;
912
- background-color: #fff;
913
- border-color: #dee2e6 #dee2e6 #fff;
914
- }
915
-
916
- .cv-tabs-nav .nav-link:focus {
917
- outline: 0;
918
- box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
919
- }
920
-
921
- /* Legacy button-based nav (deprecated, kept for compatibility) */
922
- .cv-tabs-nav-item {
923
- background: none;
924
- border: none;
925
- border-bottom: 2px solid transparent;
926
- padding: 0.5rem 1rem;
927
- cursor: pointer;
928
- font-size: 1rem;
929
- color: #6c757d;
930
- transition: color 150ms ease, border-color 150ms ease;
931
- }
932
-
933
- .cv-tabs-nav-item:hover {
934
- color: #495057;
935
- border-bottom-color: #dee2e6;
936
- }
937
-
938
- .cv-tabs-nav-item.active {
939
- color: #007bff;
940
- border-bottom-color: #007bff;
941
- font-weight: 500;
942
- }
943
-
944
- .cv-tabs-nav-item:focus {
945
- outline: 2px solid #007bff;
946
- outline-offset: 2px;
947
- }
948
-
949
- /* Tab panel base styles */
950
- cv-tab {
951
- display: block;
952
- }
953
-
954
- /* Override visibility for tab panels - use display instead of collapse animation */
955
- cv-tab.cv-hidden {
956
- display: none !important;
957
- }
958
-
959
- cv-tab.cv-visible {
960
- display: block !important;
961
- }
962
-
963
- cv-tabgroup {
964
- display: block;
965
- margin-bottom: 1.5rem;
966
- }
967
-
968
- /* Bottom border line for tab groups */
969
- .cv-tabgroup-bottom-border {
970
- border-bottom: 1px solid #dee2e6;
971
- margin-top: 1rem;
972
- }
973
-
974
- /* Tab content wrapper */
975
- .cv-tab-content {
976
- padding: 1rem 0;
977
- }
978
-
979
- /* Viewer-controlled nav visibility: hide nav containers when requested */
980
- .cv-tabs-nav-hidden {
981
- display: none !important;
982
- }
983
-
984
- /* Print-friendly: hide tab navigation when printing to reduce clutter */
985
- @media print {
986
- .cv-tabs-nav {
987
- display: none !important;
988
- }
989
- }
859
+ const TAB_STYLES = `
860
+ /* Tab navigation styles - Bootstrap-style tabs matching MarkBind */
861
+ .cv-tabs-nav {
862
+ display: flex;
863
+ flex-wrap: wrap;
864
+ padding-left: 0;
865
+ margin-top: 0.5rem;
866
+ margin-bottom: 1rem;
867
+ list-style: none;
868
+ border-bottom: 1px solid #dee2e6;
869
+
870
+ align-items: stretch;
871
+ }
872
+
873
+ .cv-tabs-nav .nav-item {
874
+ margin-bottom: -1px;
875
+ list-style: none;
876
+ display: flex; /* was inline-block → make flex to stretch height */
877
+ align-items: stretch; /* stretch link to full height */
878
+ }
879
+
880
+ .cv-tabs-nav .nav-link {
881
+ display: flex;
882
+ align-items: center;
883
+ justify-content: center;
884
+ padding: 0.5rem 1rem;
885
+ color: #495057;
886
+ text-decoration: none;
887
+ background-color: transparent;
888
+ border: 1px solid transparent;
889
+ border-top-left-radius: 0.25rem;
890
+ border-top-right-radius: 0.25rem;
891
+ transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
892
+ cursor: pointer;
893
+ min-height: 2.5rem;
894
+ box-sizing: border-box;
895
+ }
896
+
897
+ .cv-tabs-nav .nav-link p {
898
+ margin: 0; /* remove default margins */
899
+ display: inline; /* or inline-block */
900
+ }
901
+
902
+ .cv-tabs-nav .nav-link:hover,
903
+ .cv-tabs-nav .nav-link:focus {
904
+ border-color: #e9ecef #e9ecef #dee2e6;
905
+ isolation: isolate;
906
+ }
907
+
908
+ .cv-tabs-nav .nav-link.active {
909
+ color: #495057;
910
+ background-color: #fff;
911
+ border-color: #dee2e6 #dee2e6 #fff;
912
+ }
913
+
914
+ .cv-tabs-nav .nav-link:focus {
915
+ outline: 0;
916
+ box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
917
+ }
918
+
919
+ /* Legacy button-based nav (deprecated, kept for compatibility) */
920
+ .cv-tabs-nav-item {
921
+ background: none;
922
+ border: none;
923
+ border-bottom: 2px solid transparent;
924
+ padding: 0.5rem 1rem;
925
+ cursor: pointer;
926
+ font-size: 1rem;
927
+ color: #6c757d;
928
+ transition: color 150ms ease, border-color 150ms ease;
929
+ }
930
+
931
+ .cv-tabs-nav-item:hover {
932
+ color: #495057;
933
+ border-bottom-color: #dee2e6;
934
+ }
935
+
936
+ .cv-tabs-nav-item.active {
937
+ color: #007bff;
938
+ border-bottom-color: #007bff;
939
+ font-weight: 500;
940
+ }
941
+
942
+ .cv-tabs-nav-item:focus {
943
+ outline: 2px solid #007bff;
944
+ outline-offset: 2px;
945
+ }
946
+
947
+ /* Tab panel base styles */
948
+ cv-tab {
949
+ display: block;
950
+ }
951
+
952
+ /* Hide cv-tab-header source element; content is extracted to nav link */
953
+ cv-tab-header {
954
+ display: none !important;
955
+ }
956
+
957
+ /* Allow cv-tab-body to flow naturally */
958
+ cv-tab-body {
959
+ display: block;
960
+ }
961
+
962
+ /* Override visibility for tab panels - use display instead of collapse animation */
963
+ cv-tab.cv-hidden {
964
+ display: none !important;
965
+ }
966
+
967
+ cv-tab.cv-visible {
968
+ display: block !important;
969
+ }
970
+
971
+ cv-tabgroup {
972
+ display: block;
973
+ margin-bottom: 1.5rem;
974
+ }
975
+
976
+ /* Bottom border line for tab groups */
977
+ .cv-tabgroup-bottom-border {
978
+ border-bottom: 1px solid #dee2e6;
979
+ margin-top: 1rem;
980
+ }
981
+
982
+ /* Tab content wrapper */
983
+ .cv-tab-content {
984
+ padding: 1rem 0;
985
+ }
986
+
987
+ /* Viewer-controlled nav visibility: hide nav containers when requested */
988
+ .cv-tabs-nav-hidden {
989
+ display: none !important;
990
+ }
991
+
992
+ /* Print-friendly: hide tab navigation when printing to reduce clutter */
993
+ @media print {
994
+ .cv-tabs-nav {
995
+ display: none !important;
996
+ }
997
+ }
990
998
  `;
991
999
 
992
1000
  /**
993
1001
  * Combined core styles for toggles and tabs
994
1002
  */
995
- const CORE_STYLES = `
996
- ${TOGGLE_STYLES}
997
-
998
- ${TAB_STYLES}
1003
+ const CORE_STYLES = `
1004
+ ${TOGGLE_STYLES}
1005
+
1006
+ ${TAB_STYLES}
999
1007
  `;
1000
1008
  /**
1001
1009
  * Add styles for hiding and showing toggles animations and transitions to the document head
@@ -1313,6 +1321,24 @@ class CVToggle extends HTMLElement {
1313
1321
  // Element is managed by Core
1314
1322
  }
1315
1323
  }
1324
+ /**
1325
+ * <cv-tab-header> element - represents tab header with rich HTML formatting
1326
+ * Content is extracted and used in the navigation link
1327
+ */
1328
+ class CVTabHeader extends HTMLElement {
1329
+ connectedCallback() {
1330
+ // Element is a semantic container; TabManager extracts its content
1331
+ }
1332
+ }
1333
+ /**
1334
+ * <cv-tab-body> element - represents tab body content
1335
+ * Semantic container for tab panel content
1336
+ */
1337
+ class CVTabBody extends HTMLElement {
1338
+ connectedCallback() {
1339
+ // Element is a semantic container; visibility managed by TabManager
1340
+ }
1341
+ }
1316
1342
  /**
1317
1343
  * Register custom elements
1318
1344
  */
@@ -1327,6 +1353,12 @@ function registerCustomElements() {
1327
1353
  if (!customElements.get('cv-toggle')) {
1328
1354
  customElements.define('cv-toggle', CVToggle);
1329
1355
  }
1356
+ if (!customElements.get('cv-tab-header')) {
1357
+ customElements.define('cv-tab-header', CVTabHeader);
1358
+ }
1359
+ if (!customElements.get('cv-tab-body')) {
1360
+ customElements.define('cv-tab-body', CVTabBody);
1361
+ }
1330
1362
  }
1331
1363
 
1332
1364
  /**
@@ -1389,1043 +1421,1043 @@ class CustomViews {
1389
1421
  * Note: Styles are kept as a TypeScript string for compatibility with the build system.
1390
1422
  * This approach ensures the styles are properly bundled and don't require separate CSS file handling.
1391
1423
  */
1392
- const WIDGET_STYLES = `
1393
- /* Rounded rectangle widget icon styles */
1394
- .cv-widget-icon {
1395
- position: fixed;
1396
- /* Slightly transparent by default so the widget is subtle at the page edge */
1397
- background: rgba(255, 255, 255, 0.92);
1398
- color: rgba(0, 0, 0, 0.9);
1399
- opacity: 0.6;
1400
- display: flex;
1401
- align-items: center;
1402
- justify-content: center;
1403
- font-size: 18px;
1404
- font-weight: bold;
1405
- cursor: pointer;
1406
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
1407
- z-index: 9998;
1408
- transition: all 0.3s ease;
1409
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
1410
- }
1411
-
1412
- .cv-widget-icon:hover {
1413
- /* Become fully opaque on hover to improve readability */
1414
- background: rgba(255, 255, 255, 1);
1415
- color: rgba(0, 0, 0, 1);
1416
- opacity: 1;
1417
- }
1418
-
1419
- /* Top-right: rounded end on left, sticks out leftward on hover */
1420
- .cv-widget-top-right {
1421
- top: 20px;
1422
- right: 0;
1423
- border-radius: 18px 0 0 18px;
1424
- padding-left: 8px;
1425
- justify-content: flex-start;
1426
- }
1427
-
1428
- /* Top-left: rounded end on right, sticks out rightward on hover */
1429
- .cv-widget-top-left {
1430
- top: 20px;
1431
- left: 0;
1432
- border-radius: 0 18px 18px 0;
1433
- padding-right: 8px;
1434
- justify-content: flex-end;
1435
- }
1436
-
1437
- /* Bottom-right: rounded end on left, sticks out leftward on hover */
1438
- .cv-widget-bottom-right {
1439
- bottom: 20px;
1440
- right: 0;
1441
- border-radius: 18px 0 0 18px;
1442
- padding-left: 8px;
1443
- justify-content: flex-start;
1444
- }
1445
-
1446
- /* Bottom-left: rounded end on right, sticks out rightward on hover */
1447
- .cv-widget-bottom-left {
1448
- bottom: 20px;
1449
- left: 0;
1450
- border-radius: 0 18px 18px 0;
1451
- padding-right: 8px;
1452
- justify-content: flex-end;
1453
- }
1454
-
1455
- /* Middle-left: rounded end on right, sticks out rightward on hover */
1456
- .cv-widget-middle-left {
1457
- top: 50%;
1458
- left: 0;
1459
- transform: translateY(-50%);
1460
- border-radius: 0 18px 18px 0;
1461
- padding-right: 8px;
1462
- justify-content: flex-end;
1463
- }
1464
-
1465
- /* Middle-right: rounded end on left, sticks out leftward on hover */
1466
- .cv-widget-middle-right {
1467
- top: 50%;
1468
- right: 0;
1469
- transform: translateY(-50%);
1470
- border-radius: 18px 0 0 18px;
1471
- padding-left: 8px;
1472
- justify-content: flex-start;
1473
- }
1474
-
1475
- .cv-widget-top-right,
1476
- .cv-widget-middle-right,
1477
- .cv-widget-bottom-right,
1478
- .cv-widget-top-left,
1479
- .cv-widget-middle-left,
1480
- .cv-widget-bottom-left {
1481
- height: 36px;
1482
- width: 36px;
1483
- }
1484
-
1485
- .cv-widget-middle-right:hover,
1486
- .cv-widget-top-right:hover,
1487
- .cv-widget-bottom-right:hover,
1488
- .cv-widget-top-left:hover,
1489
- .cv-widget-middle-left:hover,
1490
- .cv-widget-bottom-left:hover {
1491
- width: 55px;
1492
- }
1493
-
1494
- /* Modal content styles */
1495
- .cv-widget-section {
1496
- margin-bottom: 16px;
1497
- }
1498
-
1499
- .cv-widget-section:last-child {
1500
- margin-bottom: 0;
1501
- }
1502
-
1503
- .cv-widget-section label {
1504
- display: block;
1505
- margin-bottom: 4px;
1506
- font-weight: 500;
1507
- color: #555;
1508
- }
1509
-
1510
- .cv-widget-profile-select,
1511
- .cv-widget-state-select {
1512
- width: 100%;
1513
- padding: 8px 12px;
1514
- border: 1px solid #ddd;
1515
- border-radius: 4px;
1516
- background: white;
1517
- font-size: 14px;
1518
- }
1519
-
1520
- .cv-widget-profile-select:focus,
1521
- .cv-widget-state-select:focus {
1522
- outline: none;
1523
- border-color: #007bff;
1524
- box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
1525
- }
1526
-
1527
- .cv-widget-profile-select:disabled,
1528
- .cv-widget-state-select:disabled {
1529
- background: #f8f9fa;
1530
- color: #6c757d;
1531
- cursor: not-allowed;
1532
- }
1533
-
1534
- .cv-widget-current {
1535
- margin: 16px 0;
1536
- padding: 12px;
1537
- background: #f8f9fa;
1538
- border-radius: 4px;
1539
- border-left: 4px solid #007bff;
1540
- }
1541
-
1542
- .cv-widget-current label {
1543
- font-size: 12px;
1544
- text-transform: uppercase;
1545
- letter-spacing: 0.5px;
1546
- color: #666;
1547
- margin-bottom: 4px;
1548
- }
1549
-
1550
- .cv-widget-current-view {
1551
- font-weight: 500;
1552
- color: #333;
1553
- }
1554
-
1555
- .cv-widget-reset {
1556
- width: 100%;
1557
- padding: 8px 16px;
1558
- background: #dc3545;
1559
- color: white;
1560
- border: none;
1561
- border-radius: 4px;
1562
- cursor: pointer;
1563
- font-size: 14px;
1564
- font-weight: 500;
1565
- }
1566
-
1567
- .cv-widget-reset:hover {
1568
- background: #c82333;
1569
- }
1570
-
1571
- .cv-widget-reset:active {
1572
- background: #bd2130;
1573
- }
1574
-
1575
- /* Responsive design for mobile */
1576
- @media (max-width: 768px) {
1577
- .cv-widget-top-right,
1578
- .cv-widget-top-left {
1579
- top: 10px;
1580
- }
1581
-
1582
- .cv-widget-bottom-right,
1583
- .cv-widget-bottom-left {
1584
- bottom: 10px;
1585
- }
1586
-
1587
- /* All widgets stay flush with screen edges */
1588
- .cv-widget-top-right,
1589
- .cv-widget-bottom-right,
1590
- .cv-widget-middle-right {
1591
- right: 0;
1592
- }
1593
-
1594
- .cv-widget-top-left,
1595
- .cv-widget-bottom-left,
1596
- .cv-widget-middle-left {
1597
- left: 0;
1598
- }
1599
-
1600
- /* Slightly smaller on mobile */
1601
- .cv-widget-icon {
1602
- width: 60px;
1603
- height: 32px;
1604
- }
1605
-
1606
- .cv-widget-icon:hover {
1607
- width: 75px;
1608
- }
1609
- }
1610
-
1611
- /* Modal styles */
1612
- .cv-widget-modal-overlay {
1613
- position: fixed;
1614
- top: 0;
1615
- left: 0;
1616
- right: 0;
1617
- bottom: 0;
1618
- background: rgba(0, 0, 0, 0.5);
1619
- display: flex;
1620
- align-items: center;
1621
- justify-content: center;
1622
- z-index: 10002;
1623
- animation: fadeIn 0.2s ease;
1624
- }
1625
-
1626
- @keyframes fadeIn {
1627
- from { opacity: 0; }
1628
- to { opacity: 1; }
1629
- }
1630
-
1631
- .cv-widget-modal {
1632
- background: white;
1633
- border-radius: 0.75rem;
1634
- box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
1635
- max-width: 32rem;
1636
- width: 90vw;
1637
- max-height: 80vh;
1638
- animation: slideIn 0.2s ease;
1639
- display: flex;
1640
- flex-direction: column;
1641
- }
1642
-
1643
- @keyframes slideIn {
1644
- from {
1645
- opacity: 0;
1646
- transform: scale(0.9) translateY(-20px);
1647
- }
1648
- to {
1649
- opacity: 1;
1650
- transform: scale(1) translateY(0);
1651
- }
1652
- }
1653
-
1654
- .cv-modal-header {
1655
- display: flex;
1656
- align-items: center;
1657
- justify-content: space-between;
1658
- padding: 0.5rem 1rem;
1659
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
1660
- }
1661
-
1662
- .cv-modal-header-content {
1663
- display: flex;
1664
- align-items: center;
1665
- gap: 0.75rem;
1666
- }
1667
-
1668
- .cv-modal-icon {
1669
- position: relative;
1670
- width: 1rem;
1671
- height: 1rem;
1672
- display: flex;
1673
- align-items: center;
1674
- justify-content: center;
1675
- border-radius: 9999px;
1676
- }
1677
-
1678
- .cv-modal-icon-svg {
1679
- width: 100%;
1680
- height: 100%;
1681
- opacity: 1;
1682
- }
1683
-
1684
- .cv-modal-title {
1685
- font-size: 1.125rem;
1686
- font-weight: bold;
1687
- color: rgba(0, 0, 0, 0.9);
1688
- margin: 0;
1689
- }
1690
-
1691
- .cv-modal-close {
1692
- width: 2rem;
1693
- height: 2rem;
1694
- display: flex;
1695
- align-items: center;
1696
- justify-content: center;
1697
- border-radius: 9999px;
1698
- background: transparent;
1699
- border: none;
1700
- color: rgba(0, 0, 0, 0.6);
1701
- cursor: pointer;
1702
- transition: all 0.2s ease;
1703
- }
1704
-
1705
- .cv-modal-close:hover {
1706
- background: rgba(62, 132, 244, 0.1);
1707
- color: #3e84f4;
1708
- }
1709
-
1710
- .cv-modal-close-icon {
1711
- width: 1.25rem;
1712
- height: 1.25rem;
1713
- }
1714
-
1715
- .cv-modal-main {
1716
- padding: 1rem;
1717
- flex: 1;
1718
- display: flex;
1719
- flex-direction: column;
1720
- gap: 1rem;
1721
- overflow-y: auto;
1722
- max-height: calc(80vh - 8rem);
1723
- }
1724
-
1725
- .cv-modal-description {
1726
- font-size: 0.875rem;
1727
- color: rgba(0, 0, 0, 0.8);
1728
- margin: 0;
1729
- line-height: 1.4;
1730
- }
1731
-
1732
- .cv-content-section,
1733
- .cv-tab-groups-section {
1734
- display: flex;
1735
- flex-direction: column;
1736
- gap: 0.75rem;
1737
- }
1738
-
1739
- .cv-section-heading {
1740
- font-size: 1rem;
1741
- font-weight: bold;
1742
- color: rgba(0, 0, 0, 0.9);
1743
- margin: 0;
1744
- }
1745
-
1746
- .cv-widget-modal-actions {
1747
- margin-top: 20px;
1748
- padding-top: 16px;
1749
- border-top: 1px solid #e9ecef;
1750
- }
1751
-
1752
- .cv-widget-restore {
1753
- width: 100%;
1754
- padding: 10px 16px;
1755
- background: #28a745;
1756
- color: white;
1757
- border: none;
1758
- border-radius: 4px;
1759
- cursor: pointer;
1760
- font-size: 14px;
1761
- font-weight: 500;
1762
- }
1763
-
1764
- .cv-widget-restore:hover {
1765
- background: #218838;
1766
- }
1767
-
1768
- .cv-widget-create-state {
1769
- width: 100%;
1770
- padding: 10px 16px;
1771
- background: #007bff;
1772
- color: white;
1773
- border: none;
1774
- border-radius: 4px;
1775
- cursor: pointer;
1776
- font-size: 14px;
1777
- font-weight: 500;
1778
- margin-bottom: 10px;
1779
- }
1780
-
1781
- .cv-widget-create-state:hover {
1782
- background: #0056b3;
1783
- }
1784
-
1785
- .cv-widget-theme-dark .cv-widget-modal {
1786
- background: #101722;
1787
- color: #e2e8f0;
1788
- }
1789
-
1790
- .cv-widget-theme-dark .cv-modal-header {
1791
- border-color: rgba(255, 255, 255, 0.1);
1792
- }
1793
-
1794
- .cv-widget-theme-dark .cv-modal-title {
1795
- color: #e2e8f0;
1796
- }
1797
-
1798
- .cv-widget-theme-dark .cv-modal-close {
1799
- color: rgba(255, 255, 255, 0.6);
1800
- }
1801
-
1802
- .cv-widget-theme-dark .cv-modal-close:hover {
1803
- background: rgba(62, 132, 244, 0.2);
1804
- color: #3e84f4;
1805
- }
1806
-
1807
- .cv-widget-theme-dark .cv-modal-description {
1808
- color: rgba(255, 255, 255, 0.8);
1809
- }
1810
-
1811
- .cv-widget-theme-dark .cv-section-heading {
1812
- color: #e2e8f0;
1813
- }
1814
-
1815
- .cv-widget-theme-dark .cv-toggles-container
1816
- .cv-widget-theme-dark .cv-tabgroups-container {
1817
- border-color: rgba(255, 255, 255, 0.1);
1818
- }
1819
-
1820
- .cv-widget-theme-dark .cv-toggle-card,
1821
- .cv-widget-theme-dark .cv-tabgroup-card {
1822
- background: #101722;
1823
- border-color: rgba(255, 255, 255, 0.1);
1824
- }
1825
-
1826
- .cv-widget-theme-dark .cv-toggle-title,
1827
- .cv-widget-theme-dark .cv-tabgroup-title {
1828
- color: #e2e8f0;
1829
- }
1830
-
1831
- .cv-widget-theme-dark .cv-toggle-description,
1832
- .cv-widget-theme-dark .cv-tabgroup-description {
1833
- color: rgba(255, 255, 255, 0.6);
1834
- }
1835
-
1836
- .cv-widget-theme-dark .cv-toggle-slider {
1837
- background: rgba(255, 255, 255, 0.2);
1838
- }
1839
-
1840
- .cv-widget-theme-dark .cv-tab-group-description {
1841
- color: rgba(255, 255, 255, 0.8);
1842
- }
1843
-
1844
- .cv-widget-theme-dark .cv-tabgroup-select {
1845
- background: #101722;
1846
- border-color: rgba(255, 255, 255, 0.2);
1847
- color: #e2e8f0;
1848
- }
1849
-
1850
- .cv-widget-theme-dark .cv-modal-footer {
1851
- border-color: rgba(255, 255, 255, 0.1);
1852
- background: #101722;
1853
- }
1854
-
1855
- .cv-widget-theme-dark .cv-reset-btn {
1856
- color: #e2e8f0;
1857
- background: rgba(255, 255, 255, 0.1);
1858
- }
1859
-
1860
- .cv-widget-theme-dark .cv-reset-btn:hover {
1861
- background: rgba(255, 255, 255, 0.2);
1862
- }
1863
-
1864
- /* Custom state creator styles */
1865
- .cv-custom-state-modal {
1866
- max-width: 500px;
1867
- }
1868
-
1869
- .cv-custom-state-form .cv-section-header {
1870
- font-size: 16px;
1871
- font-weight: 600;
1872
- color: #333;
1873
- border-bottom: 1px solid #e9ecef;
1874
- padding-bottom: 5px;
1875
- }
1876
-
1877
- .cv-custom-state-form p {
1878
- font-size: 15px;
1879
- line-height: 1.6;
1880
- color: #555;
1881
- margin-bottom: 24px;
1882
- text-align: justify;
1883
- }
1884
-
1885
- .cv-custom-state-section {
1886
- margin-bottom: 16px;
1887
- }
1888
-
1889
- .cv-custom-state-section label {
1890
- display: block;
1891
- margin-bottom: 4px;
1892
- font-weight: 500;
1893
- color: #555;
1894
- }
1895
-
1896
- .cv-custom-state-input {
1897
- width: 100%;
1898
- padding: 8px 12px;
1899
- border: 1px solid #ddd;
1900
- border-radius: 4px;
1901
- background: white;
1902
- font-size: 14px;
1903
- }
1904
-
1905
- .cv-custom-state-input:focus {
1906
- outline: none;
1907
- border-color: #007bff;
1908
- box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
1909
- }
1910
-
1911
- /* Toggles Container */
1912
- .cv-toggles-container {
1913
- display: flex;
1914
- flex-direction: column;
1915
- gap: 0.5rem;
1916
- border-radius: 0.5rem;
1917
- border: 1px solid rgba(0, 0, 0, 0.1);
1918
- overflow: hidden;
1919
- }
1920
-
1921
- .cv-toggle-card,
1922
- .cv-tabgroup-card {
1923
- background: white;
1924
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
1925
- }
1926
-
1927
- .cv-toggle-card:last-child {
1928
- border-bottom: none;
1929
- }
1930
-
1931
- .cv-toggle-content {
1932
- display: flex;
1933
- align-items: center;
1934
- justify-content: space-between;
1935
- padding: 0.75rem;
1936
- }
1937
-
1938
- .cv-toggle-title {
1939
- font-weight: 500;
1940
- font-size: 0.875rem;
1941
- color: rgba(0, 0, 0, 0.9);
1942
- margin: 0 0 0.125rem 0;
1943
- }
1944
-
1945
- .cv-toggle-description {
1946
- font-size: 0.75rem;
1947
- color: rgba(0, 0, 0, 0.6);
1948
- margin: 0;
1949
- }
1950
-
1951
- .cv-toggle-label{
1952
- position: relative;
1953
- display: inline-block;
1954
- width: 2.75rem;
1955
- height: 1.5rem;
1956
- cursor: pointer;
1957
- }
1958
-
1959
- .cv-toggle-input {
1960
- opacity: 0;
1961
- width: 0;
1962
- height: 0;
1963
- }
1964
-
1965
- .cv-toggle-slider {
1966
- position: absolute;
1967
- top: 0;
1968
- left: 0;
1969
- right: 0;
1970
- bottom: 0;
1971
- background: rgba(0, 0, 0, 0.2);
1972
- border-radius: 9999px;
1973
- transition: background-color 0.2s ease;
1974
- }
1975
-
1976
- .cv-toggle-slider:before {
1977
- position: absolute;
1978
- content: "";
1979
- height: 1rem;
1980
- width: 1rem;
1981
- left: 0.25rem;
1982
- bottom: 0.25rem;
1983
- background: white;
1984
- border-radius: 50%;
1985
- transition: transform 0.2s ease;
1986
- }
1987
-
1988
- .cv-toggle-input:checked + .cv-toggle-slider {
1989
- background: #3e84f4;
1990
- }
1991
-
1992
- .cv-toggle-input:checked + .cv-toggle-slider:before {
1993
- transform: translateX(1.25rem);
1994
- }
1995
-
1996
- /* Dark theme toggle switch styles */
1997
- .cv-widget-theme-dark .cv-toggle-switch {
1998
- background: #4a5568;
1999
- }
2000
-
2001
- .cv-widget-theme-dark .cv-toggle-switch:hover {
2002
- background: #5a6578;
2003
- }
2004
-
2005
- .cv-widget-theme-dark .cv-toggle-switch.cv-toggle-active {
2006
- background: #63b3ed;
2007
- }
2008
-
2009
- .cv-widget-theme-dark .cv-toggle-switch.cv-toggle-active:hover {
2010
- background: #4299e1;
2011
- }
2012
-
2013
- /* Tab Groups Container */
2014
- .cv-tab-groups-list {
2015
- display: flex;
2016
- flex-direction: column;
2017
- gap: 1px;
2018
- border: 1px solid rgba(0, 0, 0, 0.1);
2019
- border-radius: 0.5rem;
2020
- overflow: hidden;
2021
- }
2022
-
2023
- /* Tab Group Card - Header (Navigation Headers toggle) */
2024
- .cv-tabgroup-card.cv-tabgroup-header {
2025
- display: flex;
2026
- align-items: center;
2027
- justify-content: space-between;
2028
- padding: 0.75rem;
2029
- border-bottom: 0px;
2030
- }
2031
-
2032
- .cv-tabgroup-card.cv-tabgroup-header .cv-tabgroup-row {
2033
- display: flex;
2034
- align-items: center;
2035
- justify-content: space-between;
2036
- width: 100%;
2037
- gap: 1rem;
2038
- }
2039
-
2040
- /* Tab Group Card - Items */
2041
- .cv-tabgroup-card.cv-tabgroup-item {
2042
- display: flex;
2043
- flex-direction: column;
2044
- gap: 0.5rem;
2045
- padding: 0.75rem;
2046
- background: white;
2047
- border-bottom: 1px solid rgba(0, 0, 0, 0.05);
2048
- }
2049
-
2050
- .cv-tabgroup-card.cv-tabgroup-item:last-child {
2051
- border-bottom: none;
2052
- }
2053
-
2054
- /* Tab Group Info */
2055
- .cv-tabgroup-info {
2056
- flex: 1;
2057
- }
2058
-
2059
- .cv-tabgroup-title {
2060
- font-weight: 500;
2061
- font-size: 0.875rem;
2062
- color: rgba(0, 0, 0, 0.9);
2063
- margin: 0 0 0.25rem 0;
2064
- }
2065
-
2066
- .cv-tabgroup-description {
2067
- font-size: 0.75rem;
2068
- color: rgba(0, 0, 0, 0.6);
2069
- margin: 0;
2070
- line-height: 1.3;
2071
- }
2072
-
2073
- /* Tab Group Label (for select dropdowns) */
2074
- .cv-tabgroup-label {
2075
- font-size: 0.875rem;
2076
- color: rgba(0, 0, 0, 0.8);
2077
- margin: 0;
2078
- line-height: 1.4;
2079
- font-weight: 500;
2080
- display: block;
2081
- cursor: pointer;
2082
- }
2083
-
2084
- /* Tab Group Select */
2085
- .cv-tabgroup-select {
2086
- width: 100%;
2087
- border-radius: 0.5rem;
2088
- background: white;
2089
- border: 1px solid rgba(0, 0, 0, 0.15);
2090
- color: rgba(0, 0, 0, 0.9);
2091
- padding: 0.5rem 0.75rem;
2092
- font-size: 0.875rem;
2093
- cursor: pointer;
2094
- transition: all 0.15s ease;
2095
- font-family: inherit;
2096
- }
2097
-
2098
- .cv-tabgroup-select:hover {
2099
- border-color: rgba(0, 0, 0, 0.25);
2100
- }
2101
-
2102
- .cv-tabgroup-select:focus {
2103
- outline: none;
2104
- border-color: #3e84f4;
2105
- box-shadow: 0 0 0 2px rgba(62, 132, 244, 0.2);
2106
- }
2107
-
2108
- /* Modern Toggle Switch */
2109
- .cv-toggle-switch {
2110
- position: relative;
2111
- display: inline-flex;
2112
- align-items: center;
2113
- width: 44px;
2114
- height: 24px;
2115
- background: rgba(0, 0, 0, 0.1);
2116
- border-radius: 9999px;
2117
- padding: 2px;
2118
- box-sizing: border-box;
2119
- cursor: pointer;
2120
- transition: background-color 0.2s ease;
2121
- border: none;
2122
- }
2123
-
2124
- .cv-toggle-switch input {
2125
- display: none;
2126
- }
2127
-
2128
- .cv-toggle-switch .cv-switch-bg {
2129
- position: absolute;
2130
- inset: 0;
2131
- border-radius: 9999px;
2132
- background: rgba(0, 0, 0, 0.1);
2133
- transition: background-color 0.2s ease;
2134
- pointer-events: none;
2135
- }
2136
-
2137
- .cv-toggle-switch .cv-switch-knob {
2138
- position: relative;
2139
- width: 20px;
2140
- height: 20px;
2141
- background: white;
2142
- border-radius: 50%;
2143
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
2144
- transition: transform 0.2s ease;
2145
- z-index: 1;
2146
- }
2147
-
2148
- .cv-toggle-switch input:checked + .cv-switch-bg {
2149
- background: #3e84f4;
2150
- }
2151
-
2152
- .cv-toggle-switch input:checked ~ .cv-switch-knob {
2153
- transform: translateX(20px);
2154
- }
2155
-
2156
- /* Dark Theme - Tab Groups */
2157
- .cv-widget-theme-dark .cv-tabgroup-card.cv-tabgroup-header {
2158
- background: #101722;
2159
- border-bottom-color: rgba(255, 255, 255, 0.1);
2160
- }
2161
-
2162
- .cv-widget-theme-dark .cv-tabgroup-card.cv-tabgroup-item {
2163
- background: #101722;
2164
- border-bottom-color: rgba(255, 255, 255, 0.05);
2165
- }
2166
-
2167
- .cv-widget-theme-dark .cv-tabgroup-title {
2168
- color: #e2e8f0;
2169
- }
2170
-
2171
- .cv-widget-theme-dark .cv-tabgroup-description {
2172
- color: rgba(255, 255, 255, 0.6);
2173
- }
2174
-
2175
- .cv-widget-theme-dark .cv-tabgroup-label {
2176
- color: rgba(255, 255, 255, 0.8);
2177
- }
2178
-
2179
- .cv-widget-theme-dark .cv-tab-groups-list {
2180
- border-color: rgba(255, 255, 255, 0.1);
2181
- }
2182
-
2183
- .cv-widget-theme-dark .cv-tabgroup-select {
2184
- background: #101722;
2185
- border-color: rgba(255, 255, 255, 0.15);
2186
- color: #e2e8f0;
2187
- }
2188
-
2189
- .cv-widget-theme-dark .cv-tabgroup-select:hover {
2190
- border-color: rgba(255, 255, 255, 0.25);
2191
- }
2192
-
2193
- .cv-widget-theme-dark .cv-tabgroup-select:focus {
2194
- border-color: #60a5fa;
2195
- box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
2196
- }
2197
-
2198
- /* Dark Theme - Toggle Switch */
2199
- .cv-widget-theme-dark .cv-toggle-switch .cv-switch-bg {
2200
- background: rgba(255, 255, 255, 0.1);
2201
- }
2202
-
2203
- .cv-widget-theme-dark .cv-toggle-switch .cv-switch-knob {
2204
- background: #e2e8f0;
2205
- }
2206
-
2207
- .cv-widget-theme-dark .cv-toggle-switch input:checked + .cv-switch-bg {
2208
- background: #63b3ed;
2209
- }
2210
-
2211
- .cv-modal-footer {
2212
- display: flex;
2213
- justify-content: space-between;
2214
- align-items: center;
2215
- padding: 0.75rem;
2216
- border-top: 1px solid rgba(0, 0, 0, 0.1);
2217
- }
2218
-
2219
- .cv-reset-btn,
2220
- .cv-share-btn {
2221
- display: flex;
2222
- align-items: center;
2223
- gap: 0.5rem;
2224
- padding: 0.375rem 0.75rem;
2225
- border-radius: 0.5rem;
2226
- font-weight: 600;
2227
- font-size: 0.875rem;
2228
- cursor: pointer;
2229
- transition: all 0.2s ease;
2230
- border: none;
2231
- }
2232
-
2233
- .cv-reset-btn {
2234
- color: rgba(0, 0, 0, 0.9);
2235
- background: rgba(0, 0, 0, 0.1);
2236
- }
2237
-
2238
- .cv-reset-btn:hover {
2239
- background: rgba(0, 0, 0, 0.2);
2240
- }
2241
-
2242
- .cv-share-btn {
2243
- color: white;
2244
- background: #3e84f4;
2245
- }
2246
-
2247
- .cv-share-btn:hover {
2248
- background: rgba(62, 132, 244, 0.9);
2249
- }
2250
-
2251
- .cv-btn-icon {
2252
- width: 1rem;
2253
- height: 1rem;
2254
- }
2255
-
2256
- /* Dark theme custom state styles */
2257
- /* Welcome modal styles */
2258
- .cv-welcome-modal {
2259
- max-width: 32rem;
2260
- width: 90vw;
2261
- background: white;
2262
- border-radius: 0.75rem;
2263
- box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
2264
- animation: slideIn 0.2s ease;
2265
- display: flex;
2266
- flex-direction: column;
2267
- }
2268
-
2269
- .cv-modal-main {
2270
- padding: 1rem;
2271
- flex: 1;
2272
- display: flex;
2273
- flex-direction: column;
2274
- gap: 1rem;
2275
- overflow-y: auto;
2276
- max-height: calc(80vh - 8rem);
2277
- }
2278
-
2279
- .cv-welcome-message {
2280
- font-size: 0.875rem;
2281
- color: rgba(0, 0, 0, 0.8);
2282
- margin: 0;
2283
- line-height: 1.4;
2284
- text-align: center;
2285
- }
2286
-
2287
- .cv-welcome-message a {
2288
- color: #3e84f4;
2289
- text-align: justify;
2290
- text-decoration: none;
2291
- }
2292
-
2293
- .cv-welcome-message a:hover {
2294
- text-decoration: underline;
2295
- }
2296
-
2297
- .cv-welcome-widget-preview {
2298
- display: flex;
2299
- align-items: center;
2300
- justify-content: center;
2301
- gap: 1rem;
2302
- padding: 1rem;
2303
- background: #f8f9fa;
2304
- border-radius: 0.5rem;
2305
- margin: 1rem 0;
2306
- }
2307
-
2308
- .cv-welcome-widget-icon {
2309
- width: 2rem;
2310
- height: 2rem;
2311
- background: rgba(62, 132, 244, 0.1);
2312
- border-radius: 9999px;
2313
- display: flex;
2314
- align-items: center;
2315
- justify-content: center;
2316
- animation: cv-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
2317
- color: #3e84f4;
2318
- }
2319
-
2320
- .cv-welcome-widget-label {
2321
- font-size: 0.875rem;
2322
- font-weight: 500;
2323
- color: rgba(0, 0, 0, 0.8);
2324
- margin: 0;
2325
- }
2326
-
2327
- .cv-welcome-got-it {
2328
- width: 100%;
2329
- background: #3e84f4;
2330
- color: white;
2331
- font-weight: 600;
2332
- padding: 0.75rem 1rem;
2333
- border-radius: 0.5rem;
2334
- border: none;
2335
- cursor: pointer;
2336
- font-size: 0.875rem;
2337
- transition: background-color 0.2s ease;
2338
- outline: none;
2339
- }
2340
-
2341
- .cv-welcome-got-it:hover {
2342
- background: rgba(62, 132, 244, 0.9);
2343
- }
2344
-
2345
- .cv-welcome-got-it:focus {
2346
- box-shadow: 0 0 0 2px rgba(62, 132, 244, 0.5);
2347
- }
2348
-
2349
- /* Animations */
2350
- @keyframes cv-pulse {
2351
- 0%, 100% {
2352
- opacity: 1;
2353
- }
2354
- 50% {
2355
- opacity: 0.5;
2356
- }
2357
- }
2358
-
2359
- /* Dark theme welcome modal styles */
2360
- .cv-widget-theme-dark .cv-welcome-modal {
2361
- background: #101722;
2362
- }
2363
-
2364
- .cv-widget-theme-dark .cv-welcome-message {
2365
- color: rgba(255, 255, 255, 0.8);
2366
- }
2367
-
2368
- .cv-widget-theme-dark .cv-welcome-message a {
2369
- color: #60a5fa;
2370
- }
2371
-
2372
- .cv-widget-theme-dark .cv-welcome-widget-preview {
2373
- background: rgba(255, 255, 255, 0.1);
2374
- }
2375
-
2376
- .cv-widget-theme-dark .cv-welcome-widget-label {
2377
- color: #e2e8f0;
2378
- }
2379
- `;
2380
- /**
2381
- * Inject widget styles into the document head
2382
- */
2383
- function injectWidgetStyles() {
2384
- // Check if styles are already injected
2385
- if (document.querySelector('#cv-widget-styles'))
2386
- return;
2387
- const style = document.createElement('style');
2388
- style.id = 'cv-widget-styles';
2389
- style.textContent = WIDGET_STYLES;
2390
- document.head.appendChild(style);
1424
+ const WIDGET_STYLES = `
1425
+ /* Rounded rectangle widget icon styles */
1426
+ .cv-widget-icon {
1427
+ position: fixed;
1428
+ /* Slightly transparent by default so the widget is subtle at the page edge */
1429
+ background: rgba(255, 255, 255, 0.92);
1430
+ color: rgba(0, 0, 0, 0.9);
1431
+ opacity: 0.6;
1432
+ display: flex;
1433
+ align-items: center;
1434
+ justify-content: center;
1435
+ font-size: 18px;
1436
+ font-weight: bold;
1437
+ cursor: pointer;
1438
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
1439
+ z-index: 9998;
1440
+ transition: all 0.3s ease;
1441
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
2391
1442
  }
2392
1443
 
2393
- /**
2394
- * Icon utilities for CustomViews widget
2395
- * Centralized SVG icons for better maintainability and reusability
2396
- */
1444
+ .cv-widget-icon:hover {
1445
+ /* Become fully opaque on hover to improve readability */
1446
+ background: rgba(255, 255, 255, 1);
1447
+ color: rgba(0, 0, 0, 1);
1448
+ opacity: 1;
1449
+ }
1450
+
1451
+ /* Top-right: rounded end on left, sticks out leftward on hover */
1452
+ .cv-widget-top-right {
1453
+ top: 20px;
1454
+ right: 0;
1455
+ border-radius: 18px 0 0 18px;
1456
+ padding-left: 8px;
1457
+ justify-content: flex-start;
1458
+ }
1459
+
1460
+ /* Top-left: rounded end on right, sticks out rightward on hover */
1461
+ .cv-widget-top-left {
1462
+ top: 20px;
1463
+ left: 0;
1464
+ border-radius: 0 18px 18px 0;
1465
+ padding-right: 8px;
1466
+ justify-content: flex-end;
1467
+ }
1468
+
1469
+ /* Bottom-right: rounded end on left, sticks out leftward on hover */
1470
+ .cv-widget-bottom-right {
1471
+ bottom: 20px;
1472
+ right: 0;
1473
+ border-radius: 18px 0 0 18px;
1474
+ padding-left: 8px;
1475
+ justify-content: flex-start;
1476
+ }
1477
+
1478
+ /* Bottom-left: rounded end on right, sticks out rightward on hover */
1479
+ .cv-widget-bottom-left {
1480
+ bottom: 20px;
1481
+ left: 0;
1482
+ border-radius: 0 18px 18px 0;
1483
+ padding-right: 8px;
1484
+ justify-content: flex-end;
1485
+ }
1486
+
1487
+ /* Middle-left: rounded end on right, sticks out rightward on hover */
1488
+ .cv-widget-middle-left {
1489
+ top: 50%;
1490
+ left: 0;
1491
+ transform: translateY(-50%);
1492
+ border-radius: 0 18px 18px 0;
1493
+ padding-right: 8px;
1494
+ justify-content: flex-end;
1495
+ }
1496
+
1497
+ /* Middle-right: rounded end on left, sticks out leftward on hover */
1498
+ .cv-widget-middle-right {
1499
+ top: 50%;
1500
+ right: 0;
1501
+ transform: translateY(-50%);
1502
+ border-radius: 18px 0 0 18px;
1503
+ padding-left: 8px;
1504
+ justify-content: flex-start;
1505
+ }
1506
+
1507
+ .cv-widget-top-right,
1508
+ .cv-widget-middle-right,
1509
+ .cv-widget-bottom-right,
1510
+ .cv-widget-top-left,
1511
+ .cv-widget-middle-left,
1512
+ .cv-widget-bottom-left {
1513
+ height: 36px;
1514
+ width: 36px;
1515
+ }
1516
+
1517
+ .cv-widget-middle-right:hover,
1518
+ .cv-widget-top-right:hover,
1519
+ .cv-widget-bottom-right:hover,
1520
+ .cv-widget-top-left:hover,
1521
+ .cv-widget-middle-left:hover,
1522
+ .cv-widget-bottom-left:hover {
1523
+ width: 55px;
1524
+ }
1525
+
1526
+ /* Modal content styles */
1527
+ .cv-widget-section {
1528
+ margin-bottom: 16px;
1529
+ }
1530
+
1531
+ .cv-widget-section:last-child {
1532
+ margin-bottom: 0;
1533
+ }
1534
+
1535
+ .cv-widget-section label {
1536
+ display: block;
1537
+ margin-bottom: 4px;
1538
+ font-weight: 500;
1539
+ color: #555;
1540
+ }
1541
+
1542
+ .cv-widget-profile-select,
1543
+ .cv-widget-state-select {
1544
+ width: 100%;
1545
+ padding: 8px 12px;
1546
+ border: 1px solid #ddd;
1547
+ border-radius: 4px;
1548
+ background: white;
1549
+ font-size: 14px;
1550
+ }
1551
+
1552
+ .cv-widget-profile-select:focus,
1553
+ .cv-widget-state-select:focus {
1554
+ outline: none;
1555
+ border-color: #007bff;
1556
+ box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
1557
+ }
1558
+
1559
+ .cv-widget-profile-select:disabled,
1560
+ .cv-widget-state-select:disabled {
1561
+ background: #f8f9fa;
1562
+ color: #6c757d;
1563
+ cursor: not-allowed;
1564
+ }
1565
+
1566
+ .cv-widget-current {
1567
+ margin: 16px 0;
1568
+ padding: 12px;
1569
+ background: #f8f9fa;
1570
+ border-radius: 4px;
1571
+ border-left: 4px solid #007bff;
1572
+ }
1573
+
1574
+ .cv-widget-current label {
1575
+ font-size: 12px;
1576
+ text-transform: uppercase;
1577
+ letter-spacing: 0.5px;
1578
+ color: #666;
1579
+ margin-bottom: 4px;
1580
+ }
1581
+
1582
+ .cv-widget-current-view {
1583
+ font-weight: 500;
1584
+ color: #333;
1585
+ }
1586
+
1587
+ .cv-widget-reset {
1588
+ width: 100%;
1589
+ padding: 8px 16px;
1590
+ background: #dc3545;
1591
+ color: white;
1592
+ border: none;
1593
+ border-radius: 4px;
1594
+ cursor: pointer;
1595
+ font-size: 14px;
1596
+ font-weight: 500;
1597
+ }
1598
+
1599
+ .cv-widget-reset:hover {
1600
+ background: #c82333;
1601
+ }
1602
+
1603
+ .cv-widget-reset:active {
1604
+ background: #bd2130;
1605
+ }
1606
+
1607
+ /* Responsive design for mobile */
1608
+ @media (max-width: 768px) {
1609
+ .cv-widget-top-right,
1610
+ .cv-widget-top-left {
1611
+ top: 10px;
1612
+ }
1613
+
1614
+ .cv-widget-bottom-right,
1615
+ .cv-widget-bottom-left {
1616
+ bottom: 10px;
1617
+ }
1618
+
1619
+ /* All widgets stay flush with screen edges */
1620
+ .cv-widget-top-right,
1621
+ .cv-widget-bottom-right,
1622
+ .cv-widget-middle-right {
1623
+ right: 0;
1624
+ }
1625
+
1626
+ .cv-widget-top-left,
1627
+ .cv-widget-bottom-left,
1628
+ .cv-widget-middle-left {
1629
+ left: 0;
1630
+ }
1631
+
1632
+ /* Slightly smaller on mobile */
1633
+ .cv-widget-icon {
1634
+ width: 60px;
1635
+ height: 32px;
1636
+ }
1637
+
1638
+ .cv-widget-icon:hover {
1639
+ width: 75px;
1640
+ }
1641
+ }
1642
+
1643
+ /* Modal styles */
1644
+ .cv-widget-modal-overlay {
1645
+ position: fixed;
1646
+ top: 0;
1647
+ left: 0;
1648
+ right: 0;
1649
+ bottom: 0;
1650
+ background: rgba(0, 0, 0, 0.5);
1651
+ display: flex;
1652
+ align-items: center;
1653
+ justify-content: center;
1654
+ z-index: 10002;
1655
+ animation: fadeIn 0.2s ease;
1656
+ }
1657
+
1658
+ @keyframes fadeIn {
1659
+ from { opacity: 0; }
1660
+ to { opacity: 1; }
1661
+ }
1662
+
1663
+ .cv-widget-modal {
1664
+ background: white;
1665
+ border-radius: 0.75rem;
1666
+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
1667
+ max-width: 32rem;
1668
+ width: 90vw;
1669
+ max-height: 80vh;
1670
+ animation: slideIn 0.2s ease;
1671
+ display: flex;
1672
+ flex-direction: column;
1673
+ }
1674
+
1675
+ @keyframes slideIn {
1676
+ from {
1677
+ opacity: 0;
1678
+ transform: scale(0.9) translateY(-20px);
1679
+ }
1680
+ to {
1681
+ opacity: 1;
1682
+ transform: scale(1) translateY(0);
1683
+ }
1684
+ }
1685
+
1686
+ .cv-modal-header {
1687
+ display: flex;
1688
+ align-items: center;
1689
+ justify-content: space-between;
1690
+ padding: 0.5rem 1rem;
1691
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
1692
+ }
1693
+
1694
+ .cv-modal-header-content {
1695
+ display: flex;
1696
+ align-items: center;
1697
+ gap: 0.75rem;
1698
+ }
1699
+
1700
+ .cv-modal-icon {
1701
+ position: relative;
1702
+ width: 1rem;
1703
+ height: 1rem;
1704
+ display: flex;
1705
+ align-items: center;
1706
+ justify-content: center;
1707
+ border-radius: 9999px;
1708
+ }
1709
+
1710
+ .cv-modal-icon-svg {
1711
+ width: 100%;
1712
+ height: 100%;
1713
+ opacity: 1;
1714
+ }
1715
+
1716
+ .cv-modal-title {
1717
+ font-size: 1.125rem;
1718
+ font-weight: bold;
1719
+ color: rgba(0, 0, 0, 0.9);
1720
+ margin: 0;
1721
+ }
1722
+
1723
+ .cv-modal-close {
1724
+ width: 2rem;
1725
+ height: 2rem;
1726
+ display: flex;
1727
+ align-items: center;
1728
+ justify-content: center;
1729
+ border-radius: 9999px;
1730
+ background: transparent;
1731
+ border: none;
1732
+ color: rgba(0, 0, 0, 0.6);
1733
+ cursor: pointer;
1734
+ transition: all 0.2s ease;
1735
+ }
1736
+
1737
+ .cv-modal-close:hover {
1738
+ background: rgba(62, 132, 244, 0.1);
1739
+ color: #3e84f4;
1740
+ }
1741
+
1742
+ .cv-modal-close-icon {
1743
+ width: 1.25rem;
1744
+ height: 1.25rem;
1745
+ }
1746
+
1747
+ .cv-modal-main {
1748
+ padding: 1rem;
1749
+ flex: 1;
1750
+ display: flex;
1751
+ flex-direction: column;
1752
+ gap: 1rem;
1753
+ overflow-y: auto;
1754
+ max-height: calc(80vh - 8rem);
1755
+ }
1756
+
1757
+ .cv-modal-description {
1758
+ font-size: 0.875rem;
1759
+ color: rgba(0, 0, 0, 0.8);
1760
+ margin: 0;
1761
+ line-height: 1.4;
1762
+ }
1763
+
1764
+ .cv-content-section,
1765
+ .cv-tab-groups-section {
1766
+ display: flex;
1767
+ flex-direction: column;
1768
+ gap: 0.75rem;
1769
+ }
1770
+
1771
+ .cv-section-heading {
1772
+ font-size: 1rem;
1773
+ font-weight: bold;
1774
+ color: rgba(0, 0, 0, 0.9);
1775
+ margin: 0;
1776
+ }
1777
+
1778
+ .cv-widget-modal-actions {
1779
+ margin-top: 20px;
1780
+ padding-top: 16px;
1781
+ border-top: 1px solid #e9ecef;
1782
+ }
1783
+
1784
+ .cv-widget-restore {
1785
+ width: 100%;
1786
+ padding: 10px 16px;
1787
+ background: #28a745;
1788
+ color: white;
1789
+ border: none;
1790
+ border-radius: 4px;
1791
+ cursor: pointer;
1792
+ font-size: 14px;
1793
+ font-weight: 500;
1794
+ }
1795
+
1796
+ .cv-widget-restore:hover {
1797
+ background: #218838;
1798
+ }
1799
+
1800
+ .cv-widget-create-state {
1801
+ width: 100%;
1802
+ padding: 10px 16px;
1803
+ background: #007bff;
1804
+ color: white;
1805
+ border: none;
1806
+ border-radius: 4px;
1807
+ cursor: pointer;
1808
+ font-size: 14px;
1809
+ font-weight: 500;
1810
+ margin-bottom: 10px;
1811
+ }
1812
+
1813
+ .cv-widget-create-state:hover {
1814
+ background: #0056b3;
1815
+ }
1816
+
1817
+ .cv-widget-theme-dark .cv-widget-modal {
1818
+ background: #101722;
1819
+ color: #e2e8f0;
1820
+ }
1821
+
1822
+ .cv-widget-theme-dark .cv-modal-header {
1823
+ border-color: rgba(255, 255, 255, 0.1);
1824
+ }
1825
+
1826
+ .cv-widget-theme-dark .cv-modal-title {
1827
+ color: #e2e8f0;
1828
+ }
1829
+
1830
+ .cv-widget-theme-dark .cv-modal-close {
1831
+ color: rgba(255, 255, 255, 0.6);
1832
+ }
1833
+
1834
+ .cv-widget-theme-dark .cv-modal-close:hover {
1835
+ background: rgba(62, 132, 244, 0.2);
1836
+ color: #3e84f4;
1837
+ }
1838
+
1839
+ .cv-widget-theme-dark .cv-modal-description {
1840
+ color: rgba(255, 255, 255, 0.8);
1841
+ }
1842
+
1843
+ .cv-widget-theme-dark .cv-section-heading {
1844
+ color: #e2e8f0;
1845
+ }
1846
+
1847
+ .cv-widget-theme-dark .cv-toggles-container
1848
+ .cv-widget-theme-dark .cv-tabgroups-container {
1849
+ border-color: rgba(255, 255, 255, 0.1);
1850
+ }
1851
+
1852
+ .cv-widget-theme-dark .cv-toggle-card,
1853
+ .cv-widget-theme-dark .cv-tabgroup-card {
1854
+ background: #101722;
1855
+ border-color: rgba(255, 255, 255, 0.1);
1856
+ }
1857
+
1858
+ .cv-widget-theme-dark .cv-toggle-title,
1859
+ .cv-widget-theme-dark .cv-tabgroup-title {
1860
+ color: #e2e8f0;
1861
+ }
1862
+
1863
+ .cv-widget-theme-dark .cv-toggle-description,
1864
+ .cv-widget-theme-dark .cv-tabgroup-description {
1865
+ color: rgba(255, 255, 255, 0.6);
1866
+ }
1867
+
1868
+ .cv-widget-theme-dark .cv-toggle-slider {
1869
+ background: rgba(255, 255, 255, 0.2);
1870
+ }
1871
+
1872
+ .cv-widget-theme-dark .cv-tab-group-description {
1873
+ color: rgba(255, 255, 255, 0.8);
1874
+ }
1875
+
1876
+ .cv-widget-theme-dark .cv-tabgroup-select {
1877
+ background: #101722;
1878
+ border-color: rgba(255, 255, 255, 0.2);
1879
+ color: #e2e8f0;
1880
+ }
1881
+
1882
+ .cv-widget-theme-dark .cv-modal-footer {
1883
+ border-color: rgba(255, 255, 255, 0.1);
1884
+ background: #101722;
1885
+ }
1886
+
1887
+ .cv-widget-theme-dark .cv-reset-btn {
1888
+ color: #e2e8f0;
1889
+ background: rgba(255, 255, 255, 0.1);
1890
+ }
1891
+
1892
+ .cv-widget-theme-dark .cv-reset-btn:hover {
1893
+ background: rgba(255, 255, 255, 0.2);
1894
+ }
1895
+
1896
+ /* Custom state creator styles */
1897
+ .cv-custom-state-modal {
1898
+ max-width: 500px;
1899
+ }
1900
+
1901
+ .cv-custom-state-form .cv-section-header {
1902
+ font-size: 16px;
1903
+ font-weight: 600;
1904
+ color: #333;
1905
+ border-bottom: 1px solid #e9ecef;
1906
+ padding-bottom: 5px;
1907
+ }
1908
+
1909
+ .cv-custom-state-form p {
1910
+ font-size: 15px;
1911
+ line-height: 1.6;
1912
+ color: #555;
1913
+ margin-bottom: 24px;
1914
+ text-align: justify;
1915
+ }
1916
+
1917
+ .cv-custom-state-section {
1918
+ margin-bottom: 16px;
1919
+ }
1920
+
1921
+ .cv-custom-state-section label {
1922
+ display: block;
1923
+ margin-bottom: 4px;
1924
+ font-weight: 500;
1925
+ color: #555;
1926
+ }
1927
+
1928
+ .cv-custom-state-input {
1929
+ width: 100%;
1930
+ padding: 8px 12px;
1931
+ border: 1px solid #ddd;
1932
+ border-radius: 4px;
1933
+ background: white;
1934
+ font-size: 14px;
1935
+ }
1936
+
1937
+ .cv-custom-state-input:focus {
1938
+ outline: none;
1939
+ border-color: #007bff;
1940
+ box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
1941
+ }
1942
+
1943
+ /* Toggles Container */
1944
+ .cv-toggles-container {
1945
+ display: flex;
1946
+ flex-direction: column;
1947
+ gap: 0.5rem;
1948
+ border-radius: 0.5rem;
1949
+ border: 1px solid rgba(0, 0, 0, 0.1);
1950
+ overflow: hidden;
1951
+ }
1952
+
1953
+ .cv-toggle-card,
1954
+ .cv-tabgroup-card {
1955
+ background: white;
1956
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
1957
+ }
1958
+
1959
+ .cv-toggle-card:last-child {
1960
+ border-bottom: none;
1961
+ }
1962
+
1963
+ .cv-toggle-content {
1964
+ display: flex;
1965
+ align-items: center;
1966
+ justify-content: space-between;
1967
+ padding: 0.75rem;
1968
+ }
1969
+
1970
+ .cv-toggle-title {
1971
+ font-weight: 500;
1972
+ font-size: 0.875rem;
1973
+ color: rgba(0, 0, 0, 0.9);
1974
+ margin: 0 0 0.125rem 0;
1975
+ }
1976
+
1977
+ .cv-toggle-description {
1978
+ font-size: 0.75rem;
1979
+ color: rgba(0, 0, 0, 0.6);
1980
+ margin: 0;
1981
+ }
1982
+
1983
+ .cv-toggle-label{
1984
+ position: relative;
1985
+ display: inline-block;
1986
+ width: 2.75rem;
1987
+ height: 1.5rem;
1988
+ cursor: pointer;
1989
+ }
1990
+
1991
+ .cv-toggle-input {
1992
+ opacity: 0;
1993
+ width: 0;
1994
+ height: 0;
1995
+ }
1996
+
1997
+ .cv-toggle-slider {
1998
+ position: absolute;
1999
+ top: 0;
2000
+ left: 0;
2001
+ right: 0;
2002
+ bottom: 0;
2003
+ background: rgba(0, 0, 0, 0.2);
2004
+ border-radius: 9999px;
2005
+ transition: background-color 0.2s ease;
2006
+ }
2007
+
2008
+ .cv-toggle-slider:before {
2009
+ position: absolute;
2010
+ content: "";
2011
+ height: 1rem;
2012
+ width: 1rem;
2013
+ left: 0.25rem;
2014
+ bottom: 0.25rem;
2015
+ background: white;
2016
+ border-radius: 50%;
2017
+ transition: transform 0.2s ease;
2018
+ }
2019
+
2020
+ .cv-toggle-input:checked + .cv-toggle-slider {
2021
+ background: #3e84f4;
2022
+ }
2023
+
2024
+ .cv-toggle-input:checked + .cv-toggle-slider:before {
2025
+ transform: translateX(1.25rem);
2026
+ }
2027
+
2028
+ /* Dark theme toggle switch styles */
2029
+ .cv-widget-theme-dark .cv-toggle-switch {
2030
+ background: #4a5568;
2031
+ }
2032
+
2033
+ .cv-widget-theme-dark .cv-toggle-switch:hover {
2034
+ background: #5a6578;
2035
+ }
2036
+
2037
+ .cv-widget-theme-dark .cv-toggle-switch.cv-toggle-active {
2038
+ background: #63b3ed;
2039
+ }
2040
+
2041
+ .cv-widget-theme-dark .cv-toggle-switch.cv-toggle-active:hover {
2042
+ background: #4299e1;
2043
+ }
2044
+
2045
+ /* Tab Groups Container */
2046
+ .cv-tab-groups-list {
2047
+ display: flex;
2048
+ flex-direction: column;
2049
+ gap: 1px;
2050
+ border: 1px solid rgba(0, 0, 0, 0.1);
2051
+ border-radius: 0.5rem;
2052
+ overflow: hidden;
2053
+ }
2054
+
2055
+ /* Tab Group Card - Header (Navigation Headers toggle) */
2056
+ .cv-tabgroup-card.cv-tabgroup-header {
2057
+ display: flex;
2058
+ align-items: center;
2059
+ justify-content: space-between;
2060
+ padding: 0.75rem;
2061
+ border-bottom: 0px;
2062
+ }
2063
+
2064
+ .cv-tabgroup-card.cv-tabgroup-header .cv-tabgroup-row {
2065
+ display: flex;
2066
+ align-items: center;
2067
+ justify-content: space-between;
2068
+ width: 100%;
2069
+ gap: 1rem;
2070
+ }
2071
+
2072
+ /* Tab Group Card - Items */
2073
+ .cv-tabgroup-card.cv-tabgroup-item {
2074
+ display: flex;
2075
+ flex-direction: column;
2076
+ gap: 0.5rem;
2077
+ padding: 0.75rem;
2078
+ background: white;
2079
+ border-bottom: 1px solid rgba(0, 0, 0, 0.05);
2080
+ }
2081
+
2082
+ .cv-tabgroup-card.cv-tabgroup-item:last-child {
2083
+ border-bottom: none;
2084
+ }
2085
+
2086
+ /* Tab Group Info */
2087
+ .cv-tabgroup-info {
2088
+ flex: 1;
2089
+ }
2090
+
2091
+ .cv-tabgroup-title {
2092
+ font-weight: 500;
2093
+ font-size: 0.875rem;
2094
+ color: rgba(0, 0, 0, 0.9);
2095
+ margin: 0 0 0.25rem 0;
2096
+ }
2097
+
2098
+ .cv-tabgroup-description {
2099
+ font-size: 0.75rem;
2100
+ color: rgba(0, 0, 0, 0.6);
2101
+ margin: 0;
2102
+ line-height: 1.3;
2103
+ }
2104
+
2105
+ /* Tab Group Label (for select dropdowns) */
2106
+ .cv-tabgroup-label {
2107
+ font-size: 0.875rem;
2108
+ color: rgba(0, 0, 0, 0.8);
2109
+ margin: 0;
2110
+ line-height: 1.4;
2111
+ font-weight: 500;
2112
+ display: block;
2113
+ cursor: pointer;
2114
+ }
2115
+
2116
+ /* Tab Group Select */
2117
+ .cv-tabgroup-select {
2118
+ width: 100%;
2119
+ border-radius: 0.5rem;
2120
+ background: white;
2121
+ border: 1px solid rgba(0, 0, 0, 0.15);
2122
+ color: rgba(0, 0, 0, 0.9);
2123
+ padding: 0.5rem 0.75rem;
2124
+ font-size: 0.875rem;
2125
+ cursor: pointer;
2126
+ transition: all 0.15s ease;
2127
+ font-family: inherit;
2128
+ }
2129
+
2130
+ .cv-tabgroup-select:hover {
2131
+ border-color: rgba(0, 0, 0, 0.25);
2132
+ }
2133
+
2134
+ .cv-tabgroup-select:focus {
2135
+ outline: none;
2136
+ border-color: #3e84f4;
2137
+ box-shadow: 0 0 0 2px rgba(62, 132, 244, 0.2);
2138
+ }
2139
+
2140
+ /* Modern Toggle Switch */
2141
+ .cv-toggle-switch {
2142
+ position: relative;
2143
+ display: inline-flex;
2144
+ align-items: center;
2145
+ width: 44px;
2146
+ height: 24px;
2147
+ background: rgba(0, 0, 0, 0.1);
2148
+ border-radius: 9999px;
2149
+ padding: 2px;
2150
+ box-sizing: border-box;
2151
+ cursor: pointer;
2152
+ transition: background-color 0.2s ease;
2153
+ border: none;
2154
+ }
2155
+
2156
+ .cv-toggle-switch input {
2157
+ display: none;
2158
+ }
2159
+
2160
+ .cv-toggle-switch .cv-switch-bg {
2161
+ position: absolute;
2162
+ inset: 0;
2163
+ border-radius: 9999px;
2164
+ background: rgba(0, 0, 0, 0.1);
2165
+ transition: background-color 0.2s ease;
2166
+ pointer-events: none;
2167
+ }
2168
+
2169
+ .cv-toggle-switch .cv-switch-knob {
2170
+ position: relative;
2171
+ width: 20px;
2172
+ height: 20px;
2173
+ background: white;
2174
+ border-radius: 50%;
2175
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
2176
+ transition: transform 0.2s ease;
2177
+ z-index: 1;
2178
+ }
2179
+
2180
+ .cv-toggle-switch input:checked + .cv-switch-bg {
2181
+ background: #3e84f4;
2182
+ }
2183
+
2184
+ .cv-toggle-switch input:checked ~ .cv-switch-knob {
2185
+ transform: translateX(20px);
2186
+ }
2187
+
2188
+ /* Dark Theme - Tab Groups */
2189
+ .cv-widget-theme-dark .cv-tabgroup-card.cv-tabgroup-header {
2190
+ background: #101722;
2191
+ border-bottom-color: rgba(255, 255, 255, 0.1);
2192
+ }
2193
+
2194
+ .cv-widget-theme-dark .cv-tabgroup-card.cv-tabgroup-item {
2195
+ background: #101722;
2196
+ border-bottom-color: rgba(255, 255, 255, 0.05);
2197
+ }
2198
+
2199
+ .cv-widget-theme-dark .cv-tabgroup-title {
2200
+ color: #e2e8f0;
2201
+ }
2202
+
2203
+ .cv-widget-theme-dark .cv-tabgroup-description {
2204
+ color: rgba(255, 255, 255, 0.6);
2205
+ }
2206
+
2207
+ .cv-widget-theme-dark .cv-tabgroup-label {
2208
+ color: rgba(255, 255, 255, 0.8);
2209
+ }
2210
+
2211
+ .cv-widget-theme-dark .cv-tab-groups-list {
2212
+ border-color: rgba(255, 255, 255, 0.1);
2213
+ }
2214
+
2215
+ .cv-widget-theme-dark .cv-tabgroup-select {
2216
+ background: #101722;
2217
+ border-color: rgba(255, 255, 255, 0.15);
2218
+ color: #e2e8f0;
2219
+ }
2220
+
2221
+ .cv-widget-theme-dark .cv-tabgroup-select:hover {
2222
+ border-color: rgba(255, 255, 255, 0.25);
2223
+ }
2224
+
2225
+ .cv-widget-theme-dark .cv-tabgroup-select:focus {
2226
+ border-color: #60a5fa;
2227
+ box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
2228
+ }
2229
+
2230
+ /* Dark Theme - Toggle Switch */
2231
+ .cv-widget-theme-dark .cv-toggle-switch .cv-switch-bg {
2232
+ background: rgba(255, 255, 255, 0.1);
2233
+ }
2234
+
2235
+ .cv-widget-theme-dark .cv-toggle-switch .cv-switch-knob {
2236
+ background: #e2e8f0;
2237
+ }
2238
+
2239
+ .cv-widget-theme-dark .cv-toggle-switch input:checked + .cv-switch-bg {
2240
+ background: #63b3ed;
2241
+ }
2242
+
2243
+ .cv-modal-footer {
2244
+ display: flex;
2245
+ justify-content: space-between;
2246
+ align-items: center;
2247
+ padding: 0.75rem;
2248
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
2249
+ }
2250
+
2251
+ .cv-reset-btn,
2252
+ .cv-share-btn {
2253
+ display: flex;
2254
+ align-items: center;
2255
+ gap: 0.5rem;
2256
+ padding: 0.375rem 0.75rem;
2257
+ border-radius: 0.5rem;
2258
+ font-weight: 600;
2259
+ font-size: 0.875rem;
2260
+ cursor: pointer;
2261
+ transition: all 0.2s ease;
2262
+ border: none;
2263
+ }
2264
+
2265
+ .cv-reset-btn {
2266
+ color: rgba(0, 0, 0, 0.9);
2267
+ background: rgba(0, 0, 0, 0.1);
2268
+ }
2269
+
2270
+ .cv-reset-btn:hover {
2271
+ background: rgba(0, 0, 0, 0.2);
2272
+ }
2273
+
2274
+ .cv-share-btn {
2275
+ color: white;
2276
+ background: #3e84f4;
2277
+ }
2278
+
2279
+ .cv-share-btn:hover {
2280
+ background: rgba(62, 132, 244, 0.9);
2281
+ }
2282
+
2283
+ .cv-btn-icon {
2284
+ width: 1rem;
2285
+ height: 1rem;
2286
+ }
2287
+
2288
+ /* Dark theme custom state styles */
2289
+ /* Welcome modal styles */
2290
+ .cv-welcome-modal {
2291
+ max-width: 32rem;
2292
+ width: 90vw;
2293
+ background: white;
2294
+ border-radius: 0.75rem;
2295
+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
2296
+ animation: slideIn 0.2s ease;
2297
+ display: flex;
2298
+ flex-direction: column;
2299
+ }
2300
+
2301
+ .cv-modal-main {
2302
+ padding: 1rem;
2303
+ flex: 1;
2304
+ display: flex;
2305
+ flex-direction: column;
2306
+ gap: 1rem;
2307
+ overflow-y: auto;
2308
+ max-height: calc(80vh - 8rem);
2309
+ }
2310
+
2311
+ .cv-welcome-message {
2312
+ font-size: 0.875rem;
2313
+ color: rgba(0, 0, 0, 0.8);
2314
+ margin: 0;
2315
+ line-height: 1.4;
2316
+ text-align: center;
2317
+ }
2318
+
2319
+ .cv-welcome-message a {
2320
+ color: #3e84f4;
2321
+ text-align: justify;
2322
+ text-decoration: none;
2323
+ }
2324
+
2325
+ .cv-welcome-message a:hover {
2326
+ text-decoration: underline;
2327
+ }
2328
+
2329
+ .cv-welcome-widget-preview {
2330
+ display: flex;
2331
+ align-items: center;
2332
+ justify-content: center;
2333
+ gap: 1rem;
2334
+ padding: 1rem;
2335
+ background: #f8f9fa;
2336
+ border-radius: 0.5rem;
2337
+ margin: 1rem 0;
2338
+ }
2339
+
2340
+ .cv-welcome-widget-icon {
2341
+ width: 2rem;
2342
+ height: 2rem;
2343
+ background: rgba(62, 132, 244, 0.1);
2344
+ border-radius: 9999px;
2345
+ display: flex;
2346
+ align-items: center;
2347
+ justify-content: center;
2348
+ animation: cv-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
2349
+ color: #3e84f4;
2350
+ }
2351
+
2352
+ .cv-welcome-widget-label {
2353
+ font-size: 0.875rem;
2354
+ font-weight: 500;
2355
+ color: rgba(0, 0, 0, 0.8);
2356
+ margin: 0;
2357
+ }
2358
+
2359
+ .cv-welcome-got-it {
2360
+ width: 100%;
2361
+ background: #3e84f4;
2362
+ color: white;
2363
+ font-weight: 600;
2364
+ padding: 0.75rem 1rem;
2365
+ border-radius: 0.5rem;
2366
+ border: none;
2367
+ cursor: pointer;
2368
+ font-size: 0.875rem;
2369
+ transition: background-color 0.2s ease;
2370
+ outline: none;
2371
+ }
2372
+
2373
+ .cv-welcome-got-it:hover {
2374
+ background: rgba(62, 132, 244, 0.9);
2375
+ }
2376
+
2377
+ .cv-welcome-got-it:focus {
2378
+ box-shadow: 0 0 0 2px rgba(62, 132, 244, 0.5);
2379
+ }
2380
+
2381
+ /* Animations */
2382
+ @keyframes cv-pulse {
2383
+ 0%, 100% {
2384
+ opacity: 1;
2385
+ }
2386
+ 50% {
2387
+ opacity: 0.5;
2388
+ }
2389
+ }
2390
+
2391
+ /* Dark theme welcome modal styles */
2392
+ .cv-widget-theme-dark .cv-welcome-modal {
2393
+ background: #101722;
2394
+ }
2395
+
2396
+ .cv-widget-theme-dark .cv-welcome-message {
2397
+ color: rgba(255, 255, 255, 0.8);
2398
+ }
2399
+
2400
+ .cv-widget-theme-dark .cv-welcome-message a {
2401
+ color: #60a5fa;
2402
+ }
2403
+
2404
+ .cv-widget-theme-dark .cv-welcome-widget-preview {
2405
+ background: rgba(255, 255, 255, 0.1);
2406
+ }
2407
+
2408
+ .cv-widget-theme-dark .cv-welcome-widget-label {
2409
+ color: #e2e8f0;
2410
+ }
2411
+ `;
2412
+ /**
2413
+ * Inject widget styles into the document head
2414
+ */
2415
+ function injectWidgetStyles() {
2416
+ // Check if styles are already injected
2417
+ if (document.querySelector('#cv-widget-styles'))
2418
+ return;
2419
+ const style = document.createElement('style');
2420
+ style.id = 'cv-widget-styles';
2421
+ style.textContent = WIDGET_STYLES;
2422
+ document.head.appendChild(style);
2423
+ }
2424
+
2425
+ /**
2426
+ * Icon utilities for CustomViews widget
2427
+ * Centralized SVG icons for better maintainability and reusability
2428
+ */
2397
2429
  /**
2398
2430
  * Settings gear icon for modal header
2399
2431
  */
2400
2432
  function getGearIcon() {
2401
- return `<svg class="cv-modal-icon-svg" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2402
- <path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M12 8.00002C9.79085 8.00002 7.99999 9.79088 7.99999 12C7.99999 14.2092 9.79085 16 12 16C14.2091 16 16 14.2092 16 12C16 9.79088 14.2091 8.00002 12 8.00002ZM9.99999 12C9.99999 10.8955 10.8954 10 12 10C13.1046 10 14 10.8955 14 12C14 13.1046 13.1046 14 12 14C10.8954 14 9.99999 13.1046 9.99999 12Z" fill="#0F1729"/>
2403
- <path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M10.7673 1.01709C10.9925 0.999829 11.2454 0.99993 11.4516 1.00001L12.5484 1.00001C12.7546 0.99993 13.0075 0.999829 13.2327 1.01709C13.4989 1.03749 13.8678 1.08936 14.2634 1.26937C14.7635 1.49689 15.1915 1.85736 15.5007 2.31147C15.7454 2.67075 15.8592 3.0255 15.9246 3.2843C15.9799 3.50334 16.0228 3.75249 16.0577 3.9557L16.1993 4.77635L16.2021 4.77788C16.2369 4.79712 16.2715 4.81659 16.306 4.8363L16.3086 4.83774L17.2455 4.49865C17.4356 4.42978 17.6693 4.34509 17.8835 4.28543C18.1371 4.2148 18.4954 4.13889 18.9216 4.17026C19.4614 4.20998 19.9803 4.39497 20.4235 4.70563C20.7734 4.95095 21.0029 5.23636 21.1546 5.4515C21.2829 5.63326 21.4103 5.84671 21.514 6.02029L22.0158 6.86003C22.1256 7.04345 22.2594 7.26713 22.3627 7.47527C22.4843 7.7203 22.6328 8.07474 22.6777 8.52067C22.7341 9.08222 22.6311 9.64831 22.3803 10.1539C22.1811 10.5554 21.9171 10.8347 21.7169 11.0212C21.5469 11.1795 21.3428 11.3417 21.1755 11.4746L20.5 12L21.1755 12.5254C21.3428 12.6584 21.5469 12.8205 21.7169 12.9789C21.9171 13.1653 22.1811 13.4446 22.3802 13.8461C22.631 14.3517 22.7341 14.9178 22.6776 15.4794C22.6328 15.9253 22.4842 16.2797 22.3626 16.5248C22.2593 16.7329 22.1255 16.9566 22.0158 17.14L21.5138 17.9799C21.4102 18.1535 21.2828 18.3668 21.1546 18.5485C21.0028 18.7637 20.7734 19.0491 20.4234 19.2944C19.9803 19.6051 19.4613 19.7901 18.9216 19.8298C18.4954 19.8612 18.1371 19.7852 17.8835 19.7146C17.6692 19.6549 17.4355 19.5703 17.2454 19.5014L16.3085 19.1623L16.306 19.1638C16.2715 19.1835 16.2369 19.2029 16.2021 19.2222L16.1993 19.2237L16.0577 20.0443C16.0228 20.2475 15.9799 20.4967 15.9246 20.7157C15.8592 20.9745 15.7454 21.3293 15.5007 21.6886C15.1915 22.1427 14.7635 22.5032 14.2634 22.7307C13.8678 22.9107 13.4989 22.9626 13.2327 22.983C13.0074 23.0002 12.7546 23.0001 12.5484 23H11.4516C11.2454 23.0001 10.9925 23.0002 10.7673 22.983C10.5011 22.9626 10.1322 22.9107 9.73655 22.7307C9.23648 22.5032 8.80849 22.1427 8.49926 21.6886C8.25461 21.3293 8.14077 20.9745 8.07542 20.7157C8.02011 20.4967 7.97723 20.2475 7.94225 20.0443L7.80068 19.2237L7.79791 19.2222C7.7631 19.2029 7.72845 19.1835 7.69396 19.1637L7.69142 19.1623L6.75458 19.5014C6.5645 19.5702 6.33078 19.6549 6.11651 19.7146C5.86288 19.7852 5.50463 19.8611 5.07841 19.8298C4.53866 19.7901 4.01971 19.6051 3.57654 19.2944C3.2266 19.0491 2.99714 18.7637 2.84539 18.5485C2.71718 18.3668 2.58974 18.1534 2.4861 17.9798L1.98418 17.14C1.87447 16.9566 1.74067 16.7329 1.63737 16.5248C1.51575 16.2797 1.36719 15.9253 1.32235 15.4794C1.26588 14.9178 1.36897 14.3517 1.61976 13.8461C1.81892 13.4446 2.08289 13.1653 2.28308 12.9789C2.45312 12.8205 2.65717 12.6584 2.82449 12.5254L3.47844 12.0054V11.9947L2.82445 11.4746C2.65712 11.3417 2.45308 11.1795 2.28304 11.0212C2.08285 10.8347 1.81888 10.5554 1.61972 10.1539C1.36893 9.64832 1.26584 9.08224 1.3223 8.52069C1.36714 8.07476 1.51571 7.72032 1.63732 7.47528C1.74062 7.26715 1.87443 7.04347 1.98414 6.86005L2.48605 6.02026C2.58969 5.84669 2.71714 5.63326 2.84534 5.45151C2.9971 5.23637 3.22655 4.95096 3.5765 4.70565C4.01966 4.39498 4.53862 4.20999 5.07837 4.17027C5.50458 4.1389 5.86284 4.21481 6.11646 4.28544C6.33072 4.34511 6.56444 4.4298 6.75451 4.49867L7.69141 4.83775L7.69394 4.8363C7.72844 4.8166 7.7631 4.79712 7.79791 4.77788L7.80068 4.77635L7.94225 3.95571C7.97723 3.7525 8.02011 3.50334 8.07542 3.2843C8.14077 3.0255 8.25461 2.67075 8.49926 2.31147C8.80849 1.85736 9.23648 1.49689 9.73655 1.26937C10.1322 1.08936 10.5011 1.03749 10.7673 1.01709ZM14.0938 4.3363C14.011 3.85634 13.9696 3.61637 13.8476 3.43717C13.7445 3.2858 13.6019 3.16564 13.4352 3.0898C13.2378 3.00002 12.9943 3.00002 12.5073 3.00002H11.4927C11.0057 3.00002 10.7621 3.00002 10.5648 3.0898C10.3981 3.16564 10.2555 3.2858 10.1524 3.43717C10.0304 3.61637 9.98895 3.85634 9.90615 4.3363L9.75012 5.24064C9.69445 5.56333 9.66662 5.72467 9.60765 5.84869C9.54975 5.97047 9.50241 6.03703 9.40636 6.13166C9.30853 6.22804 9.12753 6.3281 8.76554 6.52822C8.73884 6.54298 8.71227 6.55791 8.68582 6.57302C8.33956 6.77078 8.16643 6.86966 8.03785 6.90314C7.91158 6.93602 7.83293 6.94279 7.70289 6.93196C7.57049 6.92094 7.42216 6.86726 7.12551 6.7599L6.11194 6.39308C5.66271 6.2305 5.43809 6.14921 5.22515 6.16488C5.04524 6.17811 4.87225 6.23978 4.72453 6.34333C4.5497 6.46589 4.42715 6.67094 4.18206 7.08103L3.72269 7.84965C3.46394 8.2826 3.33456 8.49907 3.31227 8.72078C3.29345 8.90796 3.32781 9.09665 3.41141 9.26519C3.51042 9.4648 3.7078 9.62177 4.10256 9.9357L4.82745 10.5122C5.07927 10.7124 5.20518 10.8126 5.28411 10.9199C5.36944 11.036 5.40583 11.1114 5.44354 11.2504C5.47844 11.379 5.47844 11.586 5.47844 12C5.47844 12.414 5.47844 12.621 5.44354 12.7497C5.40582 12.8887 5.36944 12.9641 5.28413 13.0801C5.20518 13.1875 5.07927 13.2876 4.82743 13.4879L4.10261 14.0643C3.70785 14.3783 3.51047 14.5352 3.41145 14.7349C3.32785 14.9034 3.29349 15.0921 3.31231 15.2793C3.33461 15.501 3.46398 15.7174 3.72273 16.1504L4.1821 16.919C4.4272 17.3291 4.54974 17.5342 4.72457 17.6567C4.8723 17.7603 5.04528 17.8219 5.2252 17.8352C5.43813 17.8508 5.66275 17.7695 6.11199 17.607L7.12553 17.2402C7.42216 17.1328 7.5705 17.0791 7.7029 17.0681C7.83294 17.0573 7.91159 17.064 8.03786 17.0969C8.16644 17.1304 8.33956 17.2293 8.68582 17.427C8.71228 17.4421 8.73885 17.4571 8.76554 17.4718C9.12753 17.6719 9.30853 17.772 9.40635 17.8684C9.50241 17.963 9.54975 18.0296 9.60765 18.1514C9.66662 18.2754 9.69445 18.4367 9.75012 18.7594L9.90615 19.6637C9.98895 20.1437 10.0304 20.3837 10.1524 20.5629C10.2555 20.7142 10.3981 20.8344 10.5648 20.9102C10.7621 21 11.0057 21 11.4927 21H12.5073C12.9943 21 13.2378 21 13.4352 20.9102C13.6019 20.8344 13.7445 20.7142 13.8476 20.5629C13.9696 20.3837 14.011 20.1437 14.0938 19.6637L14.2499 18.7594C14.3055 18.4367 14.3334 18.2754 14.3923 18.1514C14.4502 18.0296 14.4976 17.963 14.5936 17.8684C14.6915 17.772 14.8725 17.6719 15.2344 17.4718C15.2611 17.4571 15.2877 17.4421 15.3141 17.427C15.6604 17.2293 15.8335 17.1304 15.9621 17.0969C16.0884 17.064 16.167 17.0573 16.2971 17.0681C16.4295 17.0791 16.5778 17.1328 16.8744 17.2402L17.888 17.607C18.3372 17.7696 18.5619 17.8509 18.7748 17.8352C18.9547 17.8219 19.1277 17.7603 19.2754 17.6567C19.4502 17.5342 19.5728 17.3291 19.8179 16.919L20.2773 16.1504C20.536 15.7175 20.6654 15.501 20.6877 15.2793C20.7065 15.0921 20.6721 14.9034 20.5885 14.7349C20.4895 14.5353 20.2921 14.3783 19.8974 14.0643L19.1726 13.4879C18.9207 13.2876 18.7948 13.1875 18.7159 13.0801C18.6306 12.9641 18.5942 12.8887 18.5564 12.7497C18.5215 12.6211 18.5215 12.414 18.5215 12C18.5215 11.586 18.5215 11.379 18.5564 11.2504C18.5942 11.1114 18.6306 11.036 18.7159 10.9199C18.7948 10.8126 18.9207 10.7124 19.1725 10.5122L19.8974 9.9357C20.2922 9.62176 20.4896 9.46479 20.5886 9.26517C20.6722 9.09664 20.7065 8.90795 20.6877 8.72076C20.6654 8.49906 20.5361 8.28259 20.2773 7.84964L19.8179 7.08102C19.5728 6.67093 19.4503 6.46588 19.2755 6.34332C19.1277 6.23977 18.9548 6.1781 18.7748 6.16486C18.5619 6.14919 18.3373 6.23048 17.888 6.39307L16.8745 6.75989C16.5778 6.86725 16.4295 6.92093 16.2971 6.93195C16.167 6.94278 16.0884 6.93601 15.9621 6.90313C15.8335 6.86965 15.6604 6.77077 15.3142 6.57302C15.2877 6.55791 15.2611 6.54298 15.2345 6.52822C14.8725 6.3281 14.6915 6.22804 14.5936 6.13166C14.4976 6.03703 14.4502 5.97047 14.3923 5.84869C14.3334 5.72467 14.3055 5.56332 14.2499 5.24064L14.0938 4.3363Z" fill="#0F1729"/>
2433
+ return `<svg class="cv-modal-icon-svg" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2434
+ <path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M12 8.00002C9.79085 8.00002 7.99999 9.79088 7.99999 12C7.99999 14.2092 9.79085 16 12 16C14.2091 16 16 14.2092 16 12C16 9.79088 14.2091 8.00002 12 8.00002ZM9.99999 12C9.99999 10.8955 10.8954 10 12 10C13.1046 10 14 10.8955 14 12C14 13.1046 13.1046 14 12 14C10.8954 14 9.99999 13.1046 9.99999 12Z" fill="#0F1729"/>
2435
+ <path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M10.7673 1.01709C10.9925 0.999829 11.2454 0.99993 11.4516 1.00001L12.5484 1.00001C12.7546 0.99993 13.0075 0.999829 13.2327 1.01709C13.4989 1.03749 13.8678 1.08936 14.2634 1.26937C14.7635 1.49689 15.1915 1.85736 15.5007 2.31147C15.7454 2.67075 15.8592 3.0255 15.9246 3.2843C15.9799 3.50334 16.0228 3.75249 16.0577 3.9557L16.1993 4.77635L16.2021 4.77788C16.2369 4.79712 16.2715 4.81659 16.306 4.8363L16.3086 4.83774L17.2455 4.49865C17.4356 4.42978 17.6693 4.34509 17.8835 4.28543C18.1371 4.2148 18.4954 4.13889 18.9216 4.17026C19.4614 4.20998 19.9803 4.39497 20.4235 4.70563C20.7734 4.95095 21.0029 5.23636 21.1546 5.4515C21.2829 5.63326 21.4103 5.84671 21.514 6.02029L22.0158 6.86003C22.1256 7.04345 22.2594 7.26713 22.3627 7.47527C22.4843 7.7203 22.6328 8.07474 22.6777 8.52067C22.7341 9.08222 22.6311 9.64831 22.3803 10.1539C22.1811 10.5554 21.9171 10.8347 21.7169 11.0212C21.5469 11.1795 21.3428 11.3417 21.1755 11.4746L20.5 12L21.1755 12.5254C21.3428 12.6584 21.5469 12.8205 21.7169 12.9789C21.9171 13.1653 22.1811 13.4446 22.3802 13.8461C22.631 14.3517 22.7341 14.9178 22.6776 15.4794C22.6328 15.9253 22.4842 16.2797 22.3626 16.5248C22.2593 16.7329 22.1255 16.9566 22.0158 17.14L21.5138 17.9799C21.4102 18.1535 21.2828 18.3668 21.1546 18.5485C21.0028 18.7637 20.7734 19.0491 20.4234 19.2944C19.9803 19.6051 19.4613 19.7901 18.9216 19.8298C18.4954 19.8612 18.1371 19.7852 17.8835 19.7146C17.6692 19.6549 17.4355 19.5703 17.2454 19.5014L16.3085 19.1623L16.306 19.1638C16.2715 19.1835 16.2369 19.2029 16.2021 19.2222L16.1993 19.2237L16.0577 20.0443C16.0228 20.2475 15.9799 20.4967 15.9246 20.7157C15.8592 20.9745 15.7454 21.3293 15.5007 21.6886C15.1915 22.1427 14.7635 22.5032 14.2634 22.7307C13.8678 22.9107 13.4989 22.9626 13.2327 22.983C13.0074 23.0002 12.7546 23.0001 12.5484 23H11.4516C11.2454 23.0001 10.9925 23.0002 10.7673 22.983C10.5011 22.9626 10.1322 22.9107 9.73655 22.7307C9.23648 22.5032 8.80849 22.1427 8.49926 21.6886C8.25461 21.3293 8.14077 20.9745 8.07542 20.7157C8.02011 20.4967 7.97723 20.2475 7.94225 20.0443L7.80068 19.2237L7.79791 19.2222C7.7631 19.2029 7.72845 19.1835 7.69396 19.1637L7.69142 19.1623L6.75458 19.5014C6.5645 19.5702 6.33078 19.6549 6.11651 19.7146C5.86288 19.7852 5.50463 19.8611 5.07841 19.8298C4.53866 19.7901 4.01971 19.6051 3.57654 19.2944C3.2266 19.0491 2.99714 18.7637 2.84539 18.5485C2.71718 18.3668 2.58974 18.1534 2.4861 17.9798L1.98418 17.14C1.87447 16.9566 1.74067 16.7329 1.63737 16.5248C1.51575 16.2797 1.36719 15.9253 1.32235 15.4794C1.26588 14.9178 1.36897 14.3517 1.61976 13.8461C1.81892 13.4446 2.08289 13.1653 2.28308 12.9789C2.45312 12.8205 2.65717 12.6584 2.82449 12.5254L3.47844 12.0054V11.9947L2.82445 11.4746C2.65712 11.3417 2.45308 11.1795 2.28304 11.0212C2.08285 10.8347 1.81888 10.5554 1.61972 10.1539C1.36893 9.64832 1.26584 9.08224 1.3223 8.52069C1.36714 8.07476 1.51571 7.72032 1.63732 7.47528C1.74062 7.26715 1.87443 7.04347 1.98414 6.86005L2.48605 6.02026C2.58969 5.84669 2.71714 5.63326 2.84534 5.45151C2.9971 5.23637 3.22655 4.95096 3.5765 4.70565C4.01966 4.39498 4.53862 4.20999 5.07837 4.17027C5.50458 4.1389 5.86284 4.21481 6.11646 4.28544C6.33072 4.34511 6.56444 4.4298 6.75451 4.49867L7.69141 4.83775L7.69394 4.8363C7.72844 4.8166 7.7631 4.79712 7.79791 4.77788L7.80068 4.77635L7.94225 3.95571C7.97723 3.7525 8.02011 3.50334 8.07542 3.2843C8.14077 3.0255 8.25461 2.67075 8.49926 2.31147C8.80849 1.85736 9.23648 1.49689 9.73655 1.26937C10.1322 1.08936 10.5011 1.03749 10.7673 1.01709ZM14.0938 4.3363C14.011 3.85634 13.9696 3.61637 13.8476 3.43717C13.7445 3.2858 13.6019 3.16564 13.4352 3.0898C13.2378 3.00002 12.9943 3.00002 12.5073 3.00002H11.4927C11.0057 3.00002 10.7621 3.00002 10.5648 3.0898C10.3981 3.16564 10.2555 3.2858 10.1524 3.43717C10.0304 3.61637 9.98895 3.85634 9.90615 4.3363L9.75012 5.24064C9.69445 5.56333 9.66662 5.72467 9.60765 5.84869C9.54975 5.97047 9.50241 6.03703 9.40636 6.13166C9.30853 6.22804 9.12753 6.3281 8.76554 6.52822C8.73884 6.54298 8.71227 6.55791 8.68582 6.57302C8.33956 6.77078 8.16643 6.86966 8.03785 6.90314C7.91158 6.93602 7.83293 6.94279 7.70289 6.93196C7.57049 6.92094 7.42216 6.86726 7.12551 6.7599L6.11194 6.39308C5.66271 6.2305 5.43809 6.14921 5.22515 6.16488C5.04524 6.17811 4.87225 6.23978 4.72453 6.34333C4.5497 6.46589 4.42715 6.67094 4.18206 7.08103L3.72269 7.84965C3.46394 8.2826 3.33456 8.49907 3.31227 8.72078C3.29345 8.90796 3.32781 9.09665 3.41141 9.26519C3.51042 9.4648 3.7078 9.62177 4.10256 9.9357L4.82745 10.5122C5.07927 10.7124 5.20518 10.8126 5.28411 10.9199C5.36944 11.036 5.40583 11.1114 5.44354 11.2504C5.47844 11.379 5.47844 11.586 5.47844 12C5.47844 12.414 5.47844 12.621 5.44354 12.7497C5.40582 12.8887 5.36944 12.9641 5.28413 13.0801C5.20518 13.1875 5.07927 13.2876 4.82743 13.4879L4.10261 14.0643C3.70785 14.3783 3.51047 14.5352 3.41145 14.7349C3.32785 14.9034 3.29349 15.0921 3.31231 15.2793C3.33461 15.501 3.46398 15.7174 3.72273 16.1504L4.1821 16.919C4.4272 17.3291 4.54974 17.5342 4.72457 17.6567C4.8723 17.7603 5.04528 17.8219 5.2252 17.8352C5.43813 17.8508 5.66275 17.7695 6.11199 17.607L7.12553 17.2402C7.42216 17.1328 7.5705 17.0791 7.7029 17.0681C7.83294 17.0573 7.91159 17.064 8.03786 17.0969C8.16644 17.1304 8.33956 17.2293 8.68582 17.427C8.71228 17.4421 8.73885 17.4571 8.76554 17.4718C9.12753 17.6719 9.30853 17.772 9.40635 17.8684C9.50241 17.963 9.54975 18.0296 9.60765 18.1514C9.66662 18.2754 9.69445 18.4367 9.75012 18.7594L9.90615 19.6637C9.98895 20.1437 10.0304 20.3837 10.1524 20.5629C10.2555 20.7142 10.3981 20.8344 10.5648 20.9102C10.7621 21 11.0057 21 11.4927 21H12.5073C12.9943 21 13.2378 21 13.4352 20.9102C13.6019 20.8344 13.7445 20.7142 13.8476 20.5629C13.9696 20.3837 14.011 20.1437 14.0938 19.6637L14.2499 18.7594C14.3055 18.4367 14.3334 18.2754 14.3923 18.1514C14.4502 18.0296 14.4976 17.963 14.5936 17.8684C14.6915 17.772 14.8725 17.6719 15.2344 17.4718C15.2611 17.4571 15.2877 17.4421 15.3141 17.427C15.6604 17.2293 15.8335 17.1304 15.9621 17.0969C16.0884 17.064 16.167 17.0573 16.2971 17.0681C16.4295 17.0791 16.5778 17.1328 16.8744 17.2402L17.888 17.607C18.3372 17.7696 18.5619 17.8509 18.7748 17.8352C18.9547 17.8219 19.1277 17.7603 19.2754 17.6567C19.4502 17.5342 19.5728 17.3291 19.8179 16.919L20.2773 16.1504C20.536 15.7175 20.6654 15.501 20.6877 15.2793C20.7065 15.0921 20.6721 14.9034 20.5885 14.7349C20.4895 14.5353 20.2921 14.3783 19.8974 14.0643L19.1726 13.4879C18.9207 13.2876 18.7948 13.1875 18.7159 13.0801C18.6306 12.9641 18.5942 12.8887 18.5564 12.7497C18.5215 12.6211 18.5215 12.414 18.5215 12C18.5215 11.586 18.5215 11.379 18.5564 11.2504C18.5942 11.1114 18.6306 11.036 18.7159 10.9199C18.7948 10.8126 18.9207 10.7124 19.1725 10.5122L19.8974 9.9357C20.2922 9.62176 20.4896 9.46479 20.5886 9.26517C20.6722 9.09664 20.7065 8.90795 20.6877 8.72076C20.6654 8.49906 20.5361 8.28259 20.2773 7.84964L19.8179 7.08102C19.5728 6.67093 19.4503 6.46588 19.2755 6.34332C19.1277 6.23977 18.9548 6.1781 18.7748 6.16486C18.5619 6.14919 18.3373 6.23048 17.888 6.39307L16.8745 6.75989C16.5778 6.86725 16.4295 6.92093 16.2971 6.93195C16.167 6.94278 16.0884 6.93601 15.9621 6.90313C15.8335 6.86965 15.6604 6.77077 15.3142 6.57302C15.2877 6.55791 15.2611 6.54298 15.2345 6.52822C14.8725 6.3281 14.6915 6.22804 14.5936 6.13166C14.4976 6.03703 14.4502 5.97047 14.3923 5.84869C14.3334 5.72467 14.3055 5.56332 14.2499 5.24064L14.0938 4.3363Z" fill="#0F1729"/>
2404
2436
  </svg>`;
2405
2437
  }
2406
2438
  /**
2407
2439
  * Close/X icon for modal close button
2408
2440
  */
2409
2441
  function getCloseIcon() {
2410
- return `<svg class="cv-modal-close-icon" fill="currentColor" height="20px" viewBox="0 0 256 256" width="20px" xmlns="http://www.w3.org/2000/svg">
2411
- <path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>
2442
+ return `<svg class="cv-modal-close-icon" fill="currentColor" height="20px" viewBox="0 0 256 256" width="20px" xmlns="http://www.w3.org/2000/svg">
2443
+ <path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>
2412
2444
  </svg>`;
2413
2445
  }
2414
2446
  /**
2415
2447
  * Reset/refresh icon for reset button
2416
2448
  */
2417
2449
  function getResetIcon() {
2418
- return `<svg class="cv-btn-icon" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2419
- <path d="M22.719 12A10.719 10.719 0 0 1 1.28 12h.838a9.916 9.916 0 1 0 1.373-5H8v1H2V2h1v4.2A10.71 10.71 0 0 1 22.719 12z"/><path fill="none" d="M0 0h24v24H0z"/>
2450
+ return `<svg class="cv-btn-icon" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2451
+ <path d="M22.719 12A10.719 10.719 0 0 1 1.28 12h.838a9.916 9.916 0 1 0 1.373-5H8v1H2V2h1v4.2A10.71 10.71 0 0 1 22.719 12z"/><path fill="none" d="M0 0h24v24H0z"/>
2420
2452
  </svg>`;
2421
2453
  }
2422
2454
  /**
2423
2455
  * Share icon for share button
2424
2456
  */
2425
2457
  function getShareIcon() {
2426
- return `<svg class="cv-btn-icon" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2427
- <path xmlns="http://www.w3.org/2000/svg" d="M6 11C6 8.17157 6 6.75736 6.87868 5.87868C7.75736 5 9.17157 5 12 5H15C17.8284 5 19.2426 5 20.1213 5.87868C21 6.75736 21 8.17157 21 11V16C21 18.8284 21 20.2426 20.1213 21.1213C19.2426 22 17.8284 22 15 22H12C9.17157 22 7.75736 22 6.87868 21.1213C6 20.2426 6 18.8284 6 16V11Z" stroke="#1C274C" stroke-width="1.5"/>
2428
- <path xmlns="http://www.w3.org/2000/svg" opacity="0.5" d="M6 19C4.34315 19 3 17.6569 3 16V10C3 6.22876 3 4.34315 4.17157 3.17157C5.34315 2 7.22876 2 11 2H15C16.6569 2 18 3.34315 18 5" stroke="#1C274C" stroke-width="1.5"/>
2458
+ return `<svg class="cv-btn-icon" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2459
+ <path xmlns="http://www.w3.org/2000/svg" d="M6 11C6 8.17157 6 6.75736 6.87868 5.87868C7.75736 5 9.17157 5 12 5H15C17.8284 5 19.2426 5 20.1213 5.87868C21 6.75736 21 8.17157 21 11V16C21 18.8284 21 20.2426 20.1213 21.1213C19.2426 22 17.8284 22 15 22H12C9.17157 22 7.75736 22 6.87868 21.1213C6 20.2426 6 18.8284 6 16V11Z" stroke="#1C274C" stroke-width="1.5"/>
2460
+ <path xmlns="http://www.w3.org/2000/svg" opacity="0.5" d="M6 19C4.34315 19 3 17.6569 3 16V10C3 6.22876 3 4.34315 4.17157 3.17157C5.34315 2 7.22876 2 11 2H15C16.6569 2 18 3.34315 18 5" stroke="#1C274C" stroke-width="1.5"/>
2429
2461
  </svg>`;
2430
2462
  }
2431
2463
 
@@ -2529,123 +2561,101 @@ class CustomViewsWidget {
2529
2561
  this.modal = document.createElement('div');
2530
2562
  this.modal.className = 'cv-widget-modal-overlay';
2531
2563
  this.applyThemeToModal();
2532
- const toggleControlsHtml = toggles.map(toggle => `
2533
- <div class="cv-toggle-card">
2534
- <div class="cv-toggle-content">
2535
- <div>
2536
- <p class="cv-toggle-title">${this.formatToggleName(toggle)}</p>
2537
- </div>
2538
- <label class="cv-toggle-label">
2539
- <input class="cv-toggle-input" type="checkbox" data-toggle="${toggle}"/>
2540
- <span class="cv-toggle-slider"></span>
2541
- </label>
2542
- </div>
2543
- </div>
2564
+ const toggleControlsHtml = toggles.map(toggle => `
2565
+ <div class="cv-toggle-card">
2566
+ <div class="cv-toggle-content">
2567
+ <div>
2568
+ <p class="cv-toggle-title">${this.formatToggleName(toggle)}</p>
2569
+ </div>
2570
+ <label class="cv-toggle-label">
2571
+ <input class="cv-toggle-input" type="checkbox" data-toggle="${toggle}"/>
2572
+ <span class="cv-toggle-slider"></span>
2573
+ </label>
2574
+ </div>
2575
+ </div>
2544
2576
  `).join('');
2545
2577
  // Todo: Re-add description if needed (Line 168, add label field to toggles if needed change structure)
2546
2578
  // <p class="cv-toggle-description">Show or hide the ${this.formatToggleName(toggle).toLowerCase()} area </p>
2547
2579
  // Get tab groups
2548
2580
  const tabGroups = this.core.getTabGroups();
2549
2581
  let tabGroupControlsHTML = '';
2550
- // Check if any tab group or tab labels contain Font Awesome shortcodes
2551
- let hasFontAwesomeShortcodes = false;
2552
2582
  if (this.options.showTabGroups && tabGroups && tabGroups.length > 0) {
2553
- for (const group of tabGroups) {
2554
- if (group.label && /:fa-[\w-]+:/.test(group.label)) {
2555
- hasFontAwesomeShortcodes = true;
2556
- break;
2557
- }
2558
- for (const tab of group.tabs) {
2559
- if (tab.label && /:fa-[\w-]+:/.test(tab.label)) {
2560
- hasFontAwesomeShortcodes = true;
2561
- break;
2562
- }
2563
- }
2564
- if (hasFontAwesomeShortcodes)
2565
- break;
2566
- }
2567
- }
2568
- // Inject Font Awesome only if shortcodes are found
2569
- if (hasFontAwesomeShortcodes) {
2570
- ensureFontAwesomeInjected();
2571
- }
2572
- if (this.options.showTabGroups && tabGroups && tabGroups.length > 0) {
2573
- tabGroupControlsHTML = `
2574
- <div class="cv-tabgroup-card cv-tabgroup-header">
2575
- <div class="cv-tabgroup-row">
2576
- <div class="cv-tabgroup-info">
2577
- <p class="cv-tabgroup-title">Navigation Headers</p>
2578
- <p class="cv-tabgroup-description">Show or hide navigation headers</p>
2579
- </div>
2580
- <label class="cv-toggle-switch cv-nav-toggle">
2581
- <input class="cv-nav-pref-input" type="checkbox" aria-label="Show or hide navigation headers" />
2582
- <span class="cv-switch-bg"></span>
2583
- <span class="cv-switch-knob"></span>
2584
- </label>
2585
- </div>
2586
- </div>
2587
- <div class="cv-tab-groups-list">
2588
- ${tabGroups.map(group => `
2589
- <div class="cv-tabgroup-card cv-tabgroup-item">
2590
- <label class="cv-tabgroup-label" for="tab-group-${group.id}">
2591
- ${replaceIconShortcodes(group.label || group.id)}
2592
- </label>
2593
- <select id="tab-group-${group.id}" class="cv-tabgroup-select" data-group-id="${group.id}">
2594
- ${group.tabs.map(tab => `<option value="${tab.id}">${replaceIconShortcodes(tab.label || tab.id)}</option>`).join('')}
2595
- </select>
2596
- </div>
2597
- `).join('')}
2598
- </div>
2583
+ tabGroupControlsHTML = `
2584
+ <div class="cv-tabgroup-card cv-tabgroup-header">
2585
+ <div class="cv-tabgroup-row">
2586
+ <div class="cv-tabgroup-info">
2587
+ <p class="cv-tabgroup-title">Navigation Headers</p>
2588
+ <p class="cv-tabgroup-description">Show or hide navigation headers</p>
2589
+ </div>
2590
+ <label class="cv-toggle-switch cv-nav-toggle">
2591
+ <input class="cv-nav-pref-input" type="checkbox" aria-label="Show or hide navigation headers" />
2592
+ <span class="cv-switch-bg"></span>
2593
+ <span class="cv-switch-knob"></span>
2594
+ </label>
2595
+ </div>
2596
+ </div>
2597
+ <div class="cv-tab-groups-list">
2598
+ ${tabGroups.map(group => `
2599
+ <div class="cv-tabgroup-card cv-tabgroup-item">
2600
+ <label class="cv-tabgroup-label" for="tab-group-${group.id}">
2601
+ ${group.label || group.id}
2602
+ </label>
2603
+ <select id="tab-group-${group.id}" class="cv-tabgroup-select" data-group-id="${group.id}">
2604
+ ${group.tabs.map(tab => `<option value="${tab.id}">${tab.label || tab.id}</option>`).join('')}
2605
+ </select>
2606
+ </div>
2607
+ `).join('')}
2608
+ </div>
2599
2609
  `;
2600
2610
  }
2601
- this.modal.innerHTML = `
2602
- <div class="cv-widget-modal cv-custom-state-modal">
2603
- <header class="cv-modal-header">
2604
- <div class="cv-modal-header-content">
2605
- <div class="cv-modal-icon">
2606
- ${getGearIcon()}
2607
- </div>
2608
- <div class="cv-modal-title">${this.options.title}</div>
2609
- </div>
2610
- <button class="cv-modal-close" aria-label="Close modal">
2611
- ${getCloseIcon()}
2612
- </button>
2613
- </header>
2614
- <main class="cv-modal-main">
2615
- ${this.options.description ? `<p class="cv-modal-description">${this.options.description}</p>` : ''}
2616
-
2617
- ${toggles.length ? `
2618
- <div class="cv-content-section">
2619
- <div class="cv-section-heading">Toggles</div>
2620
- <div class="cv-toggles-container">
2621
- ${toggleControlsHtml}
2622
- </div>
2623
- </div>
2624
- ` : ''}
2625
-
2626
- ${this.options.showTabGroups && tabGroups && tabGroups.length > 0 ? `
2627
- <div class="cv-content-section">
2628
- <div class="cv-section-heading">Tab Groups</div>
2629
- <div class="cv-tabgroups-container">
2630
- ${tabGroupControlsHTML}
2631
- </div>
2632
- </div>
2633
- ` : ''}
2634
- </main>
2635
-
2636
- <footer class="cv-modal-footer">
2637
- ${this.options.showReset ? `
2638
- <button class="cv-reset-btn">
2639
- ${getResetIcon()}
2640
- <span>Reset to Default</span>
2641
- </button>
2642
- ` : ''}
2643
- <button class="cv-share-btn">
2644
- ${getShareIcon()}
2645
- <span>Copy Shareable URL</span>
2646
- </button>
2647
- </footer>
2648
- </div>
2611
+ this.modal.innerHTML = `
2612
+ <div class="cv-widget-modal cv-custom-state-modal">
2613
+ <header class="cv-modal-header">
2614
+ <div class="cv-modal-header-content">
2615
+ <div class="cv-modal-icon">
2616
+ ${getGearIcon()}
2617
+ </div>
2618
+ <div class="cv-modal-title">${this.options.title}</div>
2619
+ </div>
2620
+ <button class="cv-modal-close" aria-label="Close modal">
2621
+ ${getCloseIcon()}
2622
+ </button>
2623
+ </header>
2624
+ <main class="cv-modal-main">
2625
+ ${this.options.description ? `<p class="cv-modal-description">${this.options.description}</p>` : ''}
2626
+
2627
+ ${toggles.length ? `
2628
+ <div class="cv-content-section">
2629
+ <div class="cv-section-heading">Toggles</div>
2630
+ <div class="cv-toggles-container">
2631
+ ${toggleControlsHtml}
2632
+ </div>
2633
+ </div>
2634
+ ` : ''}
2635
+
2636
+ ${this.options.showTabGroups && tabGroups && tabGroups.length > 0 ? `
2637
+ <div class="cv-content-section">
2638
+ <div class="cv-section-heading">Tab Groups</div>
2639
+ <div class="cv-tabgroups-container">
2640
+ ${tabGroupControlsHTML}
2641
+ </div>
2642
+ </div>
2643
+ ` : ''}
2644
+ </main>
2645
+
2646
+ <footer class="cv-modal-footer">
2647
+ ${this.options.showReset ? `
2648
+ <button class="cv-reset-btn">
2649
+ ${getResetIcon()}
2650
+ <span>Reset to Default</span>
2651
+ </button>
2652
+ ` : ''}
2653
+ <button class="cv-share-btn">
2654
+ ${getShareIcon()}
2655
+ <span>Copy Shareable URL</span>
2656
+ </button>
2657
+ </footer>
2658
+ </div>
2649
2659
  `;
2650
2660
  document.body.appendChild(this.modal);
2651
2661
  this.attachStateModalEventListeners();
@@ -2879,29 +2889,29 @@ class CustomViewsWidget {
2879
2889
  this.modal = document.createElement('div');
2880
2890
  this.modal.className = 'cv-widget-modal-overlay cv-welcome-modal-overlay';
2881
2891
  this.applyThemeToModal();
2882
- this.modal.innerHTML = `
2883
- <div class="cv-widget-modal cv-welcome-modal">
2884
- <header class="cv-modal-header">
2885
- <div class="cv-modal-header-content">
2886
- <div class="cv-modal-icon">
2887
- ${getGearIcon()}
2888
- </div>
2889
- <h1 class="cv-modal-title">${this.options.welcomeTitle}</h1>
2890
- </div>
2891
- </header>
2892
- <div class="cv-modal-main">
2893
- <p class="cv-welcome-message">${this.options.welcomeMessage}</p>
2894
-
2895
- <div class="cv-welcome-widget-preview">
2896
- <div class="cv-welcome-widget-icon">
2897
- ${getGearIcon()}
2898
- </div>
2899
- <p class="cv-welcome-widget-label">Look for this widget</p>
2900
- </div>
2901
-
2902
- <button class="cv-welcome-got-it">Got it!</button>
2903
- </div>
2904
- </div>
2892
+ this.modal.innerHTML = `
2893
+ <div class="cv-widget-modal cv-welcome-modal">
2894
+ <header class="cv-modal-header">
2895
+ <div class="cv-modal-header-content">
2896
+ <div class="cv-modal-icon">
2897
+ ${getGearIcon()}
2898
+ </div>
2899
+ <h1 class="cv-modal-title">${this.options.welcomeTitle}</h1>
2900
+ </div>
2901
+ </header>
2902
+ <div class="cv-modal-main">
2903
+ <p class="cv-welcome-message">${this.options.welcomeMessage}</p>
2904
+
2905
+ <div class="cv-welcome-widget-preview">
2906
+ <div class="cv-welcome-widget-icon">
2907
+ ${getGearIcon()}
2908
+ </div>
2909
+ <p class="cv-welcome-widget-label">Look for this widget</p>
2910
+ </div>
2911
+
2912
+ <button class="cv-welcome-got-it">Got it!</button>
2913
+ </div>
2914
+ </div>
2905
2915
  `;
2906
2916
  document.body.appendChild(this.modal);
2907
2917
  this.attachWelcomeModalEventListeners();
@@ -2965,27 +2975,21 @@ function initializeFromScript() {
2965
2975
  }
2966
2976
  window.__customViewsInitInProgress = true;
2967
2977
  try {
2968
- // Find the script tag
2978
+ // Find the script tag that loaded this script
2969
2979
  let scriptTag = document.currentScript;
2970
- // Fallback if currentScript is not available (executed after page load)
2971
- if (!scriptTag) {
2972
- // Try to find the script tag by looking for our script
2973
- const scripts = document.querySelectorAll('script[src*="@customviews-js"]');
2974
- if (scripts.length > 0) {
2975
- // Find the most specific match (to avoid matching other custom-views scripts)
2976
- for (let i = 0; i < scripts.length; i++) {
2977
- const script = scripts[i];
2978
- const src = script.getAttribute('src') || '';
2979
- // Look for .min.js or .js at the end, or the package root
2980
- if (src.match(/@customviews-js\/customviews(\.min)?\.js($|\?)/) || src.includes('@customviews-js/customviews')) {
2980
+ if (!scriptTag || !scriptTag.hasAttribute('data-base-url')) {
2981
+ const dataAttrMatch = document.querySelector('script[data-base-url]');
2982
+ if (dataAttrMatch) {
2983
+ scriptTag = dataAttrMatch;
2984
+ }
2985
+ else {
2986
+ for (const script of document.scripts) {
2987
+ const src = script.src || '';
2988
+ if (/(?:custom[-_]views|@customviews-js\/customviews)(?:\.min)?\.(?:esm\.)?js($|\?)/i.test(src)) {
2981
2989
  scriptTag = script;
2982
2990
  break;
2983
2991
  }
2984
2992
  }
2985
- // If no specific match found, use the first one
2986
- if (!scriptTag) {
2987
- scriptTag = scripts[0];
2988
- }
2989
2993
  }
2990
2994
  }
2991
2995
  // Read data attributes from script tag