Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into chore/add-more-memory-tests
  • Loading branch information
Rajdeep Chandra authored and Rajdeep Chandra committed Apr 30, 2024
2 parents d5ce266 + 8b61b0a commit df769ac
Show file tree
Hide file tree
Showing 52 changed files with 1,344 additions and 1,153 deletions.
2 changes: 1 addition & 1 deletion .stylelintrc.json
@@ -1,6 +1,6 @@
{
"plugins": ["./linters/stylelint-header"],
"extends": ["stylelint-config-standard", "stylelint-config-prettier"],
"extends": ["stylelint-config-standard"],
"rules": {
"header/header": ["config/license.js", {}],
"length-zero-no-unit": [true, { "ignore": "custom-properties" }],
Expand Down
4 changes: 2 additions & 2 deletions linters/stylelint-header/package.json
Expand Up @@ -22,7 +22,7 @@
"linter"
],
"peerDependencies": {
"stylelint": "^13.0.0 || ^14.0.0"
"stylelint": "^13.0.0 || ^14.0.0 || ^16.0.0"
},
"dependencies": {
"string-similarity": "^4.0.4"
Expand All @@ -31,7 +31,7 @@
"jest": "^27.0.1",
"jest-preset-stylelint": "^5.0.2",
"lodash": "^4.17.21",
"stylelint": "^14.2.0"
"stylelint": "^16.0.0"
},
"jest": {
"preset": "jest-preset-stylelint"
Expand Down
18 changes: 9 additions & 9 deletions package.json
Expand Up @@ -98,10 +98,10 @@
"@commitlint/config-lerna-scopes": "^19.0.0",
"@custom-elements-manifest/analyzer": "^0.9.0",
"@geometricpanda/storybook-addon-badges": "^2.0.2",
"@lit/react": "^1.0.2",
"@lit/react": "^1.0.4",
"@netlify/build": "^29.1.0",
"@open-wc/dev-server-hmr": "^0.2.0",
"@open-wc/testing": "^3.2.0",
"@open-wc/testing": "^4.0.0",
"@playwright/test": "^1.43.1",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.0.1",
Expand Down Expand Up @@ -140,12 +140,12 @@
"alex": "^11.0.1",
"cem-plugin-module-file-extensions": "^0.0.5",
"chalk": "^5.0.1",
"chromedriver": "^123.0.0",
"chromedriver": "^124.0.0",
"common-tags": "^1.8.2",
"custom-elements-manifest": "^2.0.0",
"debounce": "^2.0.0",
"deepmerge": "^4.2.2",
"esbuild": "^0.19.0",
"esbuild": "^0.20.0",
"eslint": "^8.23.0",
"eslint-config-prettier": "^9.0.0",
"eslint-formatter-pretty": "^5.0.0",
Expand All @@ -165,9 +165,9 @@
"latest-version": "^7.0.0",
"lerna": "^6.6.2",
"lightningcss": "^1.24.0",
"lit": "^2.5.0",
"lit": "^2.5.0 || ^3.1.3",
"lit-analyzer": "^2.0.3",
"lit-html": "^2.4.0",
"lit-html": "^2.4.0 || ^3.1.3",
"mocha-junit-reporter": "^2.0.2",
"netlify-cli": "^15.9.0",
"next": "^14",
Expand All @@ -185,9 +185,8 @@
"rollup": "^4.12.0",
"sinon": "^17.0.1",
"storybook": "^7.5.0",
"stylelint": "^15.10.2",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-standard": "^34.0.0",
"stylelint": "^16.4.0",
"stylelint-config-standard": "^36.0.0",
"tachometer": "^0.7.0",
"tar-stream": "^3.0.0",
"terser": "^4.8.1",
Expand Down Expand Up @@ -246,6 +245,7 @@
],
"output": [
"packages/**/*.js",
"packages/**/*.dev.js",
"projects/**/*.js",
"packages/**/*.js.map",
"projects/**/*.js.map",
Expand Down
34 changes: 11 additions & 23 deletions packages/action-menu/src/action-menu.css
Expand Up @@ -58,30 +58,18 @@ governing permissions and limitations under the License.

:host([dir]) slot[icon-only]::slotted([slot='icon']),
:host([dir]) slot[icon-only] .icon {
margin-inline-end: calc(
(
var(
--custom-actionbutton-edge-to-text,
var(--spectrum-actionbutton-edge-to-text)
) -
margin-inline: calc(
(
var(
--custom-actionbutton-edge-to-visual-only,
var(--spectrum-actionbutton-edge-to-visual-only)
)
) * -1
);
margin-inline-start: calc(
(
var(
--custom-actionbutton-edge-to-text,
var(--spectrum-actionbutton-edge-to-text)
) -
var(
--custom-actionbutton-edge-to-visual-only,
var(--spectrum-actionbutton-edge-to-visual-only)
)
) * -1
); /* .spectrum-ActionButton-hold+.spectrum-ActionButton-icon,
--custom-actionbutton-edge-to-text,
var(--spectrum-actionbutton-edge-to-text)
) -
var(
--custom-actionbutton-edge-to-visual-only,
var(--spectrum-actionbutton-edge-to-visual-only)
)
) * -1
); /* .spectrum-ActionButton-hold+.spectrum-ActionButton-icon,
* .spectrum-ActionButton-icon:only-child */
}

Expand Down
2 changes: 1 addition & 1 deletion packages/alert-dialog/package.json
Expand Up @@ -57,7 +57,7 @@
"lit-html"
],
"dependencies": {
"@lit-labs/observers": "^2.0.0",
"@lit-labs/observers": "^2.0.2",
"@spectrum-web-components/base": "^0.42.2",
"@spectrum-web-components/button": "^0.42.2",
"@spectrum-web-components/button-group": "^0.42.2",
Expand Down
8 changes: 4 additions & 4 deletions packages/coachmark/src/coachmark.css
Expand Up @@ -41,10 +41,10 @@ governing permissions and limitations under the License.

.keys {
align-items: center;
column-gap: var(--spectrum-coachmark-dimension-size-50);
gap: var(--spectrum-coachmark-dimension-size-175)
var(--spectrum-coachmark-dimension-size-50);
display: flex;
flex-flow: wrap;
row-gap: var(--spectrum-coachmark-dimension-size-175);
font-family: var(
--mod-body-sans-serif-font-family,
var(--spectrum-body-sans-serif-font-family)
Expand All @@ -55,8 +55,8 @@ governing permissions and limitations under the License.
align-items: center;
display: flex;
flex-wrap: wrap;
row-gap: var(--spectrum-coachmark-dimension-size-175);
column-gap: var(--spectrum-coachmark-dimension-size-200);
gap: var(--spectrum-coachmark-dimension-size-175)
var(--spectrum-coachmark-dimension-size-200);
}

.static-item {
Expand Down
18 changes: 15 additions & 3 deletions packages/combobox/src/spectrum-combobox.css
Expand Up @@ -467,7 +467,11 @@ governing permissions and limitations under the License.

:host([keyboard-focused])
.button:not(:disabled, .is-invalid, .spectrum-PickerButton--quiet),
.button:not(:disabled, .is-invalid, .spectrum-PickerButton--quiet):focus-visible,
.button:not(
:disabled,
.is-invalid,
.spectrum-PickerButton--quiet
):focus-visible,
:host([keyboard-focused])
.button:not(:disabled, .is-invalid, .spectrum-PickerButton--quiet) {
--mod-picker-button-border-color: var(
Expand Down Expand Up @@ -632,9 +636,17 @@ governing permissions and limitations under the License.
);
}

.button:not(:disabled, .is-invalid, .spectrum-PickerButton--quiet):focus:hover,
.button:not(
:disabled,
.is-invalid,
.spectrum-PickerButton--quiet
):focus:hover,
:host([focused])
.button:not(:disabled, .is-invalid, .spectrum-PickerButton--quiet):hover,
.button:not(
:disabled,
.is-invalid,
.spectrum-PickerButton--quiet
):hover,
:host(:hover):has(:focus)
.button:not(:disabled, .is-invalid, .spectrum-PickerButton--quiet),
:host([focused]:hover)
Expand Down
2 changes: 1 addition & 1 deletion packages/menu/package.json
Expand Up @@ -84,7 +84,7 @@
"lit-html"
],
"dependencies": {
"@lit-labs/observers": "^2.0.0",
"@lit-labs/observers": "^2.0.2",
"@spectrum-web-components/action-button": "^0.42.2",
"@spectrum-web-components/base": "^0.42.2",
"@spectrum-web-components/divider": "^0.42.2",
Expand Down
26 changes: 15 additions & 11 deletions packages/menu/test/submenu.test.ts
Expand Up @@ -197,13 +197,21 @@ describe('Submenu', () => {
await sendKeys({
press: 'Tab',
});
await elementUpdated(this.el);
await nextFrame();
await nextFrame();
await sendKeys({
press: 'ArrowDown',
});
await elementUpdated(this.rootItem);
expect(this.rootItem.active).to.be.false;
expect(this.rootItem.focused).to.be.true;
expect(this.rootItem.open).to.be.false;
await elementUpdated(this.el);
await nextFrame();
await nextFrame();
expect(this.rootItem.active, 'not active').to.be.false;
expect(
this.rootItem.focused,
`focused: ${document.activeElement?.localName}`
).to.be.true;
expect(this.rootItem.open, 'not open').to.be.false;

const opened = oneEvent(this.rootItem, 'sp-opened');
await sendKeys({
Expand Down Expand Up @@ -541,12 +549,10 @@ describe('Submenu', () => {
</sp-menu>
`);
await elementUpdated(this.el);
await nextFrame();
await nextFrame();

this.rootItem = this.el.querySelector('.root') as MenuItem;
await elementUpdated(this.rootItem);
});
describe('selects', () => {
describe.skip('selects', () => {
selectWithPointer();
selectsWithKeyboardData.map((testData) => {
selectsWithKeyboard(testData);
Expand Down Expand Up @@ -583,10 +589,8 @@ describe('Submenu', () => {
</sp-menu>
`);
await elementUpdated(this.el);
await nextFrame();
await nextFrame();

this.rootItem = this.el.querySelector('.root') as MenuItem;
await elementUpdated(this.rootItem);
});
describe('selects', () => {
selectWithPointer();
Expand Down
8 changes: 8 additions & 0 deletions packages/overlay/package.json
Expand Up @@ -77,6 +77,10 @@
"development": "./src/VirtualTrigger.dev.js",
"default": "./src/VirtualTrigger.js"
},
"./src/events.js": {
"development": "./src/events.dev.js",
"default": "./src/events.js"
},
"./src/fullSizePlugin.js": {
"development": "./src/fullSizePlugin.dev.js",
"default": "./src/fullSizePlugin.js"
Expand Down Expand Up @@ -115,6 +119,10 @@
"development": "./src/slottable-request-event.dev.js",
"default": "./src/slottable-request-event.js"
},
"./src/strategies.js": {
"development": "./src/strategies.dev.js",
"default": "./src/strategies.js"
},
"./active-overlay.js": {
"development": "./active-overlay.dev.js",
"default": "./active-overlay.js"
Expand Down
81 changes: 13 additions & 68 deletions packages/overlay/src/AbstractOverlay.ts
Expand Up @@ -19,7 +19,6 @@ import type {
OverlayState,
OverlayTypes,
Placement,
TriggerInteractions,
TriggerInteractionsV1,
} from './overlay-types.js';
import type { Overlay } from './Overlay.js';
Expand All @@ -34,65 +33,6 @@ export const noop = (): void => {
return;
};

export class BeforetoggleClosedEvent extends Event {
currentState = 'open';
newState = 'closed';
constructor() {
super('beforetoggle', {
bubbles: false,
composed: false,
});
}
}

export class BeforetoggleOpenEvent extends Event {
currentState = 'closed';
newState = 'open';
constructor() {
super('beforetoggle', {
bubbles: false,
composed: false,
});
}
}

export class OverlayStateEvent extends Event {
detail!: {
interaction: string;
reason?: 'external-click';
};

constructor(
type: string,
public overlay: HTMLElement,
{
publish,
interaction,
reason,
}: {
publish?: boolean;
interaction: TriggerInteractions;
reason?: 'external-click';
}
) {
super(type, {
bubbles: publish,
composed: publish,
});
this.detail = {
interaction,
reason,
};
}
}

declare global {
interface GlobalEventHandlersEventMap {
'sp-open': OverlayStateEvent;
'sp-close': OverlayStateEvent;
}
}

/**
* Apply a "transitionend" listener to an element that may not transition but
* guarantee the callback will be fired either way.
Expand Down Expand Up @@ -357,13 +297,15 @@ export class AbstractOverlay extends SpectrumElement {
const options = optionsV1;
AbstractOverlay.applyOptions(overlay, {
...options,
delayed: options.delayed || overlayContent.hasAttribute('delayed'),
delayed:
options.delayed || overlayContent.hasAttribute('delayed'),
trigger: options.virtualTrigger || trigger,
type: interaction === 'modal'
? 'modal'
: interaction === 'hover'
? 'hint'
: 'auto'
type:
interaction === 'modal'
? 'modal'
: interaction === 'hover'
? 'hint'
: 'auto',
});
trigger.insertAdjacentElement('afterend', overlay);
await overlay.updateComplete;
Expand All @@ -375,7 +317,7 @@ export class AbstractOverlay extends SpectrumElement {
overlay.append(overlayContent);
AbstractOverlay.applyOptions(overlay, {
...options,
delayed: options.delayed || overlayContent.hasAttribute('delayed')
delayed: options.delayed || overlayContent.hasAttribute('delayed'),
});
overlay.updateComplete.then(() => {
// Do we want to "open" this path, or leave that to the consumer?
Expand All @@ -384,7 +326,10 @@ export class AbstractOverlay extends SpectrumElement {
return overlay;
}

static applyOptions(overlay: Overlay, options: OverlayOptions): void {
static applyOptions(
overlay: AbstractOverlay,
options: OverlayOptions
): void {
overlay.delayed = !!options.delayed;
overlay.receivesFocus = options.receivesFocus ?? 'auto';
overlay.triggerElement = options.trigger || null;
Expand Down

0 comments on commit df769ac

Please sign in to comment.