opticore-profiler 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # OptiCore Profiler
2
2
 
3
- A Symfony WebProfilerBundle-style profiler for the OptiCore Express stack:
3
+ OptiCore profiler :
4
4
  **collect → persist by token → display deferred**.
5
5
 
6
6
  ## Installation
@@ -122,7 +122,7 @@ hr.divider { border:none; border-top:1px solid #e6e6e6; margin:18px 0; }
122
122
  .muted { color:var(--muted); }
123
123
 
124
124
  .lang-switch { display:flex; align-items:center; gap:2px; background:#f5f3f0; border:1px solid #e6e6e6; border-radius:5px; padding:3px; flex-shrink:0; }
125
- .lang-switch-item { padding:5px 10px; font-size:11px; font-weight:700; letter-spacing:.3px; color:#888; border-radius:3px; text-decoration:none; }
125
+ .lang-switch-item { padding:5px 10px; font-size:11px; font-weight:700; letter-spacing:.3px; color:#888; border-radius:3px; text-decoration:none; border:none; background:none; cursor:pointer; font-family:inherit; }
126
126
  .lang-switch-item.active { background:#fff; color:#C87A3C; box-shadow:0 1px 3px rgba(0,0,0,.1); }
127
127
  .lang-switch-item:hover:not(.active) { color:#555; }
128
128
 
@@ -16,7 +16,7 @@ input:focus, select:focus { border-color:#C87A3C !important; outline:none; }
16
16
  .pl-header { max-width:2000px; margin:0 auto; padding:34px 200px 0 200px; }
17
17
  .pl-header-row { display:flex; align-items:center; justify-content:space-between; gap:14px; }
18
18
  .lang-switch { display:flex; align-items:center; gap:2px; background:#f5f3f0; border:1px solid #e6e6e6; border-radius:5px; padding:3px; flex-shrink:0; }
19
- .lang-switch-item { padding:5px 10px; font-size:11px; font-weight:700; letter-spacing:.3px; color:#888; border-radius:3px; }
19
+ .lang-switch-item { padding:5px 10px; font-size:11px; font-weight:700; letter-spacing:.3px; color:#888; border-radius:3px; border:none; background:none; cursor:pointer; font-family:inherit; }
20
20
  .lang-switch-item.active { background:#fff; color:#C87A3C; box-shadow:0 1px 3px rgba(0,0,0,.1); }
21
21
  .lang-switch-item:hover:not(.active) { color:#555; }
22
22
  .pl-brand { display:flex; align-items:center; gap:14px; cursor:pointer; text-decoration:none; }
@@ -62,6 +62,7 @@ body {
62
62
  .lang-switch--toolbar .lang-switch-item {
63
63
  padding: 3px 6px; font-size: 10px; font-weight: 700; letter-spacing: .3px;
64
64
  color: #777; border-radius: 3px; text-decoration: none;
65
+ border: none; background: none; cursor: pointer; font-family: inherit;
65
66
  }
66
67
  .lang-switch--toolbar .lang-switch-item.active { background: #2e2e2e; color: #FAC68E; }
67
68
  .lang-switch--toolbar .lang-switch-item:hover:not(.active) { color: #ccc; }
package/dist/index.cjs CHANGED
@@ -558,7 +558,7 @@ function parseCookie(header, name) {
558
558
  function resolveLanguage(req, res) {
559
559
  const queryLang = req.query?.lang;
560
560
  if (isSupportedLanguage(queryLang)) {
561
- res.setHeader("Set-Cookie", `${LANG_COOKIE}=${queryLang}; Path=/; Max-Age=31536000; SameSite=Lax`);
561
+ res.append("Set-Cookie", `${LANG_COOKIE}=${queryLang}; Path=/; Max-Age=31536000; SameSite=Lax`);
562
562
  return queryLang;
563
563
  }
564
564
  const cookieLang = parseCookie(req.headers?.cookie, LANG_COOKIE);
package/dist/index.js CHANGED
@@ -510,7 +510,7 @@ function parseCookie(header, name) {
510
510
  function resolveLanguage(req, res) {
511
511
  const queryLang = req.query?.lang;
512
512
  if (isSupportedLanguage(queryLang)) {
513
- res.setHeader("Set-Cookie", `${LANG_COOKIE}=${queryLang}; Path=/; Max-Age=31536000; SameSite=Lax`);
513
+ res.append("Set-Cookie", `${LANG_COOKIE}=${queryLang}; Path=/; Max-Age=31536000; SameSite=Lax`);
514
514
  return queryLang;
515
515
  }
516
516
  const cookieLang = parseCookie(req.headers?.cookie, LANG_COOKIE);
@@ -25,7 +25,7 @@
25
25
  </div>
26
26
  <div class="lang-switch">
27
27
  {% for l in languages %}
28
- <a href="#" class="lang-switch-item{{ ' active' if l.active }}" onclick="event.preventDefault();var u=new URL(location.href);u.searchParams.set('lang','{{ l.code }}');location.href=u.toString();">{{ l.code | upper }}</a>
28
+ <button type="button" class="lang-switch-item{{ ' active' if l.active }}" onclick="var q=location.search.slice(1).split('&amp;').filter(function(p){return p&amp;&amp;p.slice(0,5)!=='lang=';});q.push('lang={{ l.code }}');location.href=location.pathname+'?'+q.join('&amp;')+location.hash;">{{ l.code | upper }}</button>
29
29
  {% endfor %}
30
30
  </div>
31
31
  </div>
@@ -22,7 +22,7 @@
22
22
  </form>
23
23
  <div class="lang-switch">
24
24
  {% for l in languages %}
25
- <a href="#" class="lang-switch-item{{ ' active' if l.active }}" onclick="event.preventDefault();var u=new URL(location.href);u.searchParams.set('lang','{{ l.code }}');location.href=u.toString();">{{ l.code | upper }}</a>
25
+ <button type="button" class="lang-switch-item{{ ' active' if l.active }}" onclick="var q=location.search.slice(1).split('&amp;').filter(function(p){return p&amp;&amp;p.slice(0,5)!=='lang=';});q.push('lang={{ l.code }}');location.href=location.pathname+'?'+q.join('&amp;')+location.hash;">{{ l.code | upper }}</button>
26
26
  {% endfor %}
27
27
  </div>
28
28
  </div>
@@ -109,7 +109,7 @@
109
109
  <div class="tb-block-wrap">
110
110
  <div class="lang-switch lang-switch--toolbar">
111
111
  {% for l in languages %}
112
- <a href="#" class="lang-switch-item{{ ' active' if l.active }}" onclick="event.preventDefault();var u=new URL(location.href);u.searchParams.set('lang','{{ l.code }}');location.href=u.toString();">{{ l.code | upper }}</a>
112
+ <button type="button" class="lang-switch-item{{ ' active' if l.active }}" onclick="var q=location.search.slice(1).split('&amp;').filter(function(p){return p&amp;&amp;p.slice(0,5)!=='lang=';});q.push('lang={{ l.code }}');location.href=location.pathname+'?'+q.join('&amp;')+location.hash;">{{ l.code | upper }}</button>
113
113
  {% endfor %}
114
114
  </div>
115
115
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opticore-profiler",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Web debug toolbar",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",