Skip to content

Commit

Permalink
chore: fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
cpaulve-1A committed Jul 8, 2024
1 parent 3b2f6df commit 3f865b3
Show file tree
Hide file tree
Showing 21 changed files with 134 additions and 23 deletions.
9 changes: 8 additions & 1 deletion .yarn/sdks/eslint/bin/eslint.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint/bin/eslint.js
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

Expand Down
9 changes: 8 additions & 1 deletion .yarn/sdks/eslint/lib/api.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

Expand Down
9 changes: 8 additions & 1 deletion .yarn/sdks/eslint/lib/unsupported-api.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint/use-at-your-own-risk
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

Expand Down
9 changes: 8 additions & 1 deletion .yarn/sdks/typescript/bin/tsc
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/bin/tsc
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

Expand Down
9 changes: 8 additions & 1 deletion .yarn/sdks/typescript/bin/tsserver
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/bin/tsserver
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

Expand Down
9 changes: 8 additions & 1 deletion .yarn/sdks/typescript/lib/tsc.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/tsc.js
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

Expand Down
9 changes: 8 additions & 1 deletion .yarn/sdks/typescript/lib/tsserver.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/tsserver.js
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

Expand Down
9 changes: 8 additions & 1 deletion .yarn/sdks/typescript/lib/tsserverlibrary.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/tsserverlibrary.js
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

Expand Down
9 changes: 8 additions & 1 deletion .yarn/sdks/typescript/lib/typescript.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion apps/chrome-devtools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@o3r/chrome-devtools",
"version": "0.0.0-placeholder",
"version": "0.0.0",
"publishConfig": {
"access": "public"
},
Expand Down
6 changes: 6 additions & 0 deletions apps/chrome-devtools/schemas/state.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,27 @@
],
"properties": {
"color": {
"description": "Background color to identify the state in the selection widget.",
"type": "string"
},
"colorContrast": {
"description": "Text color for the state in the selection widget in contrast with the background color.",
"type": "string"
},
"name": {
"description": "User friendly name to identify the state in the Chrome Extension state panel.",
"type": "string"
},
"configurations": {
"type": "object",
"description": "List of the configuration-override to apply on the application.",
"additionalProperties": {
"type": "object"
}
},
"localizations": {
"type": "object",
"description": "List of the localization-override to apply on the application.",
"additionalProperties": {
"type": "object",
"additionalProperties": {
Expand All @@ -34,6 +39,7 @@
}
},
"stylingVariables": {
"description": "List of the css-variable-override to apply on the application.",
"type": "object",
"additionalProperties": {
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion apps/chrome-devtools/src/app-devtools/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</ng-template>
</li>
</ul>
<form [formGroup]="form" class="px-4 pt-{{hasLocalChanges() ? '2' : '3'}} ng-pristine ng-valid ng-touched border-bottom ms-auto">
<form [formGroup]="form" class="px-4 {{hasLocalChanges() ? 'pt-2' : 'pt-3'}} ng-pristine ng-valid ng-touched border-bottom ms-auto">
<div>
<ng-select
[ngbTooltip]="
Expand Down
2 changes: 1 addition & 1 deletion apps/chrome-devtools/src/app-devtools/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { ThemingPanelPresComponent } from './theming-panel/theming-panel-pres.co
selector: 'app-root',
templateUrl: './app.component.html',
styles: `
::ng-deep ng-select.local-change .ng-select-container {
:host ::ng-deep ng-select.local-change .ng-select-container {
border-color: var(--bs-recommend-warning-color);
border-width: medium;
box-sizing: content-box;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export class LocalizationPanelPresComponent implements OnDestroy {
private readonly connectionService = inject(ChromeExtensionConnectionService);
private readonly localizationService = inject(LocalizationService);
private readonly stateService = inject(StateService);
private readonly subscription = new Subscription();
private readonly maxItemDisplayed = 20;

public readonly isTranslationDeactivationEnabled = this.localizationService.isTranslationDeactivationEnabled;
public readonly localizations: Signal<LocalizationMetadata>;
Expand All @@ -71,15 +73,14 @@ export class LocalizationPanelPresComponent implements OnDestroy {
return this.stateService.localState()?.localizations?.[lang] || {};
});
public readonly activeStateName = computed(() => this.stateService.activeState()?.name);

public form = new FormGroup({
search: new FormControl(''),
lang: new FormControl(''),
showKeys: new FormControl(false),
translations: new FormGroup<Record<string, LangTranslationsControl>>({})
});

private readonly subscription = new Subscription();

public accordion = viewChild<NgbAccordionDirective>('acc');

constructor() {
Expand Down Expand Up @@ -114,7 +115,7 @@ export class LocalizationPanelPresComponent implements OnDestroy {
});

this.filteredLocalizations = computed(() => {
return searchMatch().slice(0, 20);
return searchMatch().slice(0, this.maxItemDisplayed);
});

this.isTruncated = computed(() => this.filteredLocalizations().length < searchMatch().length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ export class StatePanelComponent {
this.stateService.setActiveState(stateName);
}

/**
* Update a state and save its content in the Chrome Extension store.
* @param stateName
*/
public updateState(stateName: string) {
const control = this.form.controls.states.controls[stateName];
const activeState = this.activeState();
Expand All @@ -162,6 +166,9 @@ export class StatePanelComponent {
}
}

/**
* Create a new state and save its content in the Chrome Extension store.
*/
public saveNewState() {
if (this.form.value.newStateName) {
this.saveState(this.form.value.newStateName, this.form.value.newStateName, this.form.value.newStateColor || 'black');
Expand All @@ -174,12 +181,23 @@ export class StatePanelComponent {
}
}

/**
* Remove a state from the Chrome Extension application and store.
* Note that the active store cannot be deleted.
*
* @param stateName
*/
public deleteState(stateName: string) {
if (this.activeState()?.name !== stateName) {
this.stateService.deleteState(stateName);
}
}

/**
* Download a state as a json file
*
* @param stateName
*/
public exportState(stateName: string) {
const state = this.states()[stateName];
if (!state) {
Expand All @@ -192,6 +210,11 @@ export class StatePanelComponent {
a.click();
}

/**
* Download a state file, add it to the state list and share it .
*
* @param event
*/
public async onFileChange(event: InputEvent) {
try {
const element = event.target as HTMLInputElement;
Expand Down
Loading

0 comments on commit 3f865b3

Please sign in to comment.