diff --git a/build-script/pack-ccx.mjs b/build-script/pack-ccx.mjs index 9ebaa65..89312e0 100644 --- a/build-script/pack-ccx.mjs +++ b/build-script/pack-ccx.mjs @@ -1,32 +1,33 @@ -import chalk from 'chalk'; -import { program } from 'commander'; -import { createWriteStream, readFileSync, statSync, writeFileSync } from 'fs'; -import { globSync } from 'glob'; -import { dirname, join, relative } from 'path'; -import { fileURLToPath } from 'url'; +import chalk from 'chalk' +import { program } from 'commander' +import { createWriteStream, readFileSync, statSync, writeFileSync } from 'fs' +import { globSync } from 'glob' +import { dirname, join, relative } from 'path' +import { fileURLToPath } from 'url' import yazl from 'yazl' const __dirname = dirname(fileURLToPath(import.meta.url)) const basePath = join(__dirname, '..') -program - .requiredOption("--version ", "the target platform") - .parse(); +program.requiredOption('--version ', 'the target platform').parse() -const version = program.opts().version; -if (!version.match(/\d+\.\d+\.\d+/)) throw new Error(`invalid version format: ${version}`); +const version = program.opts().version +if (!version.match(/\d+\.\d+\.\d+/)) + throw new Error(`invalid version format: ${version}`) -console.log(chalk.cyan("rewriting manifest.json's version field to " + version)); -const manifest = JSON.parse(readFileSync(`${basePath}/manifest.json`, 'utf-8')); -manifest.version = version; -writeFileSync(`${basePath}/manifest.json`, JSON.stringify(manifest)); +console.log(chalk.cyan("rewriting manifest.json's version field to " + version)) +const manifest = JSON.parse(readFileSync(`${basePath}/manifest.json`, 'utf-8')) +manifest.version = version +writeFileSync(`${basePath}/manifest.json`, JSON.stringify(manifest)) -console.log(chalk.cyan("rewriting package.json's version field to " + version)); -const packageJSON = JSON.parse(readFileSync(`${basePath}/package.json`, 'utf-8')); -packageJSON.version = version; -writeFileSync(`${basePath}/package.json`, JSON.stringify(packageJSON)); +console.log(chalk.cyan("rewriting package.json's version field to " + version)) +const packageJSON = JSON.parse( + readFileSync(`${basePath}/package.json`, 'utf-8') +) +packageJSON.version = version +writeFileSync(`${basePath}/package.json`, JSON.stringify(packageJSON)) -console.log(chalk.cyan("packaging .ccx")); +console.log(chalk.cyan('packaging .ccx')) const zipList = [ './manifest.json', './i18n/**/*', @@ -46,24 +47,28 @@ const zipList = [ './*.png', ] -const zipfile = new yazl.ZipFile(); +const zipfile = new yazl.ZipFile() -zipList.forEach(globber => { - globSync( - join(basePath, globber).replace(/\\/g, '/') - ).forEach(filepath => { - if (statSync(filepath).isDirectory()) return; +zipList.forEach((globber) => { + globSync(join(basePath, globber).replace(/\\/g, '/')).forEach( + (filepath) => { + if (statSync(filepath).isDirectory()) return - const rpath = relative(basePath, filepath); - zipfile.addFile(filepath, rpath) - }) + const rpath = relative(basePath, filepath) + zipfile.addFile(filepath, rpath) + } + ) }) zipfile.outputStream.pipe( - createWriteStream(join(basePath, `Auto.Photoshop.SD.plugin_v${version}.ccx`)) -); + createWriteStream( + join(basePath, `Auto.Photoshop.SD.plugin_v${version}.ccx`) + ) +) zipfile.outputStream.pipe( - createWriteStream(join(basePath, `Auto.Photoshop.SD.plugin_v${version}.zip`)) -); + createWriteStream( + join(basePath, `Auto.Photoshop.SD.plugin_v${version}.zip`) + ) +) -zipfile.end() \ No newline at end of file +zipfile.end() diff --git a/typescripts/after_detailer/style/after_detailer.css b/typescripts/after_detailer/style/after_detailer.css index ccdc074..878ef8e 100644 --- a/typescripts/after_detailer/style/after_detailer.css +++ b/typescripts/after_detailer/style/after_detailer.css @@ -37,4 +37,4 @@ margin: 0; padding: 0; border: none; -} \ No newline at end of file +} diff --git a/typescripts/controlnet/entry.ts b/typescripts/controlnet/entry.ts index ec879fc..43b35c1 100644 --- a/typescripts/controlnet/entry.ts +++ b/typescripts/controlnet/entry.ts @@ -39,7 +39,8 @@ async function requestControlNetApiVersion() { async function requestControlNetMaxUnits() { const json = await api.requestGet(`${g_sd_url}/controlnet/settings`) - const control_net_max_models_num = (json?.control_net_unit_count || json?.control_net_max_models_num) ?? 0 + const control_net_max_models_num = + (json?.control_net_unit_count || json?.control_net_max_models_num) ?? 0 return control_net_max_models_num } diff --git a/typescripts/sd_tab/util.ts b/typescripts/sd_tab/util.ts index eed3dfc..14b4ecc 100644 --- a/typescripts/sd_tab/util.ts +++ b/typescripts/sd_tab/util.ts @@ -259,7 +259,7 @@ export async function updateClickEventHandler(current_version: string) { online_data.new_version ) - let header_message = "Your Plugin is up to date." + let header_message = 'Your Plugin is up to date.' let long_message = '' if (b_need_update) { header_message = `New Version is Available (${online_data.new_version})` diff --git a/typescripts/session/style/generate.css b/typescripts/session/style/generate.css index 27158ef..d2297cc 100644 --- a/typescripts/session/style/generate.css +++ b/typescripts/session/style/generate.css @@ -5,16 +5,9 @@ } .generateColor { - background-color: #ff595e; - } .generateMoreColor { - background-color: #6db579; - - - - -} \ No newline at end of file +} diff --git a/typescripts/tool_bar/style/tool_bar.css b/typescripts/tool_bar/style/tool_bar.css index ffb8506..9bd51b5 100644 --- a/typescripts/tool_bar/style/tool_bar.css +++ b/typescripts/tool_bar/style/tool_bar.css @@ -1,4 +1,4 @@ /* styles.css */ #_tool_bar_container button:not(:last-child) { margin-bottom: 3px; -} \ No newline at end of file +} diff --git a/typescripts/util/ts/document.ts b/typescripts/util/ts/document.ts index 786b93d..7592822 100644 --- a/typescripts/util/ts/document.ts +++ b/typescripts/util/ts/document.ts @@ -251,7 +251,8 @@ export async function base64ToFileAndGetLayer( _obj: 'rectangle', bottom: { _unit: 'pixelsUnit', - _value: jimp_image.bitmap.height * willScaleSize, + _value: + jimp_image.bitmap.height * willScaleSize, }, left: { _unit: 'pixelsUnit', @@ -274,7 +275,7 @@ export async function base64ToFileAndGetLayer( commandName: 'select import area', } ) - + await executeAsModal( async () => { const result = await batchPlay( @@ -288,19 +289,25 @@ export async function base64ToFileAndGetLayer( }, freeTransformCenterState: { _enum: 'quadCenterState', - _value: "QCSCorner0" + _value: 'QCSCorner0', }, offset: { - _obj: "offset", - horizontal: { _unit: "pixelsUnit", _value: 0.0 }, - vertical: { _unit: "pixelsUnit", _value: 0.0 } + _obj: 'offset', + horizontal: { _unit: 'pixelsUnit', _value: 0.0 }, + vertical: { _unit: 'pixelsUnit', _value: 0.0 }, }, _isCommand: true, _options: { dialogOptions: 'dontDisplay', }, - width: { "_unit": "percentUnit", "_value": 1 / willScaleSize * 100 }, - height: { "_unit": "percentUnit", "_value": 1 / willScaleSize * 100 } + width: { + _unit: 'percentUnit', + _value: (1 / willScaleSize) * 100, + }, + height: { + _unit: 'percentUnit', + _value: (1 / willScaleSize) * 100, + }, }, ], {} diff --git a/typescripts/viewer/style/preview.css b/typescripts/viewer/style/preview.css index 0437d3a..03f111c 100644 --- a/typescripts/viewer/style/preview.css +++ b/typescripts/viewer/style/preview.css @@ -3,4 +3,4 @@ border-right: 2px solid #3e3e3e; margin: 0; width: 100%; -} \ No newline at end of file +}