CherryPick🍒

This commit is contained in:
NoriDev 2023-05-28 20:37:55 +09:00
parent e90b9537ea
commit 32312f267a
8 changed files with 15 additions and 13 deletions

View file

@ -45,7 +45,7 @@ fs.readFile(
micromatch(Array.from(modules), [ micromatch(Array.from(modules), [
'../../assets/**', '../../assets/**',
'../../fluent-emojis/**', '../../fluent-emojis/**',
'../../locales/ja-JP.yml', '../../locales/ko-KR.yml',
'../../misskey-assets/**', '../../misskey-assets/**',
'assets/**', 'assets/**',
'public/**', 'public/**',

View file

@ -60,7 +60,7 @@ export function file(isSensitive = false) {
}; };
} }
export function userDetailed(id = 'someuserid', username = 'miskist', host = 'misskey-hub.net', name = 'Misskey User'): entities.UserDetailed { export function userDetailed(id = 'someuserid', username = 'miskist', host = 'misskey-hub.net', name = 'CherryPick User'): entities.UserDetailed {
return { return {
id, id,
username, username,

File diff suppressed because one or more lines are too long

View file

@ -4,6 +4,6 @@ import * as locales from '../../../locales';
writeFile( writeFile(
resolve(__dirname, 'locale.ts'), resolve(__dirname, 'locale.ts'),
`export default ${JSON.stringify(locales['ja-JP'], undefined, 2)} as const;`, `export default ${JSON.stringify(locales['ko-KR'], undefined, 2)} as const;`,
'utf8', 'utf8',
) )

View file

@ -5,6 +5,7 @@ import * as JSON5 from 'json5';
const keys = [ const keys = [
'_dark', '_dark',
'_light', '_light',
'l-cherrypick',
'l-light', 'l-light',
'l-coffee', 'l-coffee',
'l-apricot', 'l-apricot',
@ -14,6 +15,7 @@ const keys = [
'l-cherry', 'l-cherry',
'l-sushi', 'l-sushi',
'l-u0', 'l-u0',
'd-cherrypick',
'd-dark', 'd-dark',
'd-persimmon', 'd-persimmon',
'd-astro', 'd-astro',

View file

@ -14,7 +14,7 @@ const appInitialized = Symbol();
let lastStory = null; let lastStory = null;
let moduleInitialized = false; let moduleInitialized = false;
let unobserve = () => {}; let unobserve = () => {};
let misskeyOS = null; let cherrypickOS = null;
function loadTheme(applyTheme: typeof import('../src/scripts/theme')['applyTheme']) { function loadTheme(applyTheme: typeof import('../src/scripts/theme')['applyTheme']) {
unobserve(); unobserve();
@ -26,7 +26,7 @@ function loadTheme(applyTheme: typeof import('../src/scripts/theme')['applyTheme
} }
const observer = new MutationObserver((entries) => { const observer = new MutationObserver((entries) => {
for (const entry of entries) { for (const entry of entries) {
if (entry.attributeName === 'data-misskey-theme') { if (entry.attributeName === 'data-cherrypick-theme') {
const target = entry.target as HTMLElement; const target = entry.target as HTMLElement;
const theme = themes[target.dataset.misskeyTheme]; const theme = themes[target.dataset.misskeyTheme];
if (theme) { if (theme) {
@ -39,7 +39,7 @@ function loadTheme(applyTheme: typeof import('../src/scripts/theme')['applyTheme
}); });
observer.observe(document.documentElement, { observer.observe(document.documentElement, {
attributes: true, attributes: true,
attributeFilter: ['data-misskey-theme'], attributeFilter: ['data-cherrypick-theme'],
}); });
unobserve = () => observer.disconnect(); unobserve = () => observer.disconnect();
} }
@ -76,7 +76,7 @@ queueMicrotask(() => {
components(app); components(app);
directives(app); directives(app);
widgets(app); widgets(app);
misskeyOS = os; cherrypickOS = os;
if (isChromatic()) { if (isChromatic()) {
defaultStore.set('animation', false); defaultStore.set('animation', false);
} }
@ -123,7 +123,7 @@ const preview = {
setup() { setup() {
return { return {
context, context,
popups: misskeyOS.popups, popups: cherrypickOS.popups,
}; };
}, },
template: template:

View file

@ -2,11 +2,11 @@ import { Meta } from '@storybook/blocks'
<Meta title="index" /> <Meta title="index" />
# Welcome to Misskey Storybook # Welcome to <span style={{ color: '#ffbcdc', fontSize: 'inherit' }}>Cherry</span><span style={{ color: '#b1d3ff', fontSize: 'inherit' }}>Pick</span> Storybook
This project uses [Storybook](https://storybook.js.org/) to develop and document components. This project uses [Storybook](https://storybook.js.org/) to develop and document components.
You can find more information about the usage of Storybook in this project in the CONTRIBUTING.md file placed in the root of this repository. You can find more information about the usage of Storybook in this project in the CONTRIBUTING.md file placed in the root of this repository.
The Misskey Storybook is under development and not all components are documented yet. The CherryPick Storybook is under development and not all components are documented yet.
Contributions are welcome! Please refer to [#10336](https://github.com/misskey-dev/misskey/issues/10336) for more information. Contributions are welcome! Please refer to [#10336](https://github.com/misskey-dev/misskey/issues/10336) for more information.
Thank you for your support! Thank you for your support!

View file

@ -100,7 +100,7 @@ export function getConfig(): UserConfig {
_LANGS_: JSON.stringify(Object.entries(locales).map(([k, v]) => [k, v._lang_])), _LANGS_: JSON.stringify(Object.entries(locales).map(([k, v]) => [k, v._lang_])),
_ENV_: JSON.stringify(process.env.NODE_ENV), _ENV_: JSON.stringify(process.env.NODE_ENV),
_DEV_: process.env.NODE_ENV !== 'production', _DEV_: process.env.NODE_ENV !== 'production',
_PERF_PREFIX_: JSON.stringify('Misskey:'), _PERF_PREFIX_: JSON.stringify('CherryPick:'),
_DATA_TRANSFER_DRIVE_FILE_: JSON.stringify('mk_drive_file'), _DATA_TRANSFER_DRIVE_FILE_: JSON.stringify('mk_drive_file'),
_DATA_TRANSFER_DRIVE_FOLDER_: JSON.stringify('mk_drive_folder'), _DATA_TRANSFER_DRIVE_FOLDER_: JSON.stringify('mk_drive_folder'),
_DATA_TRANSFER_DECK_COLUMN_: JSON.stringify('mk_deck_column'), _DATA_TRANSFER_DECK_COLUMN_: JSON.stringify('mk_deck_column'),