Skip to content

Commit

Permalink
Merge pull request #408 from st3phhays/astro-tabs
Browse files Browse the repository at this point in the history
(#407) Retain Astro Component CSS
  • Loading branch information
steviecoaster authored Jun 12, 2024
2 parents 26b4eaf + 40a87f6 commit 2188941
Show file tree
Hide file tree
Showing 45 changed files with 377 additions and 363 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Chocolatey choco-theme 0.7.1
# Chocolatey choco-theme 0.7.2

**NOTE: This project is used on Chocolatey websites and is being released for the benefit of the community. While we endeavour to help and fix issues, it will be limited to GitHub issues, discussions and pull requests when we are able to.**

Expand Down
4 changes: 3 additions & 1 deletion build/data/repository-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ export const astroRepositoryConfig = {
'src/**/*.mdx',
'src/**/*.js',
'src/**/*.ts',
'public/**/*.js'
'public/**/*.js',
'node_modules/choco-astro/src/**/*.astro',
'node_modules/choco-astro/src/**/*.ts'
],
safelist: [
'::-webkit-scrollbar',
Expand Down
2 changes: 1 addition & 1 deletion build/esbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const init = async () => {
const minify = process.argv.includes('--minify');

const banner: string = `/*!
* choco-theme v0.7.1 (https://github.com/chocolatey/choco-theme#readme)
* choco-theme v0.7.2 (https://github.com/chocolatey/choco-theme#readme)
* Copyright 2020-2024 Chocolatey Software
* Licensed under MIT (https://github.com/chocolatey/choco-theme/blob/main/LICENSE)
*/`;
Expand Down
2 changes: 1 addition & 1 deletion dist/css/boxstarter.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@charset "UTF-8";
/*!
* choco-theme boxstarter v0.7.1 (https://github.com/chocolatey/choco-theme#readme)
* choco-theme boxstarter v0.7.2 (https://github.com/chocolatey/choco-theme#readme)
* Copyright 2020-2024 Chocolatey Software
* Licensed under MIT (https://github.com/chocolatey/choco-theme/blob/main/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/css/boxstarter.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/chocolatey.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@charset "UTF-8";
/*!
* choco-theme chocolatey v0.7.1 (https://github.com/chocolatey/choco-theme#readme)
* choco-theme chocolatey v0.7.2 (https://github.com/chocolatey/choco-theme#readme)
* Copyright 2020-2024 Chocolatey Software
* Licensed under MIT (https://github.com/chocolatey/choco-theme/blob/main/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/css/chocolatey.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/zendesk.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@charset "UTF-8";
/*!
* choco-theme zendesk v0.7.1 (https://github.com/chocolatey/choco-theme#readme)
* choco-theme zendesk v0.7.2 (https://github.com/chocolatey/choco-theme#readme)
* Copyright 2020-2024 Chocolatey Software
* Licensed under MIT (https://github.com/chocolatey/choco-theme/blob/main/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/css/zendesk.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/blog.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* choco-theme v0.7.1 (https://github.com/chocolatey/choco-theme#readme)
* choco-theme v0.7.2 (https://github.com/chocolatey/choco-theme#readme)
* Copyright 2020-2024 Chocolatey Software
* Licensed under MIT (https://github.com/chocolatey/choco-theme/blob/main/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/js/blog.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 35 additions & 33 deletions dist/js/boxstarter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* choco-theme v0.7.1 (https://github.com/chocolatey/choco-theme#readme)
* choco-theme v0.7.2 (https://github.com/chocolatey/choco-theme#readme)
* Copyright 2020-2024 Chocolatey Software
* Licensed under MIT (https://github.com/chocolatey/choco-theme/blob/main/LICENSE)
*/
Expand Down Expand Up @@ -19655,44 +19655,46 @@
const tabMultiAttribute = "data-choco-tab-multi";
const tabMultiElements = document.querySelectorAll(`[${tabMultiAttribute}]`);
const tabCookies = /* @__PURE__ */ new Set();
for (const tabElement of tabMultiElements) {
const tabMultiConfigAttribute = tabElement.getAttribute(tabMultiAttribute).replace(/\s/g, "");
let tabMultiConfig = null;
try {
tabMultiConfig = JSON.parse(tabMultiConfigAttribute != null ? tabMultiConfigAttribute : "");
} catch (error) {
console.error(`Invalid JSON: ${tabMultiConfigAttribute}`);
return;
}
for (const key in tabMultiConfig) {
if (Object.prototype.hasOwnProperty.call(tabMultiConfig, key)) {
tabCookies.add(key);
}
}
tabElement.addEventListener("click", () => {
const tabMultiValue = tabElement.getAttribute(tabMultiAttribute).replace(/\s/g, "");
for (const otherTab of tabMultiElements) {
const otherTabMultiValue = otherTab.getAttribute(tabMultiAttribute).replace(/\s/g, "");
if (otherTabMultiValue == null ? void 0 : otherTabMultiValue.includes(tabMultiValue != null ? tabMultiValue : "")) {
Tab.getOrCreateInstance(otherTab).show();
}
if (tabMultiElements.value) {
for (const tabElement of tabMultiElements) {
const tabMultiConfigAttribute = tabElement.getAttribute(tabMultiAttribute).replace(/\s/g, "");
let tabMultiConfig = null;
try {
tabMultiConfig = JSON.parse(tabMultiConfigAttribute != null ? tabMultiConfigAttribute : "");
} catch (error) {
console.error(`Invalid JSON: ${tabMultiConfigAttribute}`);
return;
}
const cookieDomain = ~location.hostname.indexOf("chocolatey.org") ? "domain=chocolatey.org;" : "";
for (const key in tabMultiConfig) {
if (Object.prototype.hasOwnProperty.call(tabMultiConfig, key)) {
const value = tabMultiConfig[key];
document.cookie = `${key}=${value}; ${setCookieExpirationNever2()}path=/; ${cookieDomain}`;
tabCookies.add(key);
}
}
});
}
for (const cookieName of tabCookies) {
const cookieValue = getCookie2(cookieName);
if (cookieValue) {
for (const tabElement of tabMultiElements) {
tabElement.addEventListener("click", () => {
const tabMultiValue = tabElement.getAttribute(tabMultiAttribute).replace(/\s/g, "");
if ((tabMultiValue == null ? void 0 : tabMultiValue.includes(cookieName)) && (tabMultiValue == null ? void 0 : tabMultiValue.includes(cookieValue))) {
Tab.getOrCreateInstance(tabElement).show();
for (const otherTab of tabMultiElements) {
const otherTabMultiValue = otherTab.getAttribute(tabMultiAttribute).replace(/\s/g, "");
if (otherTabMultiValue == null ? void 0 : otherTabMultiValue.includes(tabMultiValue != null ? tabMultiValue : "")) {
Tab.getOrCreateInstance(otherTab).show();
}
}
const cookieDomain = ~location.hostname.indexOf("chocolatey.org") ? "domain=chocolatey.org;" : "";
for (const key in tabMultiConfig) {
if (Object.prototype.hasOwnProperty.call(tabMultiConfig, key)) {
const value = tabMultiConfig[key];
document.cookie = `${key}=${value}; ${setCookieExpirationNever2()}path=/; ${cookieDomain}`;
}
}
});
}
for (const cookieName of tabCookies) {
const cookieValue = getCookie2(cookieName);
if (cookieValue) {
for (const tabElement of tabMultiElements) {
const tabMultiValue = tabElement.getAttribute(tabMultiAttribute).replace(/\s/g, "");
if ((tabMultiValue == null ? void 0 : tabMultiValue.includes(cookieName)) && (tabMultiValue == null ? void 0 : tabMultiValue.includes(cookieValue))) {
Tab.getOrCreateInstance(tabElement).show();
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions dist/js/boxstarter.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/community-package-differ.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* choco-theme v0.7.1 (https://github.com/chocolatey/choco-theme#readme)
* choco-theme v0.7.2 (https://github.com/chocolatey/choco-theme#readme)
* Copyright 2020-2024 Chocolatey Software
* Licensed under MIT (https://github.com/chocolatey/choco-theme/blob/main/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/js/community-package-differ.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js/community-package-stats.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* choco-theme v0.7.1 (https://github.com/chocolatey/choco-theme#readme)
* choco-theme v0.7.2 (https://github.com/chocolatey/choco-theme#readme)
* Copyright 2020-2024 Chocolatey Software
* Licensed under MIT (https://github.com/chocolatey/choco-theme/blob/main/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/js/community-package-stats.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 35 additions & 33 deletions dist/js/community-packages.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* choco-theme v0.7.1 (https://github.com/chocolatey/choco-theme#readme)
* choco-theme v0.7.2 (https://github.com/chocolatey/choco-theme#readme)
* Copyright 2020-2024 Chocolatey Software
* Licensed under MIT (https://github.com/chocolatey/choco-theme/blob/main/LICENSE)
*/
Expand Down Expand Up @@ -40244,44 +40244,46 @@ ${templateEnter}`;
const tabMultiAttribute = "data-choco-tab-multi";
const tabMultiElements = document.querySelectorAll(`[${tabMultiAttribute}]`);
const tabCookies = /* @__PURE__ */ new Set();
for (const tabElement of tabMultiElements) {
const tabMultiConfigAttribute = tabElement.getAttribute(tabMultiAttribute).replace(/\s/g, "");
let tabMultiConfig = null;
try {
tabMultiConfig = JSON.parse(tabMultiConfigAttribute != null ? tabMultiConfigAttribute : "");
} catch (error) {
console.error(`Invalid JSON: ${tabMultiConfigAttribute}`);
return;
}
for (const key in tabMultiConfig) {
if (Object.prototype.hasOwnProperty.call(tabMultiConfig, key)) {
tabCookies.add(key);
}
}
tabElement.addEventListener("click", () => {
const tabMultiValue = tabElement.getAttribute(tabMultiAttribute).replace(/\s/g, "");
for (const otherTab of tabMultiElements) {
const otherTabMultiValue = otherTab.getAttribute(tabMultiAttribute).replace(/\s/g, "");
if (otherTabMultiValue == null ? void 0 : otherTabMultiValue.includes(tabMultiValue != null ? tabMultiValue : "")) {
Tab.getOrCreateInstance(otherTab).show();
}
if (tabMultiElements.value) {
for (const tabElement of tabMultiElements) {
const tabMultiConfigAttribute = tabElement.getAttribute(tabMultiAttribute).replace(/\s/g, "");
let tabMultiConfig = null;
try {
tabMultiConfig = JSON.parse(tabMultiConfigAttribute != null ? tabMultiConfigAttribute : "");
} catch (error) {
console.error(`Invalid JSON: ${tabMultiConfigAttribute}`);
return;
}
const cookieDomain = ~location.hostname.indexOf("chocolatey.org") ? "domain=chocolatey.org;" : "";
for (const key in tabMultiConfig) {
if (Object.prototype.hasOwnProperty.call(tabMultiConfig, key)) {
const value = tabMultiConfig[key];
document.cookie = `${key}=${value}; ${setCookieExpirationNever2()}path=/; ${cookieDomain}`;
tabCookies.add(key);
}
}
});
}
for (const cookieName of tabCookies) {
const cookieValue = getCookie2(cookieName);
if (cookieValue) {
for (const tabElement of tabMultiElements) {
tabElement.addEventListener("click", () => {
const tabMultiValue = tabElement.getAttribute(tabMultiAttribute).replace(/\s/g, "");
if ((tabMultiValue == null ? void 0 : tabMultiValue.includes(cookieName)) && (tabMultiValue == null ? void 0 : tabMultiValue.includes(cookieValue))) {
Tab.getOrCreateInstance(tabElement).show();
for (const otherTab of tabMultiElements) {
const otherTabMultiValue = otherTab.getAttribute(tabMultiAttribute).replace(/\s/g, "");
if (otherTabMultiValue == null ? void 0 : otherTabMultiValue.includes(tabMultiValue != null ? tabMultiValue : "")) {
Tab.getOrCreateInstance(otherTab).show();
}
}
const cookieDomain = ~location.hostname.indexOf("chocolatey.org") ? "domain=chocolatey.org;" : "";
for (const key in tabMultiConfig) {
if (Object.prototype.hasOwnProperty.call(tabMultiConfig, key)) {
const value = tabMultiConfig[key];
document.cookie = `${key}=${value}; ${setCookieExpirationNever2()}path=/; ${cookieDomain}`;
}
}
});
}
for (const cookieName of tabCookies) {
const cookieValue = getCookie2(cookieName);
if (cookieValue) {
for (const tabElement of tabMultiElements) {
const tabMultiValue = tabElement.getAttribute(tabMultiAttribute).replace(/\s/g, "");
if ((tabMultiValue == null ? void 0 : tabMultiValue.includes(cookieName)) && (tabMultiValue == null ? void 0 : tabMultiValue.includes(cookieValue))) {
Tab.getOrCreateInstance(tabElement).show();
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions dist/js/community-packages.min.js

Large diffs are not rendered by default.

68 changes: 35 additions & 33 deletions dist/js/community.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* choco-theme v0.7.1 (https://github.com/chocolatey/choco-theme#readme)
* choco-theme v0.7.2 (https://github.com/chocolatey/choco-theme#readme)
* Copyright 2020-2024 Chocolatey Software
* Licensed under MIT (https://github.com/chocolatey/choco-theme/blob/main/LICENSE)
*/
Expand Down Expand Up @@ -21670,44 +21670,46 @@ ${templateEnter}`;
const tabMultiAttribute = "data-choco-tab-multi";
const tabMultiElements = document.querySelectorAll(`[${tabMultiAttribute}]`);
const tabCookies = /* @__PURE__ */ new Set();
for (const tabElement of tabMultiElements) {
const tabMultiConfigAttribute = tabElement.getAttribute(tabMultiAttribute).replace(/\s/g, "");
let tabMultiConfig = null;
try {
tabMultiConfig = JSON.parse(tabMultiConfigAttribute != null ? tabMultiConfigAttribute : "");
} catch (error) {
console.error(`Invalid JSON: ${tabMultiConfigAttribute}`);
return;
}
for (const key in tabMultiConfig) {
if (Object.prototype.hasOwnProperty.call(tabMultiConfig, key)) {
tabCookies.add(key);
}
}
tabElement.addEventListener("click", () => {
const tabMultiValue = tabElement.getAttribute(tabMultiAttribute).replace(/\s/g, "");
for (const otherTab of tabMultiElements) {
const otherTabMultiValue = otherTab.getAttribute(tabMultiAttribute).replace(/\s/g, "");
if (otherTabMultiValue == null ? void 0 : otherTabMultiValue.includes(tabMultiValue != null ? tabMultiValue : "")) {
Tab.getOrCreateInstance(otherTab).show();
}
if (tabMultiElements.value) {
for (const tabElement of tabMultiElements) {
const tabMultiConfigAttribute = tabElement.getAttribute(tabMultiAttribute).replace(/\s/g, "");
let tabMultiConfig = null;
try {
tabMultiConfig = JSON.parse(tabMultiConfigAttribute != null ? tabMultiConfigAttribute : "");
} catch (error) {
console.error(`Invalid JSON: ${tabMultiConfigAttribute}`);
return;
}
const cookieDomain = ~location.hostname.indexOf("chocolatey.org") ? "domain=chocolatey.org;" : "";
for (const key in tabMultiConfig) {
if (Object.prototype.hasOwnProperty.call(tabMultiConfig, key)) {
const value = tabMultiConfig[key];
document.cookie = `${key}=${value}; ${setCookieExpirationNever2()}path=/; ${cookieDomain}`;
tabCookies.add(key);
}
}
});
}
for (const cookieName of tabCookies) {
const cookieValue = getCookie2(cookieName);
if (cookieValue) {
for (const tabElement of tabMultiElements) {
tabElement.addEventListener("click", () => {
const tabMultiValue = tabElement.getAttribute(tabMultiAttribute).replace(/\s/g, "");
if ((tabMultiValue == null ? void 0 : tabMultiValue.includes(cookieName)) && (tabMultiValue == null ? void 0 : tabMultiValue.includes(cookieValue))) {
Tab.getOrCreateInstance(tabElement).show();
for (const otherTab of tabMultiElements) {
const otherTabMultiValue = otherTab.getAttribute(tabMultiAttribute).replace(/\s/g, "");
if (otherTabMultiValue == null ? void 0 : otherTabMultiValue.includes(tabMultiValue != null ? tabMultiValue : "")) {
Tab.getOrCreateInstance(otherTab).show();
}
}
const cookieDomain = ~location.hostname.indexOf("chocolatey.org") ? "domain=chocolatey.org;" : "";
for (const key in tabMultiConfig) {
if (Object.prototype.hasOwnProperty.call(tabMultiConfig, key)) {
const value = tabMultiConfig[key];
document.cookie = `${key}=${value}; ${setCookieExpirationNever2()}path=/; ${cookieDomain}`;
}
}
});
}
for (const cookieName of tabCookies) {
const cookieValue = getCookie2(cookieName);
if (cookieValue) {
for (const tabElement of tabMultiElements) {
const tabMultiValue = tabElement.getAttribute(tabMultiAttribute).replace(/\s/g, "");
if ((tabMultiValue == null ? void 0 : tabMultiValue.includes(cookieName)) && (tabMultiValue == null ? void 0 : tabMultiValue.includes(cookieValue))) {
Tab.getOrCreateInstance(tabElement).show();
}
}
}
}
Expand Down
Loading

0 comments on commit 2188941

Please sign in to comment.